[Home]

Summary:ASTERISK-27276: pjsip crash given aor with no contacts
Reporter:Richard Frith-Macdonald (richardfm)Labels:
Date Opened:2017-09-15 09:04:37Date Closed:2017-09-19 14:58:04
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:14.6.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS-7Attachments:
Description:When attempting to dial out using a pjsipo endpoint whose aor section does not have a 'contacts'  value set, I get this crash:

asterisk: ../src/pjsip/sip_auth_client.c:507: pj_status_t pjsip_auth_clt_deinit(pjsip_auth_clt_sess *): Assertion `sess && sess->endpt' failed.
Aborted (core dumped)

I found this when I accidentally deleted the contacts line from pjsiop.conf. ... it seems to be reliably reproducable.
Comments:By: Asterisk Team (asteriskteam) 2017-09-15 09:04:38.714-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2017-09-15 09:08:43.318-0500

How have you installed and built PJSIP?

Assertions like this are only enabled when PJSIP is built in developer mode to assist identifying problems. In a normal build this assertion won't happen and things won't crash.

By: Richard Frith-Macdonald (richardfm) 2017-09-15 09:08:53.164-0500

I just noticed a typo.  It's 'contact' not 'contacts'.
The crash occurs if
contact=...
is omitted from the aor.

Just in case it's relevant, this is making a call out using ARI where the 'endpoint' parameter to the ARI request is of the form PJSIP/123456@endpointname

By: Richard Frith-Macdonald (richardfm) 2017-09-15 09:10:25.449-0500

// Assertions like this are only enabled ...
Sorry, I didn't realise that.  I will look into how my pjsip is built.

By: Joshua C. Colp (jcolp) 2017-09-15 09:12:22.645-0500

I'll leave this in feedback. I'd highly suggest using bundled PJSIP[1], as it is built for the environment Asterisk uses it in and also includes additional fixes that have not reached a PJSIP release yet.

[1] http://blogs.asterisk.org/2016/03/16/asterisk-13-8-0-now-easier-pjsip-install-method/

By: Richard Frith-Macdonald (richardfm) 2017-09-15 09:19:31.214-0500

I see I have pjproject 2.5.5 configured/built with the following options:
--disable-opencore-amr --disable-resample --disable-sound --disable-video --enable-shared --with-external-gsm --with-external-speex --with-external-srtp --enable-epoll

I'll try rebuilding asterisk using the method you suggest (and try updating from 14.6.0 to 14.6.1).

By: Richard Frith-Macdonald (richardfm) 2017-09-15 11:52:32.004-0500

Thanks ... I can confirm that after updating to 14.6.1 and building that with the bundled pjsip, the crash is fixed.
Instead on the console I get

[Sep 15 17:47:35] ERROR[17554]: res_pjsip.c:3053 ast_sip_create_dialog_uac: Endpoint 'devtest': Could not create dialog to invalid URI 'devtest'.  Is endpoint registered and reachable?
[Sep 15 17:47:35] ERROR[17554]: chan_pjsip.c:2219 request: Failed to create outgoing session to endpoint 'devtest'

Which seems much more reasonable than crashing :-)

By: Rusty Newton (rnewton) 2017-09-19 14:57:51.186-0500

Thanks for the follow up Richard.

If you have any suggestions on improving documentation that might have prevented this report, please let us know with a new JIRA issue. I'm going to close this one out.