Hi Stewart and Tom,
When I use
exten => s,n,SipAddHeader(P-Asserted-Identity: "anonymous" (sip:${CALLERID(num)}@PBX_IP))
or if I try to use
exten => s,n,SipAddHeader(P-Asserted-Identity: "anonymous" sip:${IAXVAR(X-OUTBOUND-CID)}@PBX_IP)
the call doesnt happen, here are the logs when using
exten => s,n,SipAddHeader(P-Asserted-Identity: "anonymous" (sip:${CALLERID(num)}@PBX_IP))
[root@PBXname ~]# asterisk -r
Asterisk 13.22.0, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 13.22.0 currently running on PBXname (pid = 10520)
PBXname*CLI> sip set debug on
SIP Debugging re-enabled
<--- SIP read from UDP:phone_public_IP:50628 --->
<------------->
<--- SIP read from UDP:phone_public_IP:50628 --->
INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 10.10.20.100:5060;branch=z9hG4bK764587136
From: "4000" <sip:[email protected]:5160>;tag=2093903271
To: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 1 INVITE
Contact: <sip:[email protected]:5060>
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50
Allow-Events: talk,hold,conference,refer,check-sync
Supported: replaces
Content-Length: 306
v=0
o=- 20072 20072 IN IP4 10.10.20.100
s=SDP data
c=IN IP4 10.10.20.100
t=0 0
m=audio 11894 RTP/AVP 9 0 8 18 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=ptime:20
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
--- (14 headers 15 lines) ---
Sending to phone_public_IP:50628 (NAT)
Sending to phone_public_IP:50628 (NAT)
Using INVITE request as basis request - [email protected]
Found peer '4000' for '4000' from phone_public_IP:50628
<--- Reliably Transmitting (NAT) to phone_public_IP:50628 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.10.20.100:5060;branch=z9hG4bK764587136;received=phone_public_IP;rport=50628
From: "4000" <sip:[email protected]:5160>;tag=2093903271
To: <sip:[email protected]:5160>;tag=as060dfaed
Call-ID: [email protected]
CSeq: 1 INVITE
Server: FPBX-14.0.13.4(13.22.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="12a9189f"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '[email protected]' in 6400 ms (Method: INVITE)
<--- SIP read from UDP:phone_public_IP:50628 --->
ACK sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 10.10.20.100:5060;branch=z9hG4bK764587136
From: "4000" <sip:[email protected]:5160>;tag=2093903271
To: <sip:[email protected]:5160>;tag=as060dfaed
Call-ID: [email protected]
CSeq: 1 ACK
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---
<--- SIP read from UDP:phone_public_IP:50628 --->
INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 10.10.20.100:5060;branch=z9hG4bK4045341704
From: "4000" <sip:[email protected]:5160>;tag=2093903271
To: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 2 INVITE
Contact: <sip:[email protected]:5060>
Authorization: Digest username="4000", realm="asterisk", nonce="12a9189f", uri="sip:[email protected]:5160", response="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50
Allow-Events: talk,hold,conference,refer,check-sync
Supported: replaces
Content-Length: 306
v=0
o=- 20072 20072 IN IP4 10.10.20.100
s=SDP data
c=IN IP4 10.10.20.100
t=0 0
m=audio 11894 RTP/AVP 9 0 8 18 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=ptime:20
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
--- (15 headers 15 lines) ---
Sending to phone_public_IP:50628 (NAT)
Using INVITE request as basis request - [email protected]
Found peer '4000' for '4000' from phone_public_IP:50628
Found RTP audio format 9
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 101
Found audio description format G722 for ID 9
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|g726|g722), peer - audio=(ulaw|alaw|g722|g729)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.10.20.100:11894
Looking for 141078XXXXXXXX in from-internal (domain PBXname.domain.co.uk)
sip_route_dump: route/path hop: <sip:[email protected]:5060>
<--- Transmitting (NAT) to phone_public_IP:50628 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.10.20.100:5060;branch=z9hG4bK4045341704;received=phone_public_IP;rport=50628
From: "4000" <sip:[email protected]:5160>;tag=2093903271
To: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 2 INVITE
Server: FPBX-14.0.13.4(13.22.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:141078XXXXXXXX@PBX_IP:5160>
Content-Length: 0
<------------>
Audio is at 18970
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g726 to SDP
Adding codec g722 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to VOIP_PROVIDER_IP:5060:
INVITE sip:078XXXXXXXX@VOIP_PROVIDER_IP SIP/2.0
Via: SIP/2.0/UDP PBX_IP:5160;branch=z9hG4bK5305f273;rport
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@PBX_IP:5160>;tag=as3a122d80
To: <sip:078XXXXXXXX@VOIP_PROVIDER_IP>
Contact: <sip:anonymous@PBX_IP:5160>
Call-ID: 4189fdd36bf2a7c0700b5c394d81e0f2@PBX_IP
CSeq: 102 INVITE
User-Agent: FPBX-14.0.13.4(13.22.0)
Date: Wed, 23 Oct 2019 07:38:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Privacy: id
P-Asserted-Identity: "anonymous" (sip:@PBX_IP)
Content-Type: application/sdp
Content-Length: 352
v=0
o=root 406134749 406134749 IN IP4 PBX_IP
s=Asterisk PBX 13.22.0
c=IN IP4 PBX_IP
t=0 0
m=audio 18970 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
---
<--- SIP read from UDP:VOIP_PROVIDER_IP:5060 --->
SIP/2.0 400 Bad Request
Via: SIP/2.0/UDP PBX_IP:5160;branch=z9hG4bK5305f273;rport
From: "Anonymous" <sip:anonymous@PBX_IP:5160>;tag=as3a122d80
Call-ID: 4189fdd36bf2a7c0700b5c394d81e0f2@PBX_IP
CSeq: 102 INVITE
To: <sip:078XXXXXXXX@VOIP_PROVIDER_IP>;tag=3780805117-1728066432
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---