Need the long Call-ID from the INVITE Header Asterisk 13 or 16

I am trying to get the long Call-ID from the INVITE Header but I am only able to see the short Call-ID at this point. Later in the call I can see the long Call-ID but I need the long one. In another forum someone posted this to get the long Call-ID but I have tried that with chan_sip in both Asterisk 13 and 16 and always get the short Call-ID.
Suggested code to use:
exten => _40XX,1,Progress(); Matching: 4000 - 4099
same => n,Verbose(1,${SIP_HEADER(Call-ID)})
same => n,Dial(SIP/${EXTEN},120)

; with this result for the person who posted this:
[Nov 16 13:30:53] – Executing [1000@osmc:2] Verbose(“SIP/1001-00000025”, “1,66808104975DC321@192.168.188.1”) in new stack
[Nov 16 13:30:53] 66808104975DC321@192.168.188.1

I am only getting the short Call-ID though when I use the above in my dialplan.

Posted below is the debug when I use that code in Asterisk 16. Sorry for the big debug but as a new user I am not permitted to upload any files. Thanks for any help on this. :slight_smile:


<--- SIP read from UDP:192.168.1.6:49857 --->
INVITE sip:4002@192.168.1.101 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.ulW15YawC;rport
From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
To: "unknown" <sip:4002@192.168.1.101>
CSeq: 20 INVITE
Call-ID: 8UDyu69vXw
Max-Forwards: 70
Supported: replaces, outbound, gruu
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 445
Contact: <sip:4001@192.168.1.6:49857;transport=udp>;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
User-Agent: Unknown (belle-sip/4.4.0)

v=0
o=4001 174 296 IN IP4 192.168.1.6
s=Talk
c=IN IP4 192.168.1.6
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7246 RTP/AVP 0 8 9 101
a=rtpmap:101 telephone-event/8000
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr
m=video 9212 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42801F
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 ccm fir
<------------->
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  0 [ 37]: INVITE sip:4002@192.168.1.101 SIP/2.0
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  1 [ 65]: Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.ulW15YawC;rport
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  2 [ 61]: From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  3 [ 38]: To: "unknown" <sip:4002@192.168.1.101>
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  4 [ 15]: CSeq: 20 INVITE
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  5 [ 19]: Call-ID: 8UDyu69vXw
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  6 [ 16]: Max-Forwards: 70
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  7 [ 35]: Supported: replaces, outbound, gruu
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  8 [ 89]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  9 [ 29]: Content-Type: application/sdp
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 10 [ 19]: Content-Length: 445
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 11 [155]: Contact: <sip:4001@192.168.1.6:49857;transport=udp>;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 12 [ 37]: User-Agent: Unknown (belle-sip/4.4.0)
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 13 [  0]:
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  0 [  3]: v=0
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  1 [ 33]: o=4001 174 296 IN IP4 192.168.1.6
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  2 [  6]: s=Talk
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  3 [ 20]: c=IN IP4 192.168.1.6
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  4 [  5]: t=0 0
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  5 [ 72]: a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  6 [ 30]: m=audio 7246 RTP/AVP 0 8 9 101
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  7 [ 33]: a=rtpmap:101 telephone-event/8000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  8 [ 24]: a=rtcp-fb:* trr-int 1000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  9 [ 21]: a=rtcp-fb:* ccm tmmbr
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 10 [ 23]: m=video 9212 RTP/AVP 96
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 11 [ 22]: a=rtpmap:96 H264/90000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 12 [ 33]: a=fmtp:96 profile-level-id=42801F
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 13 [ 24]: a=rtcp-fb:* trr-int 1000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 14 [ 21]: a=rtcp-fb:* ccm tmmbr
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 15 [ 21]: a=rtcp-fb:96 nack pli
 DEBUG[4724]: chan_sip.c:9974 parse_request:    Body 16 [ 20]: a=rtcp-fb:96 ccm fir
--- (13 headers 17 lines) ---
 DEBUG[4724]: chan_sip.c:9467 __find_call: = Looking for  Call ID: 8UDyu69vXw (Checking From) --From tag eBdgQclti --To-tag
 DEBUG[4724]: acl.c:990 ast_ouraddrfor: For destination '192.168.1.6', our source address is '192.168.1.101'.
 DEBUG[4724]: chan_sip.c:3958 ast_sip_ouraddrfor: Setting AST_TRANSPORT_UDP with address 192.168.1.101:5060
 DEBUG[4724]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.6:49857' into...
 DEBUG[4724]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.6' and port '49857'.
Sending to 192.168.1.6:49857 (NAT)
 DEBUG[4724]: chan_sip.c:9060 __sip_alloc: Allocating new SIP dialog for 8UDyu69vXw - INVITE (No RTP)
 DEBUG[4724][C-0000000d]: chan_sip.c:29082 handle_incoming: **** Received INVITE (5) - Command in SIP INVITE
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1709 parse_sip_options: Begin: parsing SIP "Supported: replaces, outbound, gruu"
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1724 parse_sip_options: Found SIP option: -replaces-
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1732 parse_sip_options: Matched SIP option: replaces
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1724 parse_sip_options: Found SIP option: -outbound-
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1732 parse_sip_options: Matched SIP option: outbound
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1724 parse_sip_options: Found SIP option: -gruu-
 DEBUG[4724][C-0000000d]: sip/reqresp_parser.c:1732 parse_sip_options: Matched SIP option: gruu
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.6:49857' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.6' and port '49857'.
Sending to 192.168.1.6:49857 (NAT)
 DEBUG[4724][C-0000000d]: chan_sip.c:26521 handle_request_invite: Initializing initreq for method INVITE - callid 8UDyu69vXw
Using INVITE request as basis request - 8UDyu69vXw
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
Found peer '4001' for '4001' from 192.168.1.6:49857

<--- Reliably Transmitting (NAT) to 192.168.1.6:49857 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.ulW15YawC;received=192.168.1.6;rport=49857
From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
To: "unknown" <sip:4002@192.168.1.101>;tag=as008b42d1
Call-ID: 8UDyu69vXw
CSeq: 20 INVITE
Server: FPBX-15.0.16.72(13.32.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="298c7b0d"
Content-Length: 0


<------------>
 DEBUG[4724][C-0000000d]: chan_sip.c:4314 __sip_reliable_xmit: *** SIP TIMER: Initializing retransmit timer on packet: Id  #143
 DEBUG[4724][C-0000000d]: chan_sip.c:3801 __sip_xmit: Trying to put 'SIP/2.0 401' onto UDP socket destined for 192.168.1.6:49857
Scheduling destruction of SIP dialog '8UDyu69vXw' in 7360 ms (Method: INVITE)

<--- SIP read from UDP:192.168.1.6:49857 --->
ACK sip:4002@192.168.1.101 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.ulW15YawC;rport
Call-ID: 8UDyu69vXw
From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
To: "unknown" <sip:4002@192.168.1.101>;tag=as008b42d1
Contact: <sip:4001@192.168.1.6:49857;transport=udp>;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
Max-Forwards: 70
CSeq: 20 ACK

<------------->
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  0 [ 34]: ACK sip:4002@192.168.1.101 SIP/2.0
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  1 [ 65]: Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.ulW15YawC;rport
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  2 [ 19]: Call-ID: 8UDyu69vXw
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  3 [ 61]: From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  4 [ 53]: To: "unknown" <sip:4002@192.168.1.101>;tag=as008b42d1
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  5 [155]: Contact: <sip:4001@192.168.1.6:49857;transport=udp>;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  6 [ 16]: Max-Forwards: 70
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  7 [ 12]: CSeq: 20 ACK
--- (8 headers 0 lines) ---
 DEBUG[4724]: chan_sip.c:9467 __find_call: = Looking for  Call ID: 8UDyu69vXw (Checking From) --From tag eBdgQclti --To-tag as008b42d1
 DEBUG[4724][C-0000000d]: chan_sip.c:29082 handle_incoming: **** Received ACK (6) - Command in SIP ACK
 DEBUG[4724][C-0000000d]: chan_sip.c:4574 __sip_ack: ** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #143
 DEBUG[4724][C-0000000d]: chan_sip.c:4585 __sip_ack: Stopping retransmission on '8UDyu69vXw' of Response 20: Match Found

<--- SIP read from UDP:192.168.1.6:49857 --->
INVITE sip:4002@192.168.1.101 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.cIT1aPyXV;rport
From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
To: "unknown" <sip:4002@192.168.1.101>
CSeq: 21 INVITE
Call-ID: 8UDyu69vXw
Max-Forwards: 70
Supported: replaces, outbound, gruu
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 445
Contact: <sip:4001@192.168.1.6:49857;transport=udp>;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
User-Agent: Unknown (belle-sip/4.4.0)
Authorization: Digest realm="asterisk", nonce="298c7b0d", algorithm=MD5, username="4001", uri="sip:4002@192.168.1.101", response="729501a31ac1db5bdd24fb1dcba8af23"

v=0
o=4001 174 296 IN IP4 192.168.1.6
s=Talk
c=IN IP4 192.168.1.6
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7246 RTP/AVP 0 8 9 101
a=rtpmap:101 telephone-event/8000
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr
m=video 9212 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42801F
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 ccm fir
<------------->
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  0 [ 37]: INVITE sip:4002@192.168.1.101 SIP/2.0
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  1 [ 65]: Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.cIT1aPyXV;rport
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  2 [ 61]: From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  3 [ 38]: To: "unknown" <sip:4002@192.168.1.101>
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  4 [ 15]: CSeq: 21 INVITE
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  5 [ 19]: Call-ID: 8UDyu69vXw
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  6 [ 16]: Max-Forwards: 70
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  7 [ 35]: Supported: replaces, outbound, gruu
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  8 [ 89]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header  9 [ 29]: Content-Type: application/sdp
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 10 [ 19]: Content-Length: 445
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 11 [155]: Contact: <sip:4001@192.168.1.6:49857;transport=udp>;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 12 [ 37]: User-Agent: Unknown (belle-sip/4.4.0)
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 13 [163]: Authorization: Digest realm="asterisk", nonce="298c7b0d", algorithm=MD5, username="4001", uri="sip:4002@192.168.1.101", response="729501a31ac1db5bdd24fb1dcba8af23"
 DEBUG[4724]: chan_sip.c:9937 parse_request:  Header 14 [  0]:
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  0 [  3]: v=0
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  1 [ 33]: o=4001 174 296 IN IP4 192.168.1.6
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  2 [  6]: s=Talk
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  3 [ 20]: c=IN IP4 192.168.1.6
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  4 [  5]: t=0 0
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  5 [ 72]: a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  6 [ 30]: m=audio 7246 RTP/AVP 0 8 9 101
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  7 [ 33]: a=rtpmap:101 telephone-event/8000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  8 [ 24]: a=rtcp-fb:* trr-int 1000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body  9 [ 21]: a=rtcp-fb:* ccm tmmbr
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 10 [ 23]: m=video 9212 RTP/AVP 96
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 11 [ 22]: a=rtpmap:96 H264/90000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 12 [ 33]: a=fmtp:96 profile-level-id=42801F
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 13 [ 24]: a=rtcp-fb:* trr-int 1000
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 14 [ 21]: a=rtcp-fb:* ccm tmmbr
 DEBUG[4724]: chan_sip.c:9937 parse_request:    Body 15 [ 21]: a=rtcp-fb:96 nack pli
 DEBUG[4724]: chan_sip.c:9974 parse_request:    Body 16 [ 20]: a=rtcp-fb:96 ccm fir
--- (14 headers 17 lines) ---
 DEBUG[4724]: chan_sip.c:9467 __find_call: = Looking for  Call ID: 8UDyu69vXw (Checking From) --From tag eBdgQclti --To-tag
 DEBUG[4724]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
 DEBUG[4724]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
 DEBUG[4724][C-0000000d]: chan_sip.c:29082 handle_incoming: **** Received INVITE (5) - Command in SIP INVITE
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.6:49857' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.6' and port '49857'.
Sending to 192.168.1.6:49857 (NAT)
 DEBUG[4724][C-0000000d]: chan_sip.c:26521 handle_request_invite: Initializing initreq for method INVITE - callid 8UDyu69vXw
Using INVITE request as basis request - 8UDyu69vXw
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
Found peer '4001' for '4001' from 192.168.1.6:49857
 DEBUG[4724][C-0000000d]: rtp_engine.c:526 ast_rtp_instance_new: Using engine 'asterisk' for RTP instance '0x7fcf08015310'
 DEBUG[4724][C-0000000d]: res_rtp_asterisk.c:3598 rtp_allocate_transport: Allocated port 16204 for RTP instance '0x7fcf08015310'
 DEBUG[4724][C-0000000d]: res_rtp_asterisk.c:3628 rtp_allocate_transport: Creating ICE session 0.0.0.0:16204 (16204) for RTP instance '0x7fcf08015310'
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
 DEBUG[4724][C-0000000d]: rtp_engine.c:543 ast_rtp_instance_new: RTP instance '0x7fcf08015310' is setup and ready to go
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting 'freepbx.sangoma.local' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host 'freepbx.sangoma.local' and port ''.
 DEBUG[4724][C-0000000d]: res_rtp_asterisk.c:7783 ast_rtp_prop_set: Setup RTCP on RTP instance '0x7fcf08015310'
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
 DEBUG[4724][C-0000000d]: chan_sip.c:5847 do_setnat: Setting NAT on RTP to On
 DEBUG[4724][C-0000000d]: chan_sip.c:10373 process_sdp: Processing session-level SDP v=0... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: chan_sip.c:10373 process_sdp: Processing session-level SDP o=4001 174 296 IN IP4 192.168.1.6... OK.
 DEBUG[4724][C-0000000d]: chan_sip.c:10373 process_sdp: Processing session-level SDP s=Talk... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.6' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.6' and port ''.
 DEBUG[4724][C-0000000d]: chan_sip.c:10373 process_sdp: Processing session-level SDP c=IN IP4 192.168.1.6... OK.
 DEBUG[4724][C-0000000d]: chan_sip.c:10373 process_sdp: Processing session-level SDP t=0 0... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: chan_sip.c:10373 process_sdp: Processing session-level SDP a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics... UNSUPPORTED OR FAILED.
Found RTP audio format 0
 DEBUG[4724][C-0000000d]: rtp_engine.c:1319 ast_rtp_codecs_payloads_set_m_type: Setting tx payload type 0 based on m type on 0x7fceb5edc1a0
Found RTP audio format 8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1319 ast_rtp_codecs_payloads_set_m_type: Setting tx payload type 8 based on m type on 0x7fceb5edc1a0
Found RTP audio format 9
 DEBUG[4724][C-0000000d]: rtp_engine.c:1319 ast_rtp_codecs_payloads_set_m_type: Setting tx payload type 9 based on m type on 0x7fceb5edc1a0
Found RTP audio format 101
Found audio description format telephone-event for ID 101
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (audio) SDP a=rtpmap:101 telephone-event/8000... OK.
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (audio) SDP a=rtcp-fb:* trr-int 1000... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (audio) SDP a=rtcp-fb:* ccm tmmbr... UNSUPPORTED OR FAILED.
Found RTP video format 96
 DEBUG[4724][C-0000000d]: chan_sip.c:34250 process_crypto: Received offer with crypto line for media stream that is not enabled
Found video description format H264 for ID 96
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (video) SDP a=rtpmap:96 H264/90000... OK.
 DEBUG[4724][C-0000000d]: chan_sip.c:34250 process_crypto: Received offer with crypto line for media stream that is not enabled
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (video) SDP a=fmtp:96 profile-level-id=42801F... OK.
 DEBUG[4724][C-0000000d]: chan_sip.c:34250 process_crypto: Received offer with crypto line for media stream that is not enabled
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (video) SDP a=rtcp-fb:* trr-int 1000... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: chan_sip.c:34250 process_crypto: Received offer with crypto line for media stream that is not enabled
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (video) SDP a=rtcp-fb:* ccm tmmbr... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: chan_sip.c:34250 process_crypto: Received offer with crypto line for media stream that is not enabled
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (video) SDP a=rtcp-fb:96 nack pli... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: chan_sip.c:34250 process_crypto: Received offer with crypto line for media stream that is not enabled
 DEBUG[4724][C-0000000d]: chan_sip.c:10844 process_sdp: Processing media-level (video) SDP a=rtcp-fb:96 ccm fir... UNSUPPORTED OR FAILED.
 DEBUG[4724][C-0000000d]: rtp_engine.c:1283 ast_rtp_codecs_payloads_xover: Crossover copying tx to rx payload mapping 0 (0x1e7aaf8) from 0x7fceb5edc1a0 to 0x7fceb5edc1a0
 DEBUG[4724][C-0000000d]: rtp_engine.c:1283 ast_rtp_codecs_payloads_xover: Crossover copying tx to rx payload mapping 8 (0x1e7ac48) from 0x7fceb5edc1a0 to 0x7fceb5edc1a0
 DEBUG[4724][C-0000000d]: rtp_engine.c:1283 ast_rtp_codecs_payloads_xover: Crossover copying tx to rx payload mapping 9 (0x1e7af38) from 0x7fceb5edc1a0 to 0x7fceb5edc1a0
 DEBUG[4724][C-0000000d]: rtp_engine.c:1283 ast_rtp_codecs_payloads_xover: Crossover copying tx to rx payload mapping 101 (0x7fcf080391e8) from 0x7fceb5edc1a0 to 0x7fceb5edc1a0
 DEBUG[4724][C-0000000d]: rtp_engine.c:1283 ast_rtp_codecs_payloads_xover: Crossover copying tx to rx payload mapping 96 (0x7fcf0803a118) from 0x7fceb5edc120 to 0x7fceb5edc120
Capabilities: us - (g722|ulaw|alaw), peer - audio=(ulaw|alaw|g722)/video=(h264)/text=(nothing), combined - (g722|ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
 DEBUG[4724][C-0000000d]: acl.c:990 ast_ouraddrfor: For destination '192.168.1.6', our source address is '192.168.1.101'.
 DEBUG[4724][C-0000000d]: res_rtp_asterisk.c:7866 ast_rtp_remote_address_set: Setting RTCP address on RTP instance '0x7fcf08015310'
       > 0x7fcf08047d70 -- Strict RTP learning after remote address set to: 192.168.1.6:7246
Peer audio RTP is at port 192.168.1.6:7246
 DEBUG[4724][C-0000000d]: rtp_engine.c:1120 rtp_codecs_payloads_copy_rx: Copying rx payload mapping 0 (0x1e7aaf8) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1120 rtp_codecs_payloads_copy_rx: Copying rx payload mapping 8 (0x1e7ac48) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1120 rtp_codecs_payloads_copy_rx: Copying rx payload mapping 9 (0x1e7af38) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1120 rtp_codecs_payloads_copy_rx: Copying rx payload mapping 101 (0x7fcf080391e8) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1205 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 0 (0x1e7aaf8) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1205 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 8 (0x1e7ac48) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1205 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 9 (0x1e7af38) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: rtp_engine.c:1205 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 101 (0x7fcf080391e8) from 0x7fceb5edc1a0 to 0x7fcf080154e8
 DEBUG[4724][C-0000000d]: res_rtp_asterisk.c:7682 ast_rtp_prop_set: Ignoring duplicate RTCP property on RTP instance '0x7fcf08015310'
 DEBUG[4724][C-0000000d]: chan_sip.c:11158 process_sdp: We're settling with these formats: (g722|ulaw|alaw)
 DEBUG[4724][C-0000000d]: chan_sip.c:26653 handle_request_invite: Checking SIP call limits for device 4001
 DEBUG[4724][C-0000000d]: chan_sip.c:6816 update_call_counter: Updating call counter for incoming call
 DEBUG[4724][C-0000000d]: chan_sip.c:6921 update_call_counter: Call from peer '4001' is 1 out of 90
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
 DEBUG[4724][C-0000000d]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '192.168.1.101' into...
 DEBUG[4724][C-0000000d]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '192.168.1.101' and port ''.
Looking for 4002 in pushkit (domain 192.168.1.101)
 DEBUG[4724][C-0000000d]: stasis.c:570 stasis_topic_create_with_detail: Creating topic. name: channel:1638460586.24, detail:
 DEBUG[4724][C-0000000d]: stasis.c:604 stasis_topic_create_with_detail: Topic 'channel:1638460586.24': 0x7fcf0803ba70 created
 DEBUG[4724][C-0000000d]: stasis.c:570 stasis_topic_create_with_detail: Creating topic. name: cache:101/channel:1638460586.24, detail:
 DEBUG[4724][C-0000000d]: stasis.c:604 stasis_topic_create_with_detail: Topic 'cache:101/channel:1638460586.24': 0x7fcf0803b7f0 created
 DEBUG[4724][C-0000000d]: channel.c:989 __ast_channel_alloc_ap: Channel 0x7fcf08094c80 'SIP/4001-00000012' allocated
 DEBUG[4724][C-0000000d]: chan_sip.c:8213 sip_new: *** Our native formats are (g722)
 DEBUG[4724][C-0000000d]: chan_sip.c:8214 sip_new: *** Joint capabilities are (g722|ulaw|alaw)
 DEBUG[4724][C-0000000d]: chan_sip.c:8215 sip_new: *** Our capabilities are (g722|ulaw|alaw)
 DEBUG[4724][C-0000000d]: chan_sip.c:8216 sip_new: *** AST_CODEC_CHOOSE formats are g722
 DEBUG[4724][C-0000000d]: chan_sip.c:8249 sip_new: This channel will not be able to handle video.
sip_route_dump: route/path hop: <sip:4001@192.168.1.6:49857;transport=udp>
 DEBUG[4724][C-0000000d]: chan_sip.c:26858 handle_request_invite: SIP/4001-00000012: New call is still down.... Trying...

<--- Transmitting (NAT) to 192.168.1.6:49857 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.cIT1aPyXV;received=192.168.1.6;rport=49857
From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
To: "unknown" <sip:4002@192.168.1.101>
Call-ID: 8UDyu69vXw
CSeq: 21 INVITE
Server: FPBX-15.0.16.72(13.32.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:4002@192.168.1.101:5060>
Content-Length: 0


<------------>
 DEBUG[4724][C-0000000d]: chan_sip.c:3801 __sip_xmit: Trying to put 'SIP/2.0 100' onto UDP socket destined for 192.168.1.6:49857
 DEBUG[4651]: devicestate.c:361 _ast_device_state: No provider found, checking channel drivers for SIP - 4001
 DEBUG[4651]: chan_sip.c:30618 sip_devicestate: Checking device state for peer 4001
 DEBUG[4651]: devicestate.c:466 do_state_change: Changing state for SIP/4001 - state 2 (In use)
 DEBUG[4651]: devicestate.c:361 _ast_device_state: No provider found, checking channel drivers for SIP - 4001
 DEBUG[4651]: chan_sip.c:30618 sip_devicestate: Checking device state for peer 4001
 DEBUG[4651]: devicestate.c:466 do_state_change: Changing state for SIP/4001 - state 2 (In use)
 DEBUG[4770]: app_queue.c:2600 device_state_cb: Device 'SIP/4001' changed to state '2' (In use) but we don't care because they're not a member of any queue.
 DEBUG[28108]: manager.c:6118 match_filter: Examining AMI event:



 DEBUG[28108]: manager.c:6118 match_filter: Examining AMI event:
Event: VarSet
Privilege: dialplan,all
Channel: SIP/4001-00000012
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: 4001
CallerIDName: SeM 4001
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: pushkit
Exten: 4002
Priority: 1
Uniqueid: 1638460586.24
Linkedid: 1638460586.24
Variable: SIPCALLID
Value: 8UDyu69vXw



 DEBUG[28108]: manager.c:6118 match_filter: Examining AMI event:
Event: DeviceStateChange
Privilege: call,all
Device: SIP/4001
State: INUSE


 DEBUG[4667]: res_odbc.c:974 _ast_odbc_request_obj2: Reusing ODBC handle 0x7fcef00d1fb0 from class 'asteriskcdrdb'
 DEBUG[4667]: cel_odbc.c:781 odbc_log: Executing SQL statement: [INSERT INTO cel (eventtype, eventtime, cid_name, cid_num, cid_ani, cid_rdnis, cid_dnid, exten, context, channame, appname, appdata, amaflags, accountcode, uniqueid, linkedid, peer, userdeftype, extra) VALUES ('CHAN_START', {ts '2021-12-02 10:56:26.604374'}, 'SeM 4001', '4001', '', '', '', '4002', 'pushkit', 'SIP/4001-00000012', '', '', 3, '', '1638460586.24', '1638460586.24', '', '', '')]
 DEBUG[10732][C-0000000d]: pbx.c:2933 pbx_extension_helper: Launching 'Progress'
    -- Executing [4002@pushkit:1] Progress("SIP/4001-00000012", "") in new stack
 DEBUG[10732][C-0000000d]: chan_sip.c:13585 add_sdp: ** Our capability: (g722|ulaw|alaw) Video flag: False Text flag: True
 DEBUG[10732][C-0000000d]: chan_sip.c:13586 add_sdp: ** Our prefcodec: (nothing)
Audio is at 16204
Adding codec g722 to SDP
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
 DEBUG[10732][C-0000000d]: chan_sip.c:13757 add_sdp: -- Done with adding codecs to SDP
 DEBUG[10732][C-0000000d]: chan_sip.c:13782 add_sdp: Setting framing on incoming call: 20
 DEBUG[10732][C-0000000d]: chan_sip.c:13976 add_sdp: Done building SDP. Settling with this capability: (g722|ulaw|alaw)

<--- Transmitting (NAT) to 192.168.1.6:49857 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.cIT1aPyXV;received=192.168.1.6;rport=49857
From: "Caller_4001" <sip:4001@192.168.1.101>;tag=eBdgQclti
To: "unknown" <sip:4002@192.168.1.101>;tag=as28609f10
Call-ID: 8UDyu69vXw
CSeq: 21 INVITE
Server: FPBX-15.0.16.72(13.32.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:4002@192.168.1.101:5060>
Content-Type: application/sdp
Content-Length: 323

v=0
o=root 1164848289 1164848289 IN IP4 192.168.1.101
s=Asterisk PBX 16.6.2
c=IN IP4 192.168.1.101
t=0 0
m=audio 16204 RTP/AVP 9 0 8 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
m=video 0 RTP/AVP 96

<------------>
 DEBUG[10732][C-0000000d]: chan_sip.c:3801 __sip_xmit: Trying to put 'SIP/2.0 183' onto UDP socket destined for 192.168.1.6:49857


 DEBUG[4667]: res_odbc.c:817 ast_odbc_release_obj: Releasing ODBC handle 0x7fcef00d1fb0 into pool
 DEBUG[10732][C-0000000d]: pbx_variables.c:772 pbx_substitute_variables_helper_full: Function SIP_HEADER(Call-ID) result is '8UDyu69vXw'
 DEBUG[10732][C-0000000d]: pbx.c:2933 pbx_extension_helper: Launching 'Verbose'
    -- Executing [4002@pushkit:2] Verbose("SIP/4001-00000012", "1,8UDyu69vXw") in new stack
 8UDyu69vXw
 DEBUG[10732][C-0000000d]: pbx_variables.c:379 ast_str_retrieve_variable: Result of 'EXTEN' is '4002'
 DEBUG[10732][C-0000000d]: pbx.c:2933 pbx_extension_helper: Launching 'Dial'
    -- Executing [4002@pushkit:3] Dial("SIP/4001-00000012", "SIP/4002,120") in new stack



Please explain the terms long and short call-id. There is only one call ID for a call and it should be treated as an opaque, string which is highly likely to be unique in space and time.

Although it is suggested to use a domain name, that is to help achieve uniqueness. There is no requirement to do so, and, in practice, there is no requirement that it be the domain name of the originating system (e.g. one could envisage a site site with a central call-Id generating server.

Hi David and thanks for the quick reply.

I am getting this Call-ID:
chan_sip.c:9937 parse_request: Header 5 [ 19]: Call-ID: 8UDyu69vXw

But I need this Call-ID:
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request: Header 6 [ 60]: Call-ID: 50922f2862a56d571b0acf6357648e56@192.168.1.101:5060

There was a post in another forum stating the code below could be used to get the long Call-ID from the SIP_HEADER

exten => _400X,1,Progress(); Matching: 4000-4009
same => n,Verbose(1,${SIP_HEADER(Call-ID)})
same => n,Dial(SIP/${EXTEN},120)
The result they show is:
[Nov 16 13:30:53] – Executing [4002@pushkit:2] Verbose(“SIP/1001-00000025”, “1,66808104975DC321@192.168.188.1”) in new stack
[Nov 16 13:30:53] 66808104975DC321@192.168.1.101

I tried to use that piece of dialplan in Asterisk 13 and 16 and always got the short Call-ID.

Below is some context for the Call-IDs:

chan_sip.c:9937 parse_request:  Header  0 [ 37]: INVITE sip:4002@192.168.1.101 SIP/2.0
chan_sip.c:9937 parse_request:  Header  1 [ 65]: Via: SIP/2.0/UDP 192.168.1.6:49857;branch=z9hG4bK.ulW15YawC;rport
chan_sip.c:9937 parse_request:  Header  2 [ 61]: From: "Caller_4001" sip:4001@192.168.1.101;tag=eBdgQclti
chan_sip.c:9937 parse_request:  Header  3 [ 38]: To: "unknown" sip:4002@192.168.1.101  
chan_sip.c:9937 parse_request:  Header  4 [ 15]: CSeq: 20 INVITE
chan_sip.c:9937 parse_request:  Header  5 [ 19]: Call-ID: 8UDyu69vXw
chan_sip.c:9937 parse_request:  Header  6 [ 16]: Max-Forwards: 70
chan_sip.c:9937 parse_request:  Header  7 [ 35]: Supported: replaces, outbound, gruu
chan_sip.c:9937 parse_request:  Header  8 [ 89]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
chan_sip.c:9937 parse_request:  Header  9 [ 29]: Content-Type: application/sdp
chan_sip.c:9937 parse_request:  Header 10 [ 19]: Content-Length: 445
chan_sip.c:9937 parse_request:  Header 11 [155]: Contact: sip:4001@192.168.1.6:49857;transport=udp;expires=3600;+sip.instance="<urn:uuid:df394ec3-6559-4069-8b7a-8bf469e17dff>";+org.linphone.specs="lime"
chan_sip.c:9937 parse_request:  Header 12 [ 37]: User-Agent: Unknown (belle-sip/4.4.0)
chan_sip.c:9937 parse_request:  Header 13 [  0]:

But, I need the one below:


DEBUG[10732][C-0000000d]: chan_sip.c:13757 add_sdp: -- Done with adding codecs to SDP
DEBUG[10732][C-0000000d]: chan_sip.c:13976 add_sdp: Done building SDP. Settling with this capability: (g722|ulaw|alaw)
DEBUG[10732][C-0000000d]: chan_sip.c:3444 initialize_initreq: Initializing initreq for method INVITE - callid 50922f2862a56d571b0acf6357648e56@192.168.1.101:5060
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  0 [ 56]: INVITE sip:4002@192.168.1.50:54270;transport=udp SIP/2.0
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  1 [ 64]: Via: SIP/2.0/UDP 192.168.1.101:5060;branch=z9hG4bK5ce33061;rport
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  2 [ 16]: Max-Forwards: 70
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  3 [ 56]: From: "SeM 4001" <sip:4001@192.168.1.101>;tag=as4f7d70e8
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  4 [ 47]: To: <sip:4002@192.168.1.50:54270;transport=udp>
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  5 [ 38]: Contact: <sip:4001@192.168.1.101:5060>
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  6 [ 60]: Call-ID: 50922f2862a56d571b0acf6357648e56@192.168.1.101:5060
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  7 [ 16]: CSeq: 102 INVITE
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  8 [ 36]: User-Agent: FPBX-15.0.16.72(13.32.0)
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  9 [ 35]: Date: Thu, 02 Dec 2021 15:56:26 GMT
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header 10 [ 90]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header 11 [ 26]: Supported: replaces, timer
DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header 12 [ 29]: Content-Type: application/sdp

You haven’t explained the significant difference between the two. You can’t possibly expect the exact content of the Call-ID as that is unique for every call and decided by the caller.

In any case the format of the call-ID is determined by the caller, and Asterisk is correctly reporting what it receives, so any change must be achieved by requesting the managers of the calling system to change what it sends, which may well mean using different software or different black box systems, e.g. they should replace Belle-SIP with Asterisk.

I think what they actually want is the Call-ID of the OUTGOING call leg, which is generated by Asterisk.

Maybe. I got confused because it seems to use the parse request routine on the request it has constructed, as well as the incoming request, so I assumed both were incoming.

Is the outgoing leg call-id actually exposed? If it is exposed, you would have to run the code on the outgoing channel, after the INVITE was sent, which would, probably, have to be in a Dial U option subroutine.

This sounds like another recent question. Is it a continuation?

I am getting this Call-ID:

chan_sip.c:9937 parse_request:  Header  5 [ 19]: Call-ID: 8UDyu69vXw

But need this Call-ID:

DEBUG[10732][C-0000000d]: chan_sip.c:9937 parse_request:  Header  6 [ 60]: Call-ID: 50922f2862a56d571b0acf6357648e56@192.168.1.101:5060

In another forum someone posted that using this piece of dialplan gets them the long Call-ID, but when I use it I only get the short Call-ID.

This is their code:
exten => _40XX,1,Progress(); Matching: 4000 - 4099
same => n,Verbose(1,${SIP_HEADER(Call-ID)})
same => n,Dial(SIP/${EXTEN},120)

And they say it returns this long Call-ID for them.
;[Nov 16 13:30:53] – Executing [1000@osmc:2] Verbose(“SIP/1001-00000025”, “1,66808104975DC321@192.168.188.1”) in new stack
;[Nov 16 13:30:53] 66808104975DC321@192.168.188.1

Repeating the question unchanged won’t get you better answers and suggests that you won’t understand any answers provided.

Sorry if I repeated the question, was there an answer and I missed it?

I am trying to get the long Call-ID from the INVITE Header. Is that possible?

The answer was basically that the question was confused, because you don’t seem to understand the nature of call IDs, and that the length and structure of call-IDs is determined by the equipment that allocates them. It included speculation on what you really wanted, and an, untested, possible, approach to meeting that requirement.

sdavis_TalonX

there is no such thing as a long/short Call-ID, only requirement of Call-ID is that is has to be unique
and Call-ID is determined by the one that send the INVITE
some systems generate a unique string that is shorter and others a longer one, that is something you have control over
so the only question is do you want the incoming or outgoing Call-ID

exten => _40XX,1,Progress(); Matching: 4000 - 4099
same => n,NoOP(${SIP_HEADER(Call-ID)}) ;INCOMING
same => n,Dial(SIP/${EXTEN},120, b(Dial_Handler^${EXTEN}^1))

[Dial_Handler]
exten _X!,1,DumpChan()
same => n,NoOP(${SIP_HEADER(Call-ID)}) ; OUTGOING
same => n,Return()

Have you tried this, as, to me, “before initiating the outgoing call” means before the outgoing call ID (always assuming the call will be SIP) has been allocated.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.