Author |
|
nasmork Intermediate
Joined: February 13 2007 Location: Canada Posts: 12
|
Posted: February 13 2007 at 10:34am | IP Logged
|
|
|
Hi, we're evaluating Voip Engine to make outbound calls to PSTN via SIP proxy server. Currently we're testing it with voipstunt.com.
The issue we having is that MakeCall function crashes with no visible explanation.
Unhandled exception at 0x005cce5d in TEST.EXE: 0xC0000005: Access violation reading location 0x00000013.
Environment: VS2005
Could you please help identifying the problem?
Here's the sequence of function calls:
Code:
TELEPHONY_RETURN_VALUE ret;
SIPHANDLE m_hEngine;
InitializeMediaEngine(0);
m_SIP_Params.pPersonalityMicrocode = LanScapeVME_F186495C_7AFF_4742_ADB7_87EA48A42633;
m_SIP_Params.LineMode = SWITCH_LINE;
m_SIP_Params.UserNotifyCallbackProc = (SIPCALLBACKPROC)PhoneEventHandler;
m_SIP_Params.pUserDefinedData = this;
m_SIP_Params.IpAddressOfThisHost = "192.168.9.2";
m_SIP_Params.SipPort = 5060;
m_SIP_Params.MaxSipMesageLength = 1500;
m_SIP_Params.pPhoneName = "TeleSoft"; m_SIP_Params.pPhoneDispla yName = "TeleSoft";
m_SIP_Params.CallConferenceEnabled = FALSE;
m_SIP_Params.FarEndCallTransferEnabled = FALSE;
m_SIP_Params.MinLocalRtpPort = 8000;
m_SIP_Params.MaxLocalRtpPort = 8000 + 64 * 2;
m_SIP_Params.ZeroBasedAudioInDeviceId = SIP_AUDIO_DEVICE_NOT_USED;
m_SIP_Params.ZeroBasedAudioOutDeviceId = SIP_AUDIO_DEVICE_NOT_USED;
m_SIP_Params.AudioRecordBandWidth = AUDIO_BW_PCM_22K;
m_SIP_Params.AudioPlaybackBandWidth = AUDIO_BW_PCM_22K;
m_SIP_Params.PlaybackBufferingDefault = 2;
m_SIP_Params.PlaybackBufferingDuringSounds = 2;
m_SIP_Params.PhoneLineTransmitBuffering = 2; m_SIP_Params.LogSipMessages = TRUE;
m_SIP_Params.pSipLogFileName = "c:\\SIPLOG.TXT";
m_SIP_Params.EnableEventLogServer = TRUE;
m_SIP_Params.EventLogServerPort = 514;
m_SIP_Params.pEventLogServer = "127.0.0.1";
m_SIP_Params.EnablePhoneLineRecording = TRUE;
m_SIP_Params.PhoneLineRecordBuffering = 0;
m_SIP_Params.StartupFlags = 0;
m_SIP_Params.MaxSipMesageLength = 0;
m_SIP_Params.MaxMixerLinebuffers = 0;
m_SIP_Params.MaxRtpPacketLength = 0;
m_SIP_Params.NumPhoneLinesRequested = 6;
m_CallAnswerTimeout = 5;
m_EnableOutgoingRingTone = FALSE;
StartSipTelephony (&m_SIP_Params, &m_hEngine);
ret = SetCallAnswerTimeout (m_hEngine, m_CallAnswerTimeout);
ret = EnableOutgoingPhoneRing (m_hEngine, m_EnableOutgoingRingTone);
ret = EnableErrorSignal (m_hEngine, TRUE);
for (CurLine = 0 ; CurLine < LinesNum ; CurLine++){
pLine = new CLine (m_hEngine, this);
pLine->OpenLine (CurLine);
m_Lines.Add (pLine);
}
ret = SipTelephonyEnable (m_hEngine);
ret = SetAudioMediaFormat(m_hEngine, 0, Media_Format_G729);
ret = AddAuthorizationCredentials (m_hEngine, "myusername", "mypwd", "myusername@voipstunt.com" );
ret = EnableSipDomain(m_hEngine, "voipstunt.com");
ret = EnableSipProxyServer(m_hEngine, "sip.voipstunt.com", 5060 );
ret = MakeCall (m_hEngine, "19058841234", "sip.voipstunt.com", 5060,
m_ Li ne s [0]->GetLineId(), TRUE, 1000);
|
|
|
Any help would be appreciated
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: February 13 2007 at 1:23pm | IP Logged
|
|
|
Hi nasmork,
We assume you are using a trial product image. We have just identified an issue in the current trial product image (v5.12.3.13) that may cause an access violation. We are in the process of getting a new trial image ready today. Until then we suggest you wait to do further eval. We will send you an email where you can FTP download the new trial image as soon as we get it ready.
In the meantime, send us a ZIP archive of your VS2005 test project and we will take a look at it.
Support
|
Back to Top |
|
|
nasmork Intermediate
Joined: February 13 2007 Location: Canada Posts: 12
|
Posted: February 13 2007 at 1:45pm | IP Logged
|
|
|
Thanks
This however creates a bit of a problem as we have strict deadlines, and such delay could push it away. Please advice.
Thanks
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: February 14 2007 at 6:46am | IP Logged
|
|
|
Hi nasmork,
We have identified a problematic bug in the recent product trials. See the following post:
http://www.lanscapecorp.com/forum/forum_posts.asp?TID=262&PN =1
We ask that you request a new product trial for download today. As soon as we receive your new product trial request we will processit.
You should then build your test app using this new trial image and see if you get the access violation. If you get the same behavior, ZIP your test app image and email it to:
support ‘at’ lanscape corp.com
We will look at it and locate the problem as soon as we get your code. We know how it is to be pressed for time and we will help you with your evaluation as much as possible.
Repost as needed,
Support
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: February 14 2007 at 12:56pm | IP Logged
|
|
|
Hi Nasmork,
We took a look at your code fragment and fixed a few things. Take a look at the comments in the code below:
Code:
InitializeMediaEngine(0);
// important: zero out the structure first!!!! that way
// some of the members you do not assign will default to
// internal values.
memset(&m_SIP_Params,0,s izeof( m_SIP_Params));
m_SIP_Params.pPersonalit yMicro code = LanScapeVME_F186495C_7AFF_4742_ADB7_87EA48A42633;
m_SIP_Params.LineMode = SWITCH_LINE;
#if 0
// Do not do this. if you do not have the callback defined as
// __stdcall, you will blow up the stack.
m_SIP_Params.UserNotifyC allbac kProc = (SIPCALLBACKPROC)PhoneEventHandler;
#else
// no type cast required if you define your callback properly.
m_SIP_Params.UserNotifyC allbac kProc = PhoneEventHandler;
#endif
m_SIP_Params.pUserDefinedData = this;
#if 0
// wrong. the value is not a string.
m_SIP_Params.IpAddressOf ThisHo st = "192.168.1.2";
#else
// IP4 addresses are 4 bytes.
m_SIP_Params.IpAddressOf ThisHo st[0] = 192;
m_SIP_Params.IpAddressOf ThisHo st[1] = 168;
m_SIP_Params.IpAddressOf ThisHo st[2] = 1;
m_SIP_Params.IpAddressOf ThisHo st[3] = 2;
#endif
m_SIP_Params.SipPort = 5060;
m_SIP_Params.MaxSipMesag eLengt h = 1500;
m_SIP_Params.pPhoneName = "TeleSoft";
m_SIP_Params.pPhoneDisplayName = "TeleSoft";
m_SIP_Params.CallConfere nceEna bled = FALSE;
m_SIP_Params.FarEndCallT ransfe rEnabled = FALSE;
m_SIP_Params.MinLocalRtpPort = 8000;
m_SIP_Params.MaxLocalRtpPort = 8000 + 64 * 2;
m_SIP_Params.ZeroBasedAu dioInD eviceId = SIP_AUDIO_DEVICE_NOT_USED;
m_SIP_Params.ZeroBasedAu dioOut DeviceId = SIP_AUDIO_DEVICE_NOT_USED;
m_SIP_Params.AudioRecord BandWi dth = AUDIO_BW_PCM_22K;
m_SIP_Params.AudioPlayba ckBand Width = AUDIO_BW_PCM_22K;
m_SIP_Params.PlaybackBuf fering Default = 2;
#if 0
// this is OK but...
m_SIP_Params.PlaybackBuf fering DuringSounds = 2;
#else
// we recommend setting this to 4. see the dev reference.
m_SIP_Params.PlaybackBuf fering DuringSounds = 4;
#endif
m_SIP_Params.PhoneLineTr ansmit Buffering = 2;
m_SIP_Params.LogSipMessages = TRUE;
m_SIP_Params.pSipLogFileName = "c:\\SIPLOG.TXT";
m_SIP_Params.EnableEvent LogSer ver = TRUE;
m_SIP_Params.EventLogSer verPor t = 514;
m_SIP_Params.pEventLogServer = "127.0.0.1";
m_SIP_Params.EnablePhone LineRe cording = TRUE;
m_SIP_Params.PhoneLineRe cordBu ffering = 0;
m_SIP_Params.StartupFlags = 0;
m_SIP_Params.MaxSipMesag eLengt h = 0;
m_SIP_Params.MaxMixerLin ebuffe rs = 0;
m_SIP_Params.MaxRtpPacke tLengt h = 0;
m_SIP_Params.NumPhoneLin esRequ ested = 6;
m_CallAnswerTimeout = 5;
m_EnableOutgoingRingTone = FALSE;
ret = StartSipTelephony (&m_SIP_Params, &m_hEngine);
if(ret != SipSuccess)
{
// get the error string. easier to look up
// in the dev reference.
pErrorStr = GetTelephonyStatusString(ret);
}
// allow SIP messages to go to a log server. helps
// with debugging.
ret = SetSipLogServer(m_hEngine,TRUE,"192.168.1.2",18000);
ret = SetCallAnswerTimeout (m_hEngine, m_CallAnswerTimeout);
ret = EnableOutgoingPhoneRing (m_hEngine, m_EnableOutgoingRingTone);
ret = EnableErrorSignal (m_hEngine, TRUE);
#if 0
// lanscape support has no code for this.
for (CurLine = 0 ; CurLine < LinesNum ; CurLine++){
pLine = new CLine (m_hEngine, this);
pLine->OpenLine (CurLine);
m_Lines.Add (pLine);
}
#endif
ret = SipTelephonyEnable (m_hEngine);
ret = SetAudioMediaFormat(m_hEngine, 0, Media_Format_G729);
ret = AddAuthorizationCredentials(
m_hEngine,
"myusername",
"mypwd",
"myusername@voipstunt.com"
);
ret = EnableSipDomain(m_hEngine, "voipstunt.com");
ret = EnableSipProxyServer(m_hEngine, "sip.voipstunt.com", 5060 );
// Optional: before you make a call, you might want to also activate
// VAD (noise discrimination) for transmitted audio. it will give
// you the lowest possible voice latency. we set nominal values here.
SetNoiseDiscriminationEn ableSt ate(m_hEngine,TRUE);
SetSilenceDecay(m_hEngin e,1200 );
SetNoiseThreshold(m_hEng ine,50 0);
#if 0
// lanscape support has no code for this.
ret = MakeCall (
m_hEngine,
"19058841234",
"sip.voipstunt.com ",
5060,
m_Lines [0]->GetLineId(),
TRUE,
1000);
#else
// just use phone line 0. Note: when using synchronous mode, specify a longer
// call answer timeout (see the last parameter).
ret = MakeCall (
m_hEngine,
"19058841234",
"sip.voipstunt.com ",
5060,
0,
TRUE,
10000
);
#endif
if(ret != SipSuccess)
{
// get the error string. easier to look up
// in the dev reference.
pErrorStr = GetTelephonyStatusString(ret);
}
|
|
|
Here is a SIP log of us trying to call the VOIP provider:
Code:
>>>> TxTxTxTxTxTxTxTxTxTxTxTxTxTxTx (0 Ms, To: 80.239.235.200:5060) >>>>
INVITE sip:19058841234@sip.voipstunt.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK018149e5
From: TeleSoft <sip:TeleSoft@192.168.1.2>;tag=1810706
To: <sip:19058841234@sip.voipstunt.com>
Contact: <sip:TeleSoft@192.168.1.2:5060>
Call-Id: dde0b2ac-9929-4689-a4cc-cfb5edd3a20e-00001878@192.168.1.2
CSeq: 8447392 INVITE
Max-Forwards: 70
Organization: 27C1E9D3-D533-4A31-B05B-937D47AE2FB6
Content-Length: 227
User-Agent: LanScape VOIP Media Engine/5.12.3.14 (www.LanScapeCorp.com)
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
v=0
o=TeleSoft 25218218 25218218 IN IP4 192.168.1.2
s=LanScape
c=IN IP4 192.168.1.2
t=0 0
m=audio 8116 RTP/AVP 18 101
a=rtpmap:18 G729/8000/1
a=rtpmap:101 telephone-event/8000/1
a=sendrecv
a=ptime:20
a=fmtp:101 0-15
<<<< RxRxRxRxRxRxRxRxRxRxRxRxRxRx (0 Ms, From: 80.239.235.200:5060) <<<<
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.2:5060;branch=z9hG4bK018149e5;rport
From: TeleSoft <sip:TeleSoft@192.168.1.2>;tag=1810706
To: <sip:19058841234@sip.voipstunt.com>
Contact: sip:19058841234@80.239.235.200:5060
Call-ID: dde0b2ac-9929-4689-a4cc-cfb5edd3a20e-00001878@192.168.1.2
CSeq: 8447392 INVITE
Server: (Very nice Sip Registrar/Proxy Server)
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS
WWW-Authenticate: Digest realm="sipdiscount.com",nonce="3144816959",algorithm=MD5
Content-Length: 0
>>>> TxTxTxTxTxTxTxTxTxTxTxTxTxTxTx (141 Ms, To: 80.239.235.200:5060) >>>>
ACK sip:19058841234@sip.voipstunt.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK018149e5
From: TeleSoft <sip:TeleSoft@192.168.1.2>;tag=1810706
To: <sip:19058841234@sip.voipstunt.com>
Call-Id: dde0b2ac-9929-4689-a4cc-cfb5edd3a20e-00001878@192.168.1.2
CSeq: 8447392 ACK
Max-Forwards: 70
Route: <sip:19058841234@80.239.235.200>
User-Agent: LanScape VOIP Media Engine/5.12.3.14 (www.LanScapeCorp.com)
Content-Length: 0
|
|
|
The call would have worked if we supplied correct authentication information.
Don’t forget to get the latest v5.12.3.14 trial media engine image for when you want to do more testing.
Repost as needed,
Support
|
Back to Top |
|
|
|
|