- i'm using sipeksdk_mobile.dll. BTW, i can't seem to be able to
retrieve the latest source; one that supports e.g
"pjsipStackProxy.Instance.ConfigMore.logLevel = 5;"
- i can make an outgoing call but can't get notified of incoming
calls; i suppose i have the wrong version of the mobile sdk but each
time i get the latest from the svn repo, the results are the same.
- just where are the latest sources?
Receiving notification for incoming calls seems to be a frequent issue
and I am surprised that we have yet to obtain a clear, concise and
well defined solution, at least as a simple tutorial.
I myself am having troubles with having an incoming call callback
method being called.
Having read the available documentation and studied and reversed
engineered all available source code I am well aware of what I should
do but cannot, for some reason, make it work.
I have tried two approaches and failed at both:
// Instance of incoming call
private IStateMachine _incall = null;
[...]
// Registering incoming call callback in the form's
constructor
CallManager.IncomingCallNotification += new
DIncomingCallNotification(CallManager_IncomingCallNotification);
> - i'm using sipeksdk_mobile.dll. BTW, i can't seem to be able to
> retrieve the latest source; one that supports e.g
> "pjsipStackProxy.Instance.ConfigMore.logLevel = 5;"
> - i can make an outgoing call but can't get notified of incoming
> calls; i suppose i have the wrong version of the mobile sdk but each
> time i get the latest from the svn repo, the results are the same.
> - just where are the latest sources?
I had built my own pjsipDll.dll library by downloading the pjsip
source (pjproject-1.1) and wrapping it with the pjsipDll library
source from the SVN trunk repository.
It turns out that using my own built pjsipDll.dll library was the
issue. I removed it and replaced it by the pre-built one (available at
http://code.google.com/p/sipeksdk/) and everything worked fine.
So, I either didn't properly build the pjsip and/or pjsipDll source or
there was a problem in the soruce code of the pjsipDll trunk at the
time of my checkout (which is why projects should have stable tagged
releases available for checkouts instead of just the trunk)
Anyhow, I hope this helps, for the record at least!
Cheers,
- Georges
On Apr 1, 7:01 pm, Georges <Georges.Labre...@gmail.com> wrote:
> Receiving notification for incoming calls seems to be a frequent issue
> and I am surprised that we have yet to obtain a clear, concise and
> well defined solution, at least as a simple tutorial.
> I myself am having troubles with having an incoming call callback
> method being called.
> Having read the available documentation and studied and reversed
> engineered all available source code I am well aware of what I should
> do but cannot, for some reason, make it work.
> I have tried two approaches and failed at both:
> /-------------------------------code sniplet - end
> -------------------------------/
> This third approach does not function for me either.
> What could be the issue? What am I missing? Any suggestions?
> Thanks and regards,
> - Georges
> On Mar 31, 4:36 am, izmoto <paul.mun...@gmail.com> wrote:
> > Hi,
> > - i'm using sipeksdk_mobile.dll. BTW, i can't seem to be able to
> > retrieve the latest source; one that supports e.g
> > "pjsipStackProxy.Instance.ConfigMore.logLevel = 5;"
> > - i can make an outgoing call but can't get notified of incoming
> > calls; i suppose i have the wrong version of the mobile sdk but each
> > time i get the latest from the svn repo, the results are the same.
> > - just where are the latest sources?
- I've tracked down the source of my trouble; CCallManager class.
- when the function 'OnIncomingCall(int sessionId, string number,
string info)' is invoked, the state machine is null so the function
returns.
- what could cause this?
Regards,
izmoto.
On Apr 2, 7:36 pm, Georges <Georges.Labre...@gmail.com> wrote:
> I had built my own pjsipDll.dll library by downloading the pjsip
> source (pjproject-1.1) and wrapping it with the pjsipDll library
> source from the SVN trunk repository.
> It turns out that using my own built pjsipDll.dll library was the
> issue. I removed it and replaced it by the pre-built one (available athttp://code.google.com/p/sipeksdk/) and everything worked fine.
> So, I either didn't properly build the pjsip and/or pjsipDll source or
> there was a problem in the soruce code of the pjsipDll trunk at the
> time of my checkout (which is why projects should have stable tagged
> releases available for checkouts instead of just the trunk)
> Anyhow, I hope this helps, for the record at least!
> Cheers,
> - Georges
> On Apr 1, 7:01 pm, Georges <Georges.Labre...@gmail.com> wrote:
> > Hello,
> > Receiving notification for incoming calls seems to be a frequent issue
> > and I am surprised that we have yet to obtain a clear, concise and
> > well defined solution, at least as a simple tutorial.
> > I myself am having troubles with having an incoming call callback
> > method being called.
> > Having read the available documentation and studied and reversed
> > engineered all available source code I am well aware of what I should
> > do but cannot, for some reason, make it work.
> > I have tried two approaches and failed at both:
> > /-------------------------------code sniplet - end
> > -------------------------------/
> > This third approach does not function for me either.
> > What could be the issue? What am I missing? Any suggestions?
> > Thanks and regards,
> > - Georges
> > On Mar 31, 4:36 am, izmoto <paul.mun...@gmail.com> wrote:
> > > Hi,
> > > - i'm using sipeksdk_mobile.dll. BTW, i can't seem to be able to
> > > retrieve the latest source; one that supports e.g
> > > "pjsipStackProxy.Instance.ConfigMore.logLevel = 5;"
> > > - i can make an outgoing call but can't get notified of incoming
> > > calls; i suppose i have the wrong version of the mobile sdk but each
> > > time i get the latest from the svn repo, the results are the same.
> > > - just where are the latest sources?
I've referenced the sipeksdk_mobile project directly and the problem
indicated to you earlier seems to be emanating form the function below
in the callmanager class;
- the state machine 'call' is always null [DisableStateNotifications
property is true] so the function returns and the event is never
raised. What could be the cause of this? (state machine is null).
Regards,
On Apr 3, 2:49 pm, izmoto <paul.mun...@gmail.com> wrote:
> - I've tracked down the source of my trouble; CCallManager class.
> - when the function 'OnIncomingCall(int sessionId, string number,
> string info)' is invoked, the state machine is null so the function
> returns.
> - what could cause this?
> Regards,
> izmoto.
> On Apr 2, 7:36 pm, Georges <Georges.Labre...@gmail.com> wrote:
> > OK, I persevered on this and got it to work.
> > I had built my own pjsipDll.dll library by downloading the pjsip
> > source (pjproject-1.1) and wrapping it with the pjsipDll library
> > source from the SVN trunk repository.
> > It turns out that using my own built pjsipDll.dll library was the
> > issue. I removed it and replaced it by the pre-built one (available athttp://code.google.com/p/sipeksdk/) and everything worked fine.
> > So, I either didn't properly build the pjsip and/or pjsipDll source or
> > there was a problem in the soruce code of the pjsipDll trunk at the
> > time of my checkout (which is why projects should have stable tagged
> > releases available for checkouts instead of just the trunk)
> > Anyhow, I hope this helps, for the record at least!
> > Cheers,
> > - Georges
> > On Apr 1, 7:01 pm, Georges <Georges.Labre...@gmail.com> wrote:
> > > Hello,
> > > Receiving notification for incoming calls seems to be a frequent issue
> > > and I am surprised that we have yet to obtain a clear, concise and
> > > well defined solution, at least as a simple tutorial.
> > > I myself am having troubles with having an incoming call callback
> > > method being called.
> > > Having read the available documentation and studied and reversed
> > > engineered all available source code I am well aware of what I should
> > > do but cannot, for some reason, make it work.
> > > I have tried two approaches and failed at both:
> > > 1) Using CCallManager (my favoured approach):
> > > This third approach does not function for me either.
> > > What could be the issue? What am I missing? Any suggestions?
> > > Thanks and regards,
> > > - Georges
> > > On Mar 31, 4:36 am, izmoto <paul.mun...@gmail.com> wrote:
> > > > Hi,
> > > > - i'm using sipeksdk_mobile.dll. BTW, i can't seem to be able to
> > > > retrieve the latest source; one that supports e.g
> > > > "pjsipStackProxy.Instance.ConfigMore.logLevel = 5;"
> > > > - i can make an outgoing call but can't get notified of incoming
> > > > calls; i suppose i have the wrong version of the mobile sdk but each
> > > > time i get the latest from the svn repo, the results are the same.
> > > > - just where are the latest sources?
getCall checks whether the call table (Dictionary<int, IStateMachine>)
contains the statemachine with the incoming session id; it doesn't
find it so it returns a NullStateMachine.
On Apr 3, 2:57 pm, izmoto <paul.mun...@gmail.com> wrote:
> I've referenced the sipeksdk_mobile project directly and the problem
> indicated to you earlier seems to be emanating form the function below
> in the callmanager class;
> - the state machine 'call' is always null [DisableStateNotifications
> property is true] so the function returns and the event is never
> raised. What could be the cause of this? (state machine is null).
> Regards,
> On Apr 3, 2:49 pm, izmoto <paul.mun...@gmail.com> wrote:
> > Hello Georges,
> > - I've tracked down the source of my trouble; CCallManager class.
> > - when the function 'OnIncomingCall(int sessionId, string number,
> > string info)' is invoked, the state machine is null so the function
> > returns.
> > - what could cause this?
> > Regards,
> > izmoto.
> > On Apr 2, 7:36 pm, Georges <Georges.Labre...@gmail.com> wrote:
> > > OK, I persevered on this and got it to work.
> > > I had built my own pjsipDll.dll library by downloading the pjsip
> > > source (pjproject-1.1) and wrapping it with the pjsipDll library
> > > source from the SVN trunk repository.
> > > It turns out that using my own built pjsipDll.dll library was the
> > > issue. I removed it and replaced it by the pre-built one (available athttp://code.google.com/p/sipeksdk/) and everything worked fine.
> > > So, I either didn't properly build the pjsip and/or pjsipDll source or
> > > there was a problem in the soruce code of the pjsipDll trunk at the
> > > time of my checkout (which is why projects should have stable tagged
> > > releases available for checkouts instead of just the trunk)
> > > Anyhow, I hope this helps, for the record at least!
> > > Cheers,
> > > - Georges
> > > On Apr 1, 7:01 pm, Georges <Georges.Labre...@gmail.com> wrote:
> > > > Hello,
> > > > Receiving notification for incoming calls seems to be a frequent issue
> > > > and I am surprised that we have yet to obtain a clear, concise and
> > > > well defined solution, at least as a simple tutorial.
> > > > I myself am having troubles with having an incoming call callback
> > > > method being called.
> > > > Having read the available documentation and studied and reversed
> > > > engineered all available source code I am well aware of what I should
> > > > do but cannot, for some reason, make it work.
> > > > I have tried two approaches and failed at both:
> > > > 1) Using CCallManager (my favoured approach):
> > > > This third approach does not function for me either.
> > > > What could be the issue? What am I missing? Any suggestions?
> > > > Thanks and regards,
> > > > - Georges
> > > > On Mar 31, 4:36 am, izmoto <paul.mun...@gmail.com> wrote:
> > > > > Hi,
> > > > > - i'm using sipeksdk_mobile.dll. BTW, i can't seem to be able to
> > > > > retrieve the latest source; one that supports e.g
> > > > > "pjsipStackProxy.Instance.ConfigMore.logLevel = 5;"
> > > > > - i can make an outgoing call but can't get notified of incoming
> > > > > calls; i suppose i have the wrong version of the mobile sdk but each
> > > > > time i get the latest from the svn repo, the results are the same.
> > > > > - just where are the latest sources?
I absolutely have the same problem as Georges, no call at all on
callback IncomingCallNotification. I used the CCallManager way by
declaring callback as above :
CallManager.IncomingCallNotification += new
DIncomingCallNotification(CallManager_IncomingCallNotification);
I add corresponding method and I wanted it to answer automaticaly
(last command)
I'm developping on Linux (Ubuntu) Monodevelop and I launch program in
command lines. In this situation, I can see every SIP message
transmitted and I see INVITE message incoming, but no reaction of my
side (normal, callback is neved called :-) )
- My diagnosis for the [see thread title] problem in
(sipeksdk_mobile.dll) is as follows:
- the reason seems to be that the onCallStateChanged(int callId,
ESessionState callState) event is not being raised but the
onCallIncoming(int callId, string sturi) event is being raised; NB the
callbacks are in file pjsipCallWrapper.cs.
- for an incoming call, onCallStateChanged(...) event needs to be
raised first so as to set the state machine for the incoming call in
the call manager's table (a dictionary); then the onCallIncoming(...)
event is raised which then tries to retrieve the state machine for the
incoming call from the call manager's table; if it finds the state
machine it goes on to raise the incoming call notification event and
therefore updates the GUI, however, if it does not find the state
machine for the incoming call (as is the case now where it is
returning a NullStateMachine) then incoming call notification event is
never raised.
- i do not know for what reason pjsipdll_mobile.dll does not seem to
work yet pjsipdll.dll works very well.
- Mr. Sasa could you please help us all in this one.
Thank you for your reply,
izmoto.
On Apr 3, 6:12 pm, Gitch <ritchou...@gmail.com> wrote:
> I absolutely have the same problem as Georges, no call at all on
> callback IncomingCallNotification. I used the CCallManager way by
> declaring callback as above :
> CallManager.IncomingCallNotification += new
> DIncomingCallNotification(CallManager_IncomingCallNotification);
> I add corresponding method and I wanted it to answer automaticaly
> (last command)
> I'm developping on Linux (Ubuntu) Monodevelop and I launch program in
> command lines. In this situation, I can see every SIP message
> transmitted and I see INVITE message incoming, but no reaction of my
> side (normal, callback is neved called :-) )
> - My diagnosis for the [see thread title] problem in
> (sipeksdk_mobile.dll) is as follows:
> - the reason seems to be that the onCallStateChanged(int callId,
> ESessionState callState) event is not being raised but the
> onCallIncoming(int callId, string sturi) event is being raised; NB the
> callbacks are in file pjsipCallWrapper.cs.
> - for an incoming call, onCallStateChanged(...) event needs to be
> raised first so as to set the state machine for the incoming call in
> the call manager's table (a dictionary); then the onCallIncoming(...)
> event is raised which then tries to retrieve the state machine for the
> incoming call from the call manager's table; if it finds the state
> machine it goes on to raise the incoming call notification event and
> therefore updates the GUI, however, if it does not find the state
> machine for the incoming call (as is the case now where it is
> returning a NullStateMachine) then incoming call notification event is
> never raised.
> - i do not know for what reason pjsipdll_mobile.dll does not seem to
> work yet pjsipdll.dll works very well.
> - Mr. Sasa could you please help us all in this one.
> Thank you for your reply,
> izmoto.
> On Apr 3, 6:12 pm, Gitch <ritchou...@gmail.com> wrote:
> > Hi Everybody!,
> > I absolutely have the same problem as Georges, no call at all on
> > callback IncomingCallNotification. I used the CCallManager way by
> > declaring callback as above :
> > CallManager.IncomingCallNotification += new
> > DIncomingCallNotification(CallManager_IncomingCallNotification);
> > I add corresponding method and I wanted it to answer automaticaly
> > (last command)
> > I'm developping on Linux (Ubuntu) Monodevelop and I launch program in
> > command lines. In this situation, I can see every SIP message
> > transmitted and I see INVITE message incoming, but no reaction of my
> > side (normal, callback is neved called :-) )
I'm really sorry I couldn't get to you sooner. Now it seems you've solved
the mysteries. There's quite a lot of information in the previous posts and
now I'm a bit confused. In order to finaly close this issue I need some
answers (confirmations):
- Do you use sources or prebuilt libraries (sipeksdk_mobile.dll and
pjsip_mobile.dll)?
- Where do you take them from?
- Is the incoming notification problem in the mobile version only?
- What about the wrong order of notifications. Is this reproducible
(always)? Btw. it never happens to me, otherwise I...
- Are there any other known problems I should fix?
On Fri, Apr 3, 2009 at 5:36 PM, izmoto <paul.mun...@gmail.com> wrote:
> Hi,
> - My diagnosis for the [see thread title] problem in
> (sipeksdk_mobile.dll) is as follows:
> - the reason seems to be that the onCallStateChanged(int callId,
> ESessionState callState) event is not being raised but the
> onCallIncoming(int callId, string sturi) event is being raised; NB the
> callbacks are in file pjsipCallWrapper.cs.
> - for an incoming call, onCallStateChanged(...) event needs to be
> raised first so as to set the state machine for the incoming call in
> the call manager's table (a dictionary); then the onCallIncoming(...)
> event is raised which then tries to retrieve the state machine for the
> incoming call from the call manager's table; if it finds the state
> machine it goes on to raise the incoming call notification event and
> therefore updates the GUI, however, if it does not find the state
> machine for the incoming call (as is the case now where it is
> returning a NullStateMachine) then incoming call notification event is
> never raised.
> - i do not know for what reason pjsipdll_mobile.dll does not seem to
> work yet pjsipdll.dll works very well.
> - Mr. Sasa could you please help us all in this one.
> Thank you for your reply,
> izmoto.
> On Apr 3, 6:12 pm, Gitch <ritchou...@gmail.com> wrote:
> > Hi Everybody!,
> > I absolutely have the same problem as Georges, no call at all on
> > callback IncomingCallNotification. I used the CCallManager way by
> > declaring callback as above :
> > CallManager.IncomingCallNotification += new
> > DIncomingCallNotification(CallManager_IncomingCallNotification);
> > I add corresponding method and I wanted it to answer automaticaly
> > (last command)
> > I'm developping on Linux (Ubuntu) Monodevelop and I launch program in
> > command lines. In this situation, I can see every SIP message
> > transmitted and I see INVITE message incoming, but no reaction of my
> > side (normal, callback is neved called :-) )
I had the occasion to test 2 scenarios. First is the InstantSoftPhone
example published on SipekSDK website, with pre-build libraries. I had
the Incomingcall code, callback and everything needed. Compiled on
Visual Studio and executed on Windows Environnement, everything works
fine. The application automaticaly answers, exactly what I want for
begining.
Second scenario, based on libraries compiled by myself (libpjsipDll.so
and SipekSDK.dll). On these libraries, audio was disabled (--disable-
sound) because I'm working on Virtual Machine. The same code was
executed and no IncomingCallNotification event was raised. I still do
not know why. Could it be linked with the disable-sound option ? Could
the source code be "wrong" ?
I'm very happy you found some time to reply to this post.
Now, I will submit some clarifications to you based on my own
experience using the sipek SDKs both windows-desktop and windows-
mobile versions:-
- Do you use sources or prebuilt libraries (sipeksdk_mobile.dll and
pjsip_mobile.dll)?
I use the sources for both sipeksdk_mobile.dll and
pjsipdll_mobile.dll.
- Is the incoming notification problem in the mobile version only?
Yes, the problem is in the mobile version only.
- What about the wrong order of notifications. Is this reproducible
(always)? Btw. it never happens to me, otherwise I...
Yes this is reproducible; i stepped through the source code for
sipeksdk (windows-desktop and windows-mobile versions) ,that is how i
managed to come up with the diagnosis i posted earlier. Here's a
summary: see file pjsipCallWrapper.cs 'Callbacks' region; for an
incoming call, onCallStateChanged(...) needs to be invoked so it can
set up the state machine for the incoming call in CallManager's table,
subsequently onCallIncoming(...) needs to be raised to retrieve the
state machine of the incoming call from CallManager's table, create a
session for the incoming call and notify the GUI. This sequence works
perfectly for the desktop version of the sdk but does not work for the
mobile version of the sdk [ onCallStateChanged(...) is never raised so
the state machine for the incoming call is never set up and when
onCallIncoming(...) is raised and tries to retrieve the state machine
for the incoming call, it never finds it and returns a
NullStateMachine so the GUI is never notified ]. To fix this, i
manually raise onCallStateChanged(...) when i get an incoming call and
all works as expected.
- Are there any other known problems I should fix?
I do not know of any other problems as of this writing; i should be
able to let you know as i continue consuming the gr8 SDKs!
I hope I have submitted my clarifications in a useful way; hopefully
you could get a permanent solution for this problem.
On 6 avr, 11:20, izmoto <paul.mun...@gmail.com> wrote:
> ...
> izmoto.
Hi!
Just a question, I'm not sure. When you say "onCallStateChanged(...)
needs to be invoked so it can
set up the state machine for the incoming call in CallManager's
table ...", does it mean it's not implemented and it has to be ? Does
this mean code lines are missing ?
When you say "only in mobile version", I'm not agree. I compiled
myself libraries (libpjsipDll.so and SipekDll.dll) in Linux
environnement and no IncomingCallNotification event either. Could it
be the fact I'm using pjsipproject version 1.0.2 ? Could it be the
fact I disabled sound (--disable sound) in compilation ?
I've made a test. I've put some messages in code to see exactly what
code was triggered on an effective incoming call. I've put messages on
there following methods :
We see clearly both methods are called. We arrive to the wrapper, we
arrive to SipekSDK code but, and probably like izmoto said, nothing
happens to the application and CallManager_IncomingCallNotification is
neved called.
I tried this just to check if it wasn't a problem on pjsip code, or
version. Sasa, you, the God creator :-), is that normal that the
application callback is neved called ?
the CallManager (see file callManager.cs) has a dictionary
(Dictionary<int, IStateMachine> _calls) that maintains state machines;
if you review the function below located in file callManager.cs....
- you can see that a call is made to function getCall(...) to retrieve
the state machine for the incoming call; if you follow through that
function you will see that it returns a NullStateMachine IIF it does
not find the state machine identified by the sessionId. so by the time
the above function is called it is expected that the state machine for
the incoming call will be already available in the _calls dictionary.
For this to happen, the OnCallStateChanged(...) event in file
pjsipCallWrapper.cs needs to have been raised prior to raising the
onCallIncoming(...) event so that the state machine for the incoming
call can be 'manufactured'. this is where the problem is;
OnCallStateChanged(...) is not called so state machine is not
manufactured and when onCallIncoming(...) is called which in turn
calls the above pasted function, a call to getCall(...) returns a
NullStateMachine and the function breaks so the event is never raised
to the GUI.
The [temporary] solution now [sipeksdk_mobile.dll] is to manually
raise OnCallStateChanged(...) for incoming calls like shown below (see
comment named invoke callback) in file pjsipCallWrapper.cs :-
private static int onCallIncoming(int callId, string sturi)
{
string uri = sturi;
string display = "";
string number = "";
if (null != uri)
{
// get indices
int startNum = uri.IndexOf("<sip:");
int atPos = uri.IndexOf('@');
// search for number
if ((startNum >= 0) && (atPos > startNum))
{
number = uri.Substring(startNum + 5, atPos -
startNum - 5);
}
// extract display name if exists
if (startNum >= 0)
{
display = uri.Remove(startNum, uri.Length -
startNum).Trim();
}
else
{
int semiPos = display.IndexOf(';');
if (semiPos >= 0)
{
display = display.Remove(semiPos,
display.Length - semiPos);
}
else
{
int colPos = display.IndexOf(':');
if (colPos >= 0)
{
display = display.Remove(colPos,
display.Length - colPos);
}
}
}
}
// invoke callback
ICallProxyInterface.BaseCallStateChanged(callId,
ESessionState.SESSION_STATE_INCOMING, ""); // This is a hack, izmoto!
ICallProxyInterface.BaseIncomingCall(callId, number,
display);
return 1;
}
- at least, this works for me now but it is a hack; i hope we could
find a permanent solution.
- i hope you will find the information clear.
cheers,
izmoto.
On Apr 6, 4:52 pm, Gitch <ritchou...@gmail.com> wrote:
> I've made a test. I've put some messages in code to see exactly what
> code was triggered on an effective incoming call. I've put messages on
> there following methods :
> We see clearly both methods are called. We arrive to the wrapper, we
> arrive to SipekSDK code but, and probably like izmoto said, nothing
> happens to the application and CallManager_IncomingCallNotification is
> neved called.
> I tried this just to check if it wasn't a problem on pjsip code, or
> version. Sasa, you, the God creator :-), is that normal that the
> application callback is neved called ?
Thank you for your message. It's really clear for me now :-) The only
thing I wanted to know was if it was a code problem (apparently it
definitely is). I will try your solution tomorrow and I'll keep you in
touch. I hope Sasa's already on the solution :-)
Greatest,
Gitch
On Apr 6, 4:19 pm, izmoto <paul.mun...@gmail.com> wrote:
> the CallManager (see file callManager.cs) has a dictionary
> (Dictionary<int, IStateMachine> _calls) that maintains state machines;
> if you review the function below located in file callManager.cs....
> - you can see that a call is made to function getCall(...) to retrieve
> the state machine for the incoming call; if you follow through that
> function you will see that it returns a NullStateMachine IIF it does
> not find the state machine identified by the sessionId. so by the time
> the above function is called it is expected that the state machine for
> the incoming call will be already available in the _calls dictionary.
> For this to happen, the OnCallStateChanged(...) event in file
> pjsipCallWrapper.cs needs to have been raised prior to raising the
> onCallIncoming(...) event so that the state machine for the incoming
> call can be 'manufactured'. this is where the problem is;
> OnCallStateChanged(...) is not called so state machine is not
> manufactured and when onCallIncoming(...) is called which in turn
> calls the above pasted function, a call to getCall(...) returns a
> NullStateMachine and the function breaks so the event is never raised
> to the GUI.
> The [temporary] solution now [sipeksdk_mobile.dll] is to manually
> raise OnCallStateChanged(...) for incoming calls like shown below (see
> comment named invoke callback) in file pjsipCallWrapper.cs :-
> private static int onCallIncoming(int callId, string sturi)
> {
> string uri = sturi;
> string display = "";
> string number = "";
> if (null != uri)
> {
> // get indices
> int startNum = uri.IndexOf("<sip:");
> int atPos = uri.IndexOf('@');
> // search for number
> if ((startNum >= 0) && (atPos > startNum))
> {
> number = uri.Substring(startNum + 5, atPos -
> startNum - 5);
> }
> // invoke callback
> ICallProxyInterface.BaseCallStateChanged(callId,
> ESessionState.SESSION_STATE_INCOMING, ""); // This is a hack, izmoto!
> ICallProxyInterface.BaseIncomingCall(callId, number,
> display);
> return 1;
> }
> - at least, this works for me now but it is a hack; i hope we could
> find a permanent solution.
> - i hope you will find the information clear.
> cheers,
> izmoto.
> On Apr 6, 4:52 pm, Gitch <ritchou...@gmail.com> wrote:
> > I've made a test. I've put some messages in code to see exactly what
> > code was triggered on an effective incoming call. I've put messages on
> > there following methods :
> > We see clearly both methods are called. We arrive to the wrapper, we
> > arrive to SipekSDK code but, and probably like izmoto said, nothing
> > happens to the application and CallManager_IncomingCallNotification is
> > neved called.
> > I tried this just to check if it wasn't a problem on pjsip code, or
> > version. Sasa, you, the God creator :-), is that normal that the
> > application callback is neved called ?
- Do you use sources or prebuilt libraries (sipeksdk_mobile.dll and
pjsip_mobile.dll)?
I had the "incoming callback method not being called" issue when
compiling the source of pjsipDll myself.
The problem is eliminated when I used the prebuilt
pjsipDll.dll_v0.3.108 library available here: http://code.google.com/p/sipeksdk/
Like I said, either there is an issue in my building process or in the
source currently available in the trunk.
Thanks and regards,
- Georges
On Apr 3, 6:29 pm, Sasa Coh <sasa...@gmail.com> wrote:
> I'm really sorry I couldn't get to you sooner. Now it seems you've solved
> the mysteries. There's quite a lot of information in the previous posts and
> now I'm a bit confused. In order to finaly close this issue I need some
> answers (confirmations):
> - Do you use sources or prebuilt libraries (sipeksdk_mobile.dll and
> pjsip_mobile.dll)?
> - Where do you take them from?
> - Is the incoming notification problem in the mobile version only?
> - What about the wrong order of notifications. Is this reproducible
> (always)? Btw. it never happens to me, otherwise I...
> - Are there any other known problems I should fix?
> Thanks for report (and explanations)!
> Kind regards,
> sasa
> On Fri, Apr 3, 2009 at 5:36 PM, izmoto <paul.mun...@gmail.com> wrote:
> > Hi,
> > - My diagnosis for the [see thread title] problem in
> > (sipeksdk_mobile.dll) is as follows:
> > - the reason seems to be that the onCallStateChanged(int callId,
> > ESessionState callState) event is not being raised but the
> > onCallIncoming(int callId, string sturi) event is being raised; NB the
> > callbacks are in file pjsipCallWrapper.cs.
> > - for an incoming call, onCallStateChanged(...) event needs to be
> > raised first so as to set the state machine for the incoming call in
> > the call manager's table (a dictionary); then the onCallIncoming(...)
> > event is raised which then tries to retrieve the state machine for the
> > incoming call from the call manager's table; if it finds the state
> > machine it goes on to raise the incoming call notification event and
> > therefore updates the GUI, however, if it does not find the state
> > machine for the incoming call (as is the case now where it is
> > returning a NullStateMachine) then incoming call notification event is
> > never raised.
> > - i do not know for what reason pjsipdll_mobile.dll does not seem to
> > work yet pjsipdll.dll works very well.
> > - Mr. Sasa could you please help us all in this one.
> > Thank you for your reply,
> > izmoto.
> > On Apr 3, 6:12 pm, Gitch <ritchou...@gmail.com> wrote:
> > > Hi Everybody!,
> > > I absolutely have the same problem as Georges, no call at all on
> > > callback IncomingCallNotification. I used the CCallManager way by
> > > declaring callback as above :
> > > CallManager.IncomingCallNotification += new
> > > DIncomingCallNotification(CallManager_IncomingCallNotification);
> > > I add corresponding method and I wanted it to answer automaticaly
> > > (last command)
> > > I'm developping on Linux (Ubuntu) Monodevelop and I launch program in
> > > command lines. In this situation, I can see every SIP message
> > > transmitted and I see INVITE message incoming, but no reaction of my
> > > side (normal, callback is neved called :-) )
I had the occasion to test izmoto's solution and it does work.
IncomingCallNotification is now trigged in my application and call can
be started.
We agree it's probably not the nicest way to do it, but it does work
and really really thanks to you izmoto.
I'd really like an answer from Sasa about source code problem. Did we
something wrong or is there really a difference between source code
and pre-build library like Georges said and like I begin to believe ?
> I had the occasion to test izmoto's solution and it does work.
> IncomingCallNotification is now trigged in my application and call can
> be started.
> We agree it's probably not the nicest way to do it, but it does work
> and really really thanks to you izmoto.
> I'd really like an answer from Sasa about source code problem. Did we
> something wrong or is there really a difference between source code
> and pre-build library like Georges said and like I begin to believe ?
thanks a lot to clarify this. I'll take a look and get back to you ASAP. I
hope I can test it on a simulator since I don't have a windows mobile device
right now.
On Mon, Apr 6, 2009 at 4:42 PM, Gitch <ritchou...@gmail.com> wrote:
> Hi !
> Thank you for your message. It's really clear for me now :-) The only
> thing I wanted to know was if it was a code problem (apparently it
> definitely is). I will try your solution tomorrow and I'll keep you in
> touch. I hope Sasa's already on the solution :-)
> Greatest,
> Gitch
> On Apr 6, 4:19 pm, izmoto <paul.mun...@gmail.com> wrote:
> > Hi Gitch,
> > the CallManager (see file callManager.cs) has a dictionary
> > (Dictionary<int, IStateMachine> _calls) that maintains state machines;
> > if you review the function below located in file callManager.cs....
> > - you can see that a call is made to function getCall(...) to retrieve
> > the state machine for the incoming call; if you follow through that
> > function you will see that it returns a NullStateMachine IIF it does
> > not find the state machine identified by the sessionId. so by the time
> > the above function is called it is expected that the state machine for
> > the incoming call will be already available in the _calls dictionary.
> > For this to happen, the OnCallStateChanged(...) event in file
> > pjsipCallWrapper.cs needs to have been raised prior to raising the
> > onCallIncoming(...) event so that the state machine for the incoming
> > call can be 'manufactured'. this is where the problem is;
> > OnCallStateChanged(...) is not called so state machine is not
> > manufactured and when onCallIncoming(...) is called which in turn
> > calls the above pasted function, a call to getCall(...) returns a
> > NullStateMachine and the function breaks so the event is never raised
> > to the GUI.
> > The [temporary] solution now [sipeksdk_mobile.dll] is to manually
> > raise OnCallStateChanged(...) for incoming calls like shown below (see
> > comment named invoke callback) in file pjsipCallWrapper.cs :-
> > private static int onCallIncoming(int callId, string sturi)
> > {
> > string uri = sturi;
> > string display = "";
> > string number = "";
> > if (null != uri)
> > {
> > // get indices
> > int startNum = uri.IndexOf("<sip:");
> > int atPos = uri.IndexOf('@');
> > // search for number
> > if ((startNum >= 0) && (atPos > startNum))
> > {
> > number = uri.Substring(startNum + 5, atPos -
> > startNum - 5);
> > }
> > - at least, this works for me now but it is a hack; i hope we could
> > find a permanent solution.
> > - i hope you will find the information clear.
> > cheers,
> > izmoto.
> > On Apr 6, 4:52 pm, Gitch <ritchou...@gmail.com> wrote:
> > > I've made a test. I've put some messages in code to see exactly what
> > > code was triggered on an effective incoming call. I've put messages on
> > > there following methods :
> > > We see clearly both methods are called. We arrive to the wrapper, we
> > > arrive to SipekSDK code but, and probably like izmoto said, nothing
> > > happens to the application and CallManager_IncomingCallNotification is
> > > neved called.
> > > I tried this just to check if it wasn't a problem on pjsip code, or
> > > version. Sasa, you, the God creator :-), is that normal that the
> > > application callback is neved called ?
> thanks a lot to clarify this. I'll take a look and get back to you ASAP. I
> hope I can test it on a simulator since I don't have a windows mobile device
> right now.
> Kind regards,
> sasa
> On Mon, Apr 6, 2009 at 4:42 PM, Gitch <ritchou...@gmail.com> wrote:
> > Hi !
> > Thank you for your message. It's really clear for me now :-) The only
> > thing I wanted to know was if it was a code problem (apparently it
> > definitely is). I will try your solution tomorrow and I'll keep you in
> > touch. I hope Sasa's already on the solution :-)
> > Greatest,
> > Gitch
> > On Apr 6, 4:19 pm, izmoto <paul.mun...@gmail.com> wrote:
> > > Hi Gitch,
> > > the CallManager (see file callManager.cs) has a dictionary
> > > (Dictionary<int, IStateMachine> _calls) that maintains state machines;
> > > if you review the function below located in file callManager.cs....
> > > - you can see that a call is made to function getCall(...) to retrieve
> > > the state machine for the incoming call; if you follow through that
> > > function you will see that it returns a NullStateMachine IIF it does
> > > not find the state machine identified by the sessionId. so by the time
> > > the above function is called it is expected that the state machine for
> > > the incoming call will be already available in the _calls dictionary.
> > > For this to happen, the OnCallStateChanged(...) event in file
> > > pjsipCallWrapper.cs needs to have been raised prior to raising the
> > > onCallIncoming(...) event so that the state machine for the incoming
> > > call can be 'manufactured'. this is where the problem is;
> > > OnCallStateChanged(...) is not called so state machine is not
> > > manufactured and when onCallIncoming(...) is called which in turn
> > > calls the above pasted function, a call to getCall(...) returns a
> > > NullStateMachine and the function breaks so the event is never raised
> > > to the GUI.
> > > The [temporary] solution now [sipeksdk_mobile.dll] is to manually
> > > raise OnCallStateChanged(...) for incoming calls like shown below (see
> > > comment named invoke callback) in file pjsipCallWrapper.cs :-
> > > > I've made a test. I've put some messages in code to see exactly what
> > > > code was triggered on an effective incoming call. I've put messages on
> > > > there following methods :
One more question: Did you test it on the windows mobile emulator or on the
"real" device?
FYI: I've reproduced the problem on the windows mobile emulator easily. And
that's expected since the emulator has many problems with itself (especially
network). Now I'm looking for someone to lend me the real windows mobile
device for testing (could take some time).
On Wed, Apr 8, 2009 at 6:27 PM, Sasa Coh <sasa...@gmail.com> wrote:
> Hello guys,
> thanks a lot to clarify this. I'll take a look and get back to you ASAP. I
> hope I can test it on a simulator since I don't have a windows mobile device
> right now.
> Kind regards,
> sasa
> On Mon, Apr 6, 2009 at 4:42 PM, Gitch <ritchou...@gmail.com> wrote:
>> Hi !
>> Thank you for your message. It's really clear for me now :-) The only
>> thing I wanted to know was if it was a code problem (apparently it
>> definitely is). I will try your solution tomorrow and I'll keep you in
>> touch. I hope Sasa's already on the solution :-)
>> Greatest,
>> Gitch
>> On Apr 6, 4:19 pm, izmoto <paul.mun...@gmail.com> wrote:
>> > Hi Gitch,
>> > the CallManager (see file callManager.cs) has a dictionary
>> > (Dictionary<int, IStateMachine> _calls) that maintains state machines;
>> > if you review the function below located in file callManager.cs....
>> > - you can see that a call is made to function getCall(...) to retrieve
>> > the state machine for the incoming call; if you follow through that
>> > function you will see that it returns a NullStateMachine IIF it does
>> > not find the state machine identified by the sessionId. so by the time
>> > the above function is called it is expected that the state machine for
>> > the incoming call will be already available in the _calls dictionary.
>> > For this to happen, the OnCallStateChanged(...) event in file
>> > pjsipCallWrapper.cs needs to have been raised prior to raising the
>> > onCallIncoming(...) event so that the state machine for the incoming
>> > call can be 'manufactured'. this is where the problem is;
>> > OnCallStateChanged(...) is not called so state machine is not
>> > manufactured and when onCallIncoming(...) is called which in turn
>> > calls the above pasted function, a call to getCall(...) returns a
>> > NullStateMachine and the function breaks so the event is never raised
>> > to the GUI.
>> > The [temporary] solution now [sipeksdk_mobile.dll] is to manually
>> > raise OnCallStateChanged(...) for incoming calls like shown below (see
>> > comment named invoke callback) in file pjsipCallWrapper.cs :-
>> > private static int onCallIncoming(int callId, string sturi)
>> > {
>> > string uri = sturi;
>> > string display = "";
>> > string number = "";
>> > if (null != uri)
>> > {
>> > // get indices
>> > int startNum = uri.IndexOf("<sip:");
>> > int atPos = uri.IndexOf('@');
>> > // search for number
>> > if ((startNum >= 0) && (atPos > startNum))
>> > {
>> > number = uri.Substring(startNum + 5, atPos -
>> > startNum - 5);
>> > }
>> > - at least, this works for me now but it is a hack; i hope we could
>> > find a permanent solution.
>> > - i hope you will find the information clear.
>> > cheers,
>> > izmoto.
>> > On Apr 6, 4:52 pm, Gitch <ritchou...@gmail.com> wrote:
>> > > I've made a test. I've put some messages in code to see exactly what
>> > > code was triggered on an effective incoming call. I've put messages on
>> > > there following methods :
>> > > We see clearly both methods are called. We arrive to the wrapper, we
>> > > arrive to SipekSDK code but, and probably like izmoto said, nothing
>> > > happens to the application and CallManager_IncomingCallNotification is
>> > > neved called.
> One more question: Did you test it on the windows mobile emulator or on the
> "real" device?
> FYI: I've reproduced the problem on the windows mobile emulator easily. And
> that's expected since the emulator has many problems with itself (especially
> network). Now I'm looking for someone to lend me the real windows mobile
> device for testing (could take some time).
> kind regards,
> sasa
> On Wed, Apr 8, 2009 at 6:27 PM, Sasa Coh <sasa...@gmail.com> wrote:
> > Hello guys,
> > thanks a lot to clarify this. I'll take a look and get back to you ASAP. I
> > hope I can test it on a simulator since I don't have a windows mobile device
> > right now.
> > Kind regards,
> > sasa
> > On Mon, Apr 6, 2009 at 4:42 PM, Gitch <ritchou...@gmail.com> wrote:
> >> Hi !
> >> Thank you for your message. It's really clear for me now :-) The only
> >> thing I wanted to know was if it was a code problem (apparently it
> >> definitely is). I will try your solution tomorrow and I'll keep you in
> >> touch. I hope Sasa's already on the solution :-)
> >> Greatest,
> >> Gitch
> >> On Apr 6, 4:19 pm, izmoto <paul.mun...@gmail.com> wrote:
> >> > Hi Gitch,
> >> > the CallManager (see file callManager.cs) has a dictionary
> >> > (Dictionary<int, IStateMachine> _calls) that maintains state machines;
> >> > if you review the function below located in file callManager.cs....
> >> > - you can see that a call is made to function getCall(...) to retrieve
> >> > the state machine for the incoming call; if you follow through that
> >> > function you will see that it returns a NullStateMachine IIF it does
> >> > not find the state machine identified by the sessionId. so by the time
> >> > the above function is called it is expected that the state machine for
> >> > the incoming call will be already available in the _calls dictionary.
> >> > For this to happen, the OnCallStateChanged(...) event in file
> >> > pjsipCallWrapper.cs needs to have been raised prior to raising the
> >> > onCallIncoming(...) event so that the state machine for the incoming
> >> > call can be 'manufactured'. this is where the problem is;
> >> > OnCallStateChanged(...) is not called so state machine is not
> >> > manufactured and when onCallIncoming(...) is called which in turn
> >> > calls the above pasted function, a call to getCall(...) returns a
> >> > NullStateMachine and the function breaks so the event is never raised
> >> > to the GUI.
> >> > The [temporary] solution now [sipeksdk_mobile.dll] is to manually
> >> > raise OnCallStateChanged(...) for incoming calls like shown below (see
> >> > comment named invoke callback) in file pjsipCallWrapper.cs :-
> >> > > I've made a test. I've put some messages in code to see exactly what
> >> > > code was triggered on an effective incoming call. I've put messages on
> >> > > there following methods :
> One more question: Did you test it on the windows mobile emulator or on the
> "real" device?
> FYI: I've reproduced the problem on the windows mobile emulator easily. And
> that's expected since the emulator has many problems with itself (especially
> network). Now I'm looking for someone to lend me the real windows mobile
> device for testing (could take some time).
> kind regards,
> sasa
> On Wed, Apr 8, 2009 at 6:27 PM, Sasa Coh <sasa...@gmail.com> wrote:
> > Hello guys,
> > thanks a lot to clarify this. I'll take a look and get back to you ASAP. I
> > hope I can test it on a simulator since I don't have a windows mobile device
> > right now.
> > Kind regards,
> > sasa
> > On Mon, Apr 6, 2009 at 4:42 PM, Gitch <ritchou...@gmail.com> wrote:
> >> Hi !
> >> Thank you for your message. It's really clear for me now :-) The only
> >> thing I wanted to know was if it was a code problem (apparently it
> >> definitely is). I will try your solution tomorrow and I'll keep you in
> >> touch. I hope Sasa's already on the solution :-)
> >> Greatest,
> >> Gitch
> >> On Apr 6, 4:19 pm, izmoto <paul.mun...@gmail.com> wrote:
> >> > Hi Gitch,
> >> > the CallManager (see file callManager.cs) has a dictionary
> >> > (Dictionary<int, IStateMachine> _calls) that maintains state machines;
> >> > if you review the function below located in file callManager.cs....
> >> > - you can see that a call is made to function getCall(...) to retrieve
> >> > the state machine for the incoming call; if you follow through that
> >> > function you will see that it returns a NullStateMachine IIF it does
> >> > not find the state machine identified by the sessionId. so by the time
> >> > the above function is called it is expected that the state machine for
> >> > the incoming call will be already available in the _calls dictionary.
> >> > For this to happen, the OnCallStateChanged(...) event in file
> >> > pjsipCallWrapper.cs needs to have been raised prior to raising the
> >> > onCallIncoming(...) event so that the state machine for the incoming
> >> > call can be 'manufactured'. this is where the problem is;
> >> > OnCallStateChanged(...) is not called so state machine is not
> >> > manufactured and when onCallIncoming(...) is called which in turn
> >> > calls the above pasted function, a call to getCall(...) returns a
> >> > NullStateMachine and the function breaks so the event is never raised
> >> > to the GUI.
> >> > The [temporary] solution now [sipeksdk_mobile.dll] is to manually
> >> > raise OnCallStateChanged(...) for incoming calls like shown below (see
> >> > comment named invoke callback) in file pjsipCallWrapper.cs :-
> >> > > I've made a test. I've put some messages in code to see exactly what
> >> > > code was triggered on an effective incoming call. I've put messages on
> >> > > there following methods :