[asterisk-dev] pjsip asterisk 13.24: sips / srtp and Deutsche Telekom doesn't work because of missing mediasec parameters

Michael Maier m1278468 at mailbox.org
Fri May 31 13:25:24 CDT 2019


On 31.05.19 at 19:25 Joshua C. Colp wrote:
> On Fri, May 31, 2019, at 1:57 PM, Michael Maier wrote:
> 
> <snip>
> 
>>
>> Thanks Joshua!
>>
>> I added the attached changes. Afterwards, I could see one SIGSEGV so 
>> far which I can't understand. I would be very happy, if you could take 
>> a 
>> look at it - maybe you have an idea? Most probably I'm doing something 
>> I shouldn't do (locking problem)?
>>
>> What I'm doing:
>> In qualify_contact_cb, I'm checking for the status code of the received 
>> response. If the status code is 494, I'm again calling 
>> sip_options_qualify_contact() with the flag 494. In 
>> sip_options_qualify_contact, I'm checking for the flag == 494 to add 
>> the additional mediasec 
>> headers.
>>
>>
>> Strangely, suddenly I could see one SIGSEGV (seems not (easily) to be 
>> reproducible) in
>> qualify_contact_cb(void *token, pjsip_event e) at
>>
>> if (e->body.tsx_state.src.rdata->msg_info.msg->line.status.code == 494) {
>>
>> according core dump.
>>
>> The crash directly happened after a successful sequence of mediasec 
>> relevant endpoint (endpoint2):
>>
>> - request OPTIONS
>> - response 494
>> - request OPTIONS w/ MEDIASEC
>> - response 200 OK
>> - Crash
>>
>> Obviously, there has been a problem with the processing of the received 
>> 200 OK. But why?
> 
> You are assuming that the callback will always have a message. This isn't true. The callback can occur if the request was sent and it received no response. The switch statement handles this, specifically the PJSIP_EVENT_RX_MSG type, which occurs if there is a response received.

Thanks for your very fast and kind support! I really missed the fact that there could be a callback w/o any response because of timeout. To
be honest: I just didn't know that (but it is logically consistent because otherwise you wouldn't know what happened)! Therefore, I moved
the check behind the switch as suggested and check at first for status == AVAILABLE. This should work now.


Thanks
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: options_mediasec.patch
Type: text/x-patch
Size: 1679 bytes
Desc: not available
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20190531/ef562f64/attachment.bin>


More information about the asterisk-dev mailing list