[asterisk-dev] geo location segmentation fault occurring on inbound call

Dan Cropp dan at amtelco.com
Wed Sep 7 16:24:10 CDT 2022


I have two asterisk VMs setup.  One Asterisk VM calls the other, passing geo location information.

On one box, I initiate an Originate via AMI

I pass in a blank A2 value (attempting to replicate a blank A2 field a customer's SIP passes to them).  Everything is fine when I don't pass the A2=, portion.
The easy answer is not to send the A2=, portion.

However, it seems like it might be important to make sure Asterisk doesn't generate a segmentation fault when a packet like this is received.



Action: Originate^M
ActionID: S29^M
Channel: PJSIP/3333 at 192.168.33.33^M
Exten: createcall^M
Context: IS^M
Priority: 1^M
Timeout: 60000^M
CallerID: John Doe <1234>^M
Variable: CALLERID(num-pres)=allowed_passed_screen,TrunkAllocateId=3,OriginateCallId=3^M
Variable: GEOLOC_PROFILE(usage_rules)="retransmission-allowed=true",GEOLOC_PROFILE(allow_routing_use)="yes",GEOLOC_PROFILE(pidf_element)="tuple",GEOLOC_PROFILE(confidence)="pdf=Normal,value=80",GEOLOC_PROFILE(location_info)="country=CA,\
A1=QC,A2=,A3=COOKSHIRE EATON,HNO=160,RD=POPE,PC=J0B 1M0,NAM=CENTRE DE SANTE COOKSHIRE",GEOLOC_PROFILE(method)="Manual",GEOLOC_PROFILE(format)="civicAddress"^M
Async: true^M
Codecs: ulaw^M
^M


The second box sees the INVITE and starts processing it but then outputs a Segmentation fault.



<--- Received SIP request (2262 bytes) from UDP:192.168.33.31:5060 --->
INVITE sip:3333 at 192.168.33.33 SIP/2.0
Via: SIP/2.0/UDP 192.168.33.31:5060;rport;branch=z9hG4bKPj62f47e49-29fd-420e-97fb-d9a1970aba48
From: "John Doe" <sip:1234 at 192.168.33.31>;tag=36ae7a5e-8264-4a38-8468-873aa245985e
To: <sip:3333 at 192.168.33.33>
Contact: <sip:asterisk at 192.168.33.31:5060>
Call-ID: 0ab86466-cbca-4d11-a0dd-b8d14b9e687c
CSeq: 1996 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Geolocation: <cid:twpre at 192.168.33.31>
Geolocation-Routing: yes
Max-Forwards: 70
User-Agent: Asterisk PBX 18.14.0
Content-Type: multipart/mixed;boundary=1ffe84bc-e538-44a4-a860-788994f54a28
Content-Length:  1479


--1ffe84bc-e538-44a4-a860-788994f54a28
Content-Type: application/sdp
Content-Length:   181

v=0
o=- 812269913 812269913 IN IP4 192.168.33.31
s=Asterisk
c=IN IP4 192.168.33.31
t=0 0
m=audio 10742 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

--1ffe84bc-e538-44a4-a860-788994f54a28
Content-ID: <twpre at 192.168.33.31>
Content-Type: application/pidf+xml
Content-Length:  1018

<?xml version="1.0"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:ca="urn:ietf:params:xml:ns:pidf:geopriv10:civicAddr" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:gbp="urn:ietf:params:xml:ns:pidf:geopriv10:basicPolicy" xmlns:gml="http://www.opengis.net/gml" xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10" xmlns:gs="http://www.opengis.net/pidflo/1.0" xmlns:con="urn:ietf:params:xml:ns:geopriv:conf" xmlns:date="http://exslt.org/dates-and-times" entity="PJSIP/192.168.33.33-00000002">
  <tuple>
    <status>
      <gp:geopriv>
        <gp:location-info>
          <ca:civicAddress xml:lang="en"/>
          <con:confidence pdf="Normal">80</con:confidence>
        </gp:location-info>
        <gp:usage-rules>
          <gp:retransmission-allowed>true</gp:retransmission-allowed>
        </gp:usage-rules>
        <gp:method>Manual</gp:method>
      </gp:geopriv>
    </status>
    <timestamp>2022-09-07T21:10:45Z</timestamp>
  </tuple>
</presence>

--1ffe84bc-e538-44a4-a860-788994f54a28--

<--- Transmitting SIP response (376 bytes) to UDP:192.168.33.31:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.33.31:5060;rport=5060;received=192.168.33.31;branch=z9hG4bKPj62f47e49-29fd-420e-97fb-d9a1970aba48
Call-ID: 0ab86466-cbca-4d11-a0dd-b8d14b9e687c
From: "John Doe" <sip:1234 at 192.168.33.31>;tag=36ae7a5e-8264-4a38-8468-873aa245985e
To: <sip:3333 at 192.168.33.33>
CSeq: 1996 INVITE
Server: Asterisk PBX 18.14.0
Content-Length:  0


Segmentation fault



[09/07 16:10:45.813] DEBUG[102650] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg INVITE/cseq=1996 (rdata0x7f509c002578)
[09/07 16:10:45.813] DEBUG[102650] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-00000059 to use for Request msg INVITE/cseq=1996 (rdata0x7f509c002578)
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_endpoint_identifier_ip.c: Source address 192.168.33.31:5060 does not match identify 'identify55'
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_endpoint_identifier_ip.c: Source address 192.168.33.31:5060 does not match identify 'identify57'
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_endpoint_identifier_ip.c: Source address 192.168.33.31:5060 does not match identify 'identify59'
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_endpoint_identifier_ip.c: Source address 192.168.33.31:5060 matches identify 'identify61'
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_endpoint_identifier_ip.c: Identify 'identify61' SIP message matched to endpoint 192.168.33.31
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  (null session) Request: INVITE
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  Request:
[09/07 16:10:45.813] DEBUG[102651] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-00000059 to use for Request msg INVITE/cseq=1996 (rdata0x7f509c016b98)
[09/07 16:10:45.813] DEBUG[102651] chan_pjsip.c:  192.168.33.31
[09/07 16:10:45.813] DEBUG[102651] chan_pjsip.c:  Direct media no glare mitigation
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Call (UDP:192.168.33.31:5060) to extension '3333' sending 100 Trying
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Method is INVITE, Response is 100 Trying
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31 Event: TSX_STATE  Inv State: INCOMING
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c: 192.168.33.31: Source of transaction state change is TX_MSG
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31 TSX State: Proceeding  Inv State: INCOMING
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  Nothing delayed
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31 TSX State: Proceeding  Inv State: INCOMING
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  Topology: Pending: (null topology)  Active: (null topology)
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Media count: 1
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Processing stream 0
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Using audio-0 for new stream name
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Using new stream 0:audio-0:audio:sendrecv (nothing)
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31 Adding position 0
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  Creating new media session
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  Setting media session as default for audio
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  Done
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Negotiating incoming SDP media stream 0:audio-0:audio:sendrecv (nothing) using audio SDP handler
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_sdp_rtp.c:  192.168.33.31
[09/07 16:10:45.813] DEBUG[102651] res_pjsip_sdp_rtp.c: Transport transport1 bound to 0.0.0.0: Using it for RTP media.
[09/07 16:10:45.813] DEBUG[102651] rtp_engine.c: Using engine 'asterisk' for RTP instance '0x7f507003eef0'
[09/07 16:10:45.813] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) RTP allocated port 14734
[09/07 16:10:45.813] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) ICE creating session 0.0.0.0:14734 (14734)
[09/07 16:10:45.813] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) ICE create
[09/07 16:10:45.814] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) ICE add system candidates
[09/07 16:10:45.814] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) ICE add candidate: 192.168.33.33:14734, 2130706431
[09/07 16:10:45.814] DEBUG[102651] rtp_engine.c: RTP instance '0x7f507003eef0' is setup and ready to go
[09/07 16:10:45.814] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) ICE stopped
[09/07 16:10:45.814] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) RTCP setup on RTP instance
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:  192.168.33.31
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:  192.168.33.31
[09/07 16:10:45.814] DEBUG[102651] rtp_engine.c: Setting tx payload type 0 based on m type on 0x7f503ca182b0
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session/pjsip_session_caps.c: '192.168.33.31' Caps for incoming audio call with pref 'local' - remote: (ulaw) local: (ulaw) joint: (ulaw)
[09/07 16:10:45.814] DEBUG[102651] rtp_engine.c: Crossover copying tx to rx payload mapping 0 (0x7f5070020ed8) from 0x7f503ca182b0 to 0x7f503ca182b0
[09/07 16:10:45.814] DEBUG[102651] rtp_engine.c: Copying rx payload mapping 0 (0x7f5070020ed8) from 0x7f503ca182b0 to 0x7f507003f0c8
[09/07 16:10:45.814] DEBUG[102651] rtp_engine.c: Copying tx payload mapping 0 (0x7f5070020ed8) from 0x7f503ca182b0 to 0x7f507003f0c8
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Media stream 0:audio-0:audio:sendrecv (ulaw) handled by audio
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Done with stream 0:audio-0:audio:sendrecv (ulaw)
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Handled? yes
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Processing streams
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Processing stream 0:audio-0:audio:sendrecv (ulaw)
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31 Adding position 0
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  Using existing media_session
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31 Stream: 0:audio-0:audio:sendrecv (ulaw)
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:  192.168.33.31 Type: audio 0:audio-0:audio:sendrecv (ulaw)
[09/07 16:10:45.814] DEBUG[102651] res_rtp_asterisk.c: (0x7f507003eef0) RTCP ignoring duplicate property
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_sdp_rtp.c:  RC: 1
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  Had handler
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Stream 0:audio-0:audio:sendrecv (ulaw) added
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Done with 0:audio-0:audio:sendrecv (ulaw)
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Adding bundle groups (if available)
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Copying connection details
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Processing media 0
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Media 0 reset
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_session.c:  192.168.33.31: Method is INVITE
[09/07 16:10:45.814] DEBUG[102651] chan_pjsip.c:  192.168.33.31
[09/07 16:10:45.814] DEBUG[102651] chan_pjsip.c:  192.168.33.31
[09/07 16:10:45.814] DEBUG[102651] channel_internal_api.c:  <initializing>: Formats: (none)
[09/07 16:10:45.814] DEBUG[102651] channel_internal_api.c:  Channel is being initialized or destroyed
[09/07 16:10:45.814] DEBUG[102651] stasis.c: Creating topic. name: channel:1662585045.0, detail:
[09/07 16:10:45.814] DEBUG[102651] stasis.c: Topic 'channel:1662585045.0': 0x7f5070046e20 created
[09/07 16:10:45.814] DEBUG[102651] channel.c: Channel 0x7f507005c950 'PJSIP/192.168.33.31-00000000' allocated
[09/07 16:10:45.814] DEBUG[102651] chan_pjsip.c:  Topology:  <0:audio-0:audio:sendrecv (ulaw)> Formats: (ulaw)
[09/07 16:10:45.814] DEBUG[102651] chan_pjsip.c:  Compatible? yes
[09/07 16:10:45.814] DEBUG[102651] channel_internal_api.c:  PJSIP/192.168.33.31-00000000: MultistreamFormats: (ulaw)
[09/07 16:10:45.814] DEBUG[102651] channel_internal_api.c:  Set native formats but not topology
[09/07 16:10:45.814] DEBUG[102651] channel_internal_api.c:  PJSIP/192.168.33.31-00000000:  <0:audio-0:audio:sendrecv (ulaw)>
[09/07 16:10:45.814] DEBUG[102651] channel_internal_api.c:  Used provided topology
[09/07 16:10:45.814] DEBUG[102651] chan_pjsip.c:
[09/07 16:10:45.814] DEBUG[102651] chan_pjsip.c:  PJSIP/192.168.33.31-00000000
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_geolocation.c:  PJSIP/192.168.33.31-00000000
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_geolocation.c:  PJSIP/192.168.33.31-00000000: Geolocation: <cid:twpre at 192.168.33.31>
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_geolocation.c:  Processing URI '<cid:twpre at 192.168.33.31>'
[09/07 16:10:45.814] DEBUG[102651] res_pjsip_geolocation.c:  Processing PIDF-LO '<cid:twpre at 192.168.33.31>'
[09/07 16:10:45.814] DEBUG[102651] res_geolocation/geoloc_eprofile.c:  PJSIP/192.168.33.31-00000000
[09/07 16:10:45.815] DEBUG[102651] res_geolocation/geoloc_eprofile.c:  PJSIP/192.168.33.31-00000000
[09/07 16:10:45.815] DEBUG[102651] res_geolocation/geoloc_eprofile.c:  PJSIP/192.168.33.31-00000000
[09/07 16:10:45.815] DEBUG[102651] res_geolocation/geoloc_eprofile.c:  PJSIP/192.168.33.31-00000000
[09/07 16:10:45.815] DEBUG[102651] res_geolocation/geoloc_eprofile.c:  PJSIP/192.168.33.31-00000000: Done

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20220907/06865060/attachment-0001.html>


More information about the asterisk-dev mailing list