Author |
|
Cwilson Intermediate
Joined: August 10 2012 Location: United Kingdom Posts: 25
|
Posted: January 03 2013 at 9:59am | IP Logged
|
|
|
MakeCallUri fails with a return status of SipInvalidHandle
when the VOIP Media Engine is run on one of our live
servers.
The same application works fine in test and on a different
live server. The only major difference between the
environments is that the live server we're having problems
with has two IP addresses.
So my question is this. What causes MakeCallUri to return
a SipInvalidHandle under managed code?
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: January 04 2013 at 10:07am | IP Logged
|
|
|
The VoipMediaEngine::MakeCallUri() will return SipInvalidHandle if the media engine is not properly initialized for that specific .NET media engine object.
More Info:
The .NET wrapper for the media engine wraps native media engine code.
When you create an instance of the .Net media enigne by calling the VoipMediaEngine::StartSipTelephony() API procedure, an internal native instance of the media engine gets created. This native media engine instance is maintained by the .NET wrapper code as an internal handle value (it is actually a native memory pointer).
If the .NET VoipMediaEngine::StartSipTelephony() API procedure fails, this internal native handle is not properly set (it will be NULL) and any calls to other API procs such as VoipMediaEngine::MakeCallUri() will return the SipInvalidHandle value.
The first check is to make sure the return values for all calls to VoipMediaEngine::StartSipTelephony() return SipSuccess. In this case, you can verify that the native media engine has been created for your .NET media engine object by taking a look at the VoipMediaEngine::hStateMachineNative value. It will be non zero.
If all your calls to VoipMediaEngine::StartSipTelephony() return SipSuccess, then possibly the media engine is being uninitialized before you call the VoipMediaEngine::MakeCallUri() proc. Is it possible that VoipMediaEngine::StopSipTelephony() is being called prematurely?
RJ
|
Back to Top |
|
|
Cwilson Intermediate
Joined: August 10 2012 Location: United Kingdom Posts: 25
|
Posted: January 08 2013 at 10:46am | IP Logged
|
|
|
Upon further investigation this problem turned out to be
due to incorrectly handling a
SipMediaEngineAlreadyInitialized return value.
After the object in charge of the SIP trunk initialises
the Media Engine for the first SIP trunk, the application
then creates another instance of the object and tries to
create a new Media Engine object. Then it tries to
initialise it in the same way causing the
SipMediaEngineAlreadyInitialized value to be returned.
This was resolved by treating
SipMediaEngineAlreadyInitialized as a SipSuccess return
value. (If the Media Engine instance is already
initialised, then we've done it once already and don't
need to do it again.)
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: January 08 2013 at 11:39am | IP Logged
|
|
|
Excellent...
|
Back to Top |
|
|