[Home]

Summary:ASTERISK-25086: [patch]PJSIP crashes if endpoint missing in Dial()
Reporter:snuffy (snuffy)Labels:
Date Opened:2015-05-14 03:34:38Date Closed:2015-05-18 07:35:30
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip_session
Versions:SVN 13.0.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) pjsip-crash.diff
Description:If a variable was missing
{noformat}
exten => 733,1,Dial(PJSIP/${EXTEN}@${NOTHERE},10)
exten => 733,n,Hangup
{noformat}

Dial would become
{noformat}
Dial("PJSIP/xxxx", "PJSIP/733@,10")
{noformat}

Segfault occurs..
{noformat}
#0  ast_sip_session_create_outgoing (endpoint=endpoint@entry=0x0, contact=contact@entry=0x0, location=0x0,
   request_user=request_user@entry=0x7fcd4a78bcb0 "1300786786", req_caps=0x7fcd580033d8) at res_pjsip_session.c:1447
1447                    location = S_OR(location, endpoint->aors);
{noformat}
Comments:By: snuffy (snuffy) 2015-05-14 07:34:31.785-0500

Fix suggested by coreyfarrell

Tested by myself and no crash anymore

Just dial error.
{noformat}
-- Executing [733@mel-phones:1] Dial("PJSIP/3202-00000000", "PJSIP/733@,10") in new stack
[May 14 17:54:46] ERROR[13254]: chan_pjsip.c:1865 request: Unable to create PJSIP channel with empty endpoint name
[May 14 17:54:46] ERROR[13254]: chan_pjsip.c:1874 request: Failed to create outgoing session to endpoint ''
[May 14 17:54:46] WARNING[13297][C-00000001]: app_dial.c:2381 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
{noformat}