From: Gullik W. <gul...@co...> - 2013-05-30 21:06:35
|
Closing in: osip_parse() returns -5. I have been looking for explanations of error returns, but with no luck yet, except "I got a -5 in return for a malformed sip header I passed to my program". So, it is probably a detail in the sip header returnd from asterisk that causes this, but which? Well, lacking documentation, I guess a detailed comparison of all characters in all fiels is the only way forward... Gullik May 30 20:38:41 webjorn-HP-530-Notebook-PC openbts: WARNING 3074403136 SIPInterface.cpp:306:drive: GW firstLine => INVITE sip: IMSI240084601190475@127.0.0.1:5062 SIP/2.0#015<=end May 30 20:38:41 webjorn-HP-530-Notebook-PC openbts: WARNING 3074403136 SIPInterface.cpp:307:drive: GW MreadBuffer => INVITE sip: IMSI240084601190475@127.0.0.1:5062 SIP/2.0#015#012Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1a3dfbab;rport#015#012Max-Forwards: 70#015#012From: "IMSI240078120193468" <sip:2122102@127.0.0.1>;tag=as2b37ff1c#015#012To: <sip: IMSI240084601190475@127.0.0.1:5062>#015#012Contact: <sip:2122102@127.0.0.1:5060>#015#012Call-ID: 75bbc7d242ebb5c16f032f0764adcda5@127.0.0.1:5060#015#012CSeq: 102 INVITE#015#012User-Agent: Asterisk PBX 1.8.10.1~dfsg-1ubuntu1#015#012Date: Thu, 30 May 2013 18:38:41 GMT#015#012Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH#015#012Supported: replaces, timer#015#012Content-Type: application/sdp#015#012Content-Length: 292#015#012#015#012v=0#015#012o=root 1438696178 1438696178 IN IP4 127.0.0.1#015#012s=Asterisk PBX 1.8.10.1~dfsg-1ubuntu1#015#012c=IN IP4 127.0.0.1#015#012t=0 0#015#012m=audio 17346 RTP/AVP 3 0 8 101#015#012a=rtpmap:3 GSM/8000#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:8 PCMA/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-16#015#012a=ptime:20#015#012a=sendrecv#015#012<=end May 30 20:38:41 webjorn-HP-530-Notebook-PC openbts: WARNING 3074403136 SIPInterface.cpp:310:drive: message with no call id=> Last, the original log WARNING, telling that this invite has a zero call ID causing SIPInterface to drop it. osit_parse_message ?? Or, can you see anything syntacticly wrong with the invite from asterisk?? This is the cause at my installation that prevents calls outside-> MS, or MS->MS. I really wonder, does this code work for YOU?? In that case, a single packet dump of a WORKING INVITE would probably help me find out what goes on here... On 05/28/2013 02:31 PM, Gullik Webjörn wrote: >> SIP calls from outside, passed from asterisk to BTS, fail since they fall out of SIPInterface.cpp:308 >> The reason is that attempting to parse the message returns a zero field when calling osip_call_id_get_number() >> >> I have tried to fix this, but I am to bad at C++, I manage to segfault. Dumping the mReadBuffer I can see >> that all CRLFs in the Invite message have been replaced with #012#015, by the sscanf >> I replaced the call to osip_call_id_get_number with a strcasestr looking for "Call-ID:", advanced the >> pointer past the "Call-ID:" position and tried to pass that for testing but I get the string written >> out properly by my debug statement, and then a segfault. >> >> However, googling for osip_call_id_get_number, indicates that they just return >> >> messsage->callid; >> >> which I do not understand, since the invite text does not have fixed field lengths, >> so I do not see how this could work in all cases. (or is this a different osip code)?? >> >> Anyway, this seems to be the problem here, calling osip_call_get_id_number returns NULL, where there IS >> a completely valid call-id in the message. For someone with better experince with the osip API and with C++ >> skills..... >> >> Regards, >> >> Gullik >> >> >> |