[Home]

Summary:ASTERISK-24996: chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate AOR Sections Exist in pjsip.conf
Reporter:Ashley Sanders (asanders)Labels:
Date Opened:2015-04-22 13:04:53Date Closed:2015-05-06 12:03:00
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip Core/Sorcery
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) pjsip.a.conf
( 1) pjsip.b.conf
Description:*This seems to only be relevant for outbound registrations.*

# On Asterisk instance \[A\]: The 'pjsip.conf' file contains definitions for an endpoint, aor, auth, and registration type, all named 'siptrunk'. The aor and registration sections are configured to point to address of  Asterisk instance \[B\].
# On Asterisk instance \[B\]: The 'pjsip.conf' file contains definitions for an endpoint, aor, auth, and registration type, all named 'siptrunk'. The aor and registration sections are configured to point to address of Asterisk instance \[A\].
# On Asterisk instance \[A\]: duplicate the siptrunk sections in pjsip.conf, so now there are two identical sections for each type (even though I am fairly certain it is the AOR section that is causing the grief.)
# Define an extension '5000' in the dialplan of both Asterisk instances to play hello-world:
{quote}
{{exten => 5000,1,NoOp()}}
{{same => n,Ringing()}}
{{same => n,Answer(5000)}}
{{same => n,Playback(hello-world)}}
{{same => n,Hangup()}}
{quote}
# After both instances of Asterisk are up and running, on the Asterisk instance \[A\], originate a channel using the Asterisk CLI:
{quote}{{originate pjsip/5000@siptrunk application echo}}{quote}
# Observe a crash.

*The peer asterisk system, Asterisk instance \[B\], can run above command successfully.*

I have attached a sample config for Asterisk instances A and B for the above scenario.
Comments:By: Ashley Sanders (asanders) 2015-05-06 12:03:00.120-0500

Modified the current loading strategy of the pjsip configuration. If
duplicate sections (e.g. sections containing the same [id/type]) are defined in
[pjsip.conf], the loader will consider the configuration for the given type as
invalid when the duplicate section is encountered. The entire configuration
(including what was previously loaded) for the duplicate [id/type] sections
will be rejected and destroyed, an error message is logged and the load
processing for the given stops.