Asterisk 16 PJSIP attended transfer fails with NAT

When doing an attended transfer between 3 Yealink handsets all registered to the same Asterisk 16.5.1 instance, the transfer fails with the following CLI message:

ERROR[2052]: res_pjsip_refer.c:822 refer_incoming_attended_request: Received REFER for remote session on channel ‘PJSIP/114-00000200’ from endpoint ‘114’ but ‘external_replaces’ extension not found in context xxxxxx

I know that the external_replaces extension is missing, but it shouldn’t be required as this is a local transfer.

I’m assuming that something (to do with the NAT) has confused PJSIP and it thinks it’s an external transfer.

The actual flow is this (step 4 fails)

  1. Handset-A dials and connects to Handset-B
  2. Handset-A initiates a transfer to Handset-C (effectively putting B on hold and dialing C)
  3. Handset-A connects to Handset-C
  4. Handset-A attempts to complete the transfer (B & C should connect and A should hangup)

When I do the same test with all the phones and asterisk on the same network the attended transfer completes as expected.

I should also point out that the system is in every other way working as expected.

The problem configuration is this:
Phones all on one network behind NAT.
Asterisk is in AWS - so one to one NAT.

I’ve done some global search and replaces replacing the actual IP addresses with labels like x.x.public.serverIP

FYI: I can’t just cut and paste configs due to running Realtime.

pjsip.conf

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0
; NAT settings
local_net=172.31.0.0/20
external_media_address=x.x.public.serverIP
external_signaling_address=x.x.public.serverIP
symmetric_transport=yes

Typical EndPoint config

pjsip show endpoint (cut down)
accept_multiple_sdp_answers : false
allow : (alaw)
allow_overlap : true
allow_subscribe : true
allow_transfer : true
connected_line_method : invite
device_state_busy_at : 2
direct_media : false
direct_media_glare_mitigation : none
direct_media_method : invite
disable_direct_media_on_nat : false
follow_early_media_fork : true
force_avp : false
force_rport : true
from_domain : x.x.public.serverIP
from_user :
ice_support : true
max_audio_streams : 1
max_video_streams : 1
media_address :
media_encryption : no
media_encryption_optimistic : false
media_use_received_transport : false
notify_early_inuse_ringing : false
outbound_proxy :
refer_blind_progress : true
rewrite_contact : true
rpid_immediate : false
rtp_symmetric : true
send_connected_line : yes
send_diversion : true
transport : transport-udp-nat

(for my personal reference file is pcap-attend30)

SIP Dialog trying to complete the attended transfer…

I had to insert a space before the @ symbols and also a space after the ? in the Refer-To so I could post as the forum thought they we’re hyper links!

Session Initiation Protocol (REFER)
Request-Line: REFER sip:asterisk@x.x.public.serverIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIp:41028;branch=z9hG4bK180347574
From: <sip:113 @x.x.public.officeIp>;tag=1963616130
To: <sip:275 @x.x.public.serverIP>;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 3 REFER
Contact: <sip:113 @x.x.public.officeIp:41028>
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50
Refer-To: <sip:x.x.public.serverIP:5060? Replaces=0_2540107197%40x.x.public.officeIp%3Bto-tag%3D9c7da449-b595-41eb-a273-092f4994ebd5%3Bfrom-tag%3D4249554357>
Event: refer
Referred-By: <sip:113 @x.x.public.officeIp>
Content-Length: 0

Session Initiation Protocol (202)
Status-Line: SIP/2.0 202 Accepted
Message Header
Via: SIP/2.0/UDP x.x.public.officeIp:41028;rport=41028;received=x.x.public.officeIp;branch=z9hG4bK180347574
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
From: <sip:113 @x.x.public.officeIp>;tag=1963616130
To: <sip:275 @x.x.public.serverIP>;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
CSeq: 3 REFER
Expires: 600
Contact: <sip:asterisk @x.x.public.serverIP:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Server: Asterisk PBX 16.5.1
Content-Length: 0

Session Initiation Protocol (NOTIFY)
Request-Line: NOTIFY sip:113@x.x.public.officeIp:41028 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.serverIP:5060;rport;branch=z9hG4bKPj6691b94d-48ac-4a5f-8c5c-d5ae5184122d
From: <sip:275 @x.x.public.serverIP>;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
To: <sip:113 @x.x.public.officeIp>;tag=1963616130
Contact: <sip:asterisk @x.x.public.serverIP:5060>
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2290 NOTIFY
Event: refer
Subscription-State: active;expires=600
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1
Content-Type: message/sipfrag;version=2.0
Content-Length: 20
Message Body

Session Initiation Protocol (NOTIFY)
Request-Line: NOTIFY sip:113@x.x.public.officeIp:41028 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.serverIP:5060;rport;branch=z9hG4bKPj45050282-e6f8-4488-83c1-215c97307c5b
From: <sip:275 @x.x.public.serverIP>;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
To: <sip:113 @x.x.public.officeIp>;tag=1963616130
Contact: <sip:asterisk @x.x.public.serverIP:5060>
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2291 NOTIFY
Event: refer
Subscription-State: terminated;reason=noresource
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1
Content-Type: message/sipfrag;version=2.0
Content-Length: 23
Message Body

Do you have a device doing SIP ALG (modifying the SIP traffic) where the phones are? The only reason you’d end up seeing such a message is if the Replaces part of the Refer-To header has a call-id, to tag, and from tag that isn’t on the local system which could happen if a SIP ALG modified it for example.

An actual full SIP trace of all legs would really be needed to see the full interaction.

I don’t believe there is any SIP ALG in the office (I’m still awaiting confirmation on that from our network manager).

Here is the full SIP trace (I’d uploaded but the forum won’t let me) …

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:113@pbx-FQDN:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;branch=z9hG4bK866816097
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN
Call-ID: 371793700@10.14.0.29
CSeq: 1 INVITE
Contact: sip:275@x.x.public.officeIP:41542
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-T28P 2.72.0.1
Supported: replaces
Allow-Events: talk,hold,conference,refer,check-sync

Session Initiation Protocol (401)
Status-Line: SIP/2.0 401 Unauthorized
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;rport=41542;received=x.x.public.officeIP;branch=z9hG4bK866816097
Call-ID: 371793700@10.14.0.29
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN;tag=z9hG4bK866816097
CSeq: 1 INVITE
Server: Asterisk PBX 16.5.1

Session Initiation Protocol (ACK)
Request-Line: ACK sip:113@pbx-FQDN:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;branch=z9hG4bK866816097
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN;tag=z9hG4bK866816097
Call-ID: 371793700@10.14.0.29
CSeq: 1 ACK

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:113@pbx-FQDN:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;branch=z9hG4bK1883670424
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN
Call-ID: 371793700@10.14.0.29
CSeq: 2 INVITE
Contact: sip:275@x.x.public.officeIP:41542
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-T28P 2.72.0.1
Supported: replaces
Allow-Events: talk,hold,conference,refer,check-sync

Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 Trying
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;rport=41542;received=x.x.public.officeIP;branch=z9hG4bK1883670424
Call-ID: 371793700@10.14.0.29
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN
CSeq: 2 INVITE
Server: Asterisk PBX 16.5.1

Session Initiation Protocol (183)
Status-Line: SIP/2.0 183 Session Progress
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;rport=41542;received=x.x.public.officeIP;branch=z9hG4bK1883670424
Call-ID: 371793700@10.14.0.29
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN;tag=29c7cb7a-f6ca-48bd-a54c-483dfeab078d
CSeq: 2 INVITE
Server: Asterisk PBX 16.5.1
Contact: sip:x.x.public.pbxIP:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Content-Type: application/sdp

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;rport=41542;received=x.x.public.officeIP;branch=z9hG4bK1883670424
Call-ID: 371793700@10.14.0.29
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN;tag=29c7cb7a-f6ca-48bd-a54c-483dfeab078d
CSeq: 2 INVITE
Server: Asterisk PBX 16.5.1
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Contact: sip:x.x.public.pbxIP:5060
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp

Session Initiation Protocol (ACK)
Request-Line: ACK sip:x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41542;branch=z9hG4bK2084933728
From: “275” sip:275@pbx-FQDN;tag=1754937046
To: sip:113@pbx-FQDN;tag=29c7cb7a-f6ca-48bd-a54c-483dfeab078d
Call-ID: 371793700@10.14.0.29
CSeq: 2 ACK
Contact: sip:275@x.x.public.officeIP:41542
Max-Forwards: 70
User-Agent: Yealink SIP-T28P 2.72.0.1

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:asterisk@x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK1499179165
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2 INVITE
Contact: sip:113@x.x.public.officeIP:41028
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

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK1499179165
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
CSeq: 2 INVITE
Contact: sip:asterisk@x.x.public.pbxIP:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Server: Asterisk PBX 16.5.1
Content-Type: application/sdp

Session Initiation Protocol (ACK)
Request-Line: ACK sip:asterisk@x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK2480822357
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2 ACK
Contact: sip:113@x.x.public.officeIP:41028
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:114@pbx-FQDN:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK242547821
From: “113” sip:113@pbx-FQDN:5060;tag=4249554357
To: sip:114@pbx-FQDN:5060
Call-ID: 0_2540107197@10.14.0.25
CSeq: 1 INVITE
Contact: sip:113@x.x.public.officeIP:41028
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

Session Initiation Protocol (401)
Status-Line: SIP/2.0 401 Unauthorized
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK242547821
Call-ID: 0_2540107197@10.14.0.25
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=z9hG4bK242547821
CSeq: 1 INVITE
Server: Asterisk PBX 16.5.1

Session Initiation Protocol (ACK)
Request-Line: ACK sip:114@pbx-FQDN:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK242547821
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=z9hG4bK242547821
Call-ID: 0_2540107197@10.14.0.25
CSeq: 1 ACK

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:114@pbx-FQDN:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK3722581292
From: “113” sip:113@pbx-FQDN:5060;tag=4249554357
To: sip:114@pbx-FQDN:5060
Call-ID: 0_2540107197@10.14.0.25
CSeq: 2 INVITE
Contact: sip:113@x.x.public.officeIP:41028
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

Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 Trying
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK3722581292
Call-ID: 0_2540107197@10.14.0.25
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN
CSeq: 2 INVITE
Server: Asterisk PBX 16.5.1

Session Initiation Protocol (183)
Status-Line: SIP/2.0 183 Session Progress
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK3722581292
Call-ID: 0_2540107197@10.14.0.25
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
CSeq: 2 INVITE
Server: Asterisk PBX 16.5.1
Contact: sip:x.x.public.pbxIP:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Content-Type: application/sdp

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK3722581292
Call-ID: 0_2540107197@10.14.0.25
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
CSeq: 2 INVITE
Server: Asterisk PBX 16.5.1
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Contact: sip:x.x.public.pbxIP:5060
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp

Session Initiation Protocol (ACK)
Request-Line: ACK sip:x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK4176658162
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
Call-ID: 0_2540107197@10.14.0.25
CSeq: 2 ACK
Contact: sip:113@x.x.public.officeIP:41028
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:114@x.x.public.officeIP:39878 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjd9802fb5-17b8-4a62-8c23-7a633f82d9c9
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP
Contact: sip:asterisk@x.x.public.pbxIP:5060
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28168 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Call-Info:
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1
Content-Type: application/sdp

Session Initiation Protocol (UPDATE)
Request-Line: UPDATE sip:113@x.x.public.officeIP:41028 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjac10df92-42c1-46be-a1e4-440f7abb6e45
From: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
To: “113” sip:113@pbx-FQDN;tag=4249554357
Contact: sip:x.x.public.pbxIP:5060
Call-ID: 0_2540107197@10.14.0.25
CSeq: 16757 UPDATE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: sip:114@pbx-FQDN
Remote-Party-ID: sip:114@pbx-FQDN;party=called;privacy=off;screen=no
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1

Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 Trying
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjd9802fb5-17b8-4a62-8c23-7a633f82d9c9
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28168 INVITE
User-Agent: Yealink SIP-T28P 2.73.193.50

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport=5060;branch=z9hG4bKPjac10df92-42c1-46be-a1e4-440f7abb6e45
From: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
To: “113” sip:113@pbx-FQDN;tag=4249554357
Call-ID: 0_2540107197@10.14.0.25
CSeq: 16757 UPDATE
Contact: sip:113@x.x.public.officeIP:41028
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (180)
Status-Line: SIP/2.0 180 Ringing
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjd9802fb5-17b8-4a62-8c23-7a633f82d9c9
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP;tag=3338905157
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28168 INVITE
Contact: sip:114@x.x.public.officeIP:39878
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
User-Agent: Yealink SIP-T28P 2.73.193.50
Allow-Events: talk,hold,conference,refer,check-sync

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjd9802fb5-17b8-4a62-8c23-7a633f82d9c9
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP;tag=3338905157
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28168 INVITE
Contact: sip:114@x.x.public.officeIP:39878
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
User-Agent: Yealink SIP-T28P 2.73.193.50

Session Initiation Protocol (ACK)
Request-Line: ACK sip:114@x.x.public.officeIP:39878 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPj4aa6d2e4-9710-4e6e-afe0-11786b661a6c
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP;tag=3338905157
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28168 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1

Session Initiation Protocol (REFER)
Request-Line: REFER sip:asterisk@x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK180347574
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 3 REFER
Contact: sip:113@x.x.public.officeIP:41028
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50
Refer-To: sip:x.x.public.pbxIP:5060?Replaces=0_2540107197%40x.x.public.officeIP%3Bto-tag%3D9c7da449-b595-41eb-a273-092f4994ebd5%3Bfrom-tag%3D4249554357
Event: refer
Referred-By: sip:113@x.x.public.officeIP

Session Initiation Protocol (202)
Status-Line: SIP/2.0 202 Accepted
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK180347574
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
CSeq: 3 REFER
Expires: 600
Contact: sip:asterisk@x.x.public.pbxIP:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Server: Asterisk PBX 16.5.1

Session Initiation Protocol (NOTIFY)
Request-Line: NOTIFY sip:113@x.x.public.officeIP:41028 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPj6691b94d-48ac-4a5f-8c5c-d5ae5184122d
From: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
To: sip:113@x.x.public.officeIP;tag=1963616130
Contact: sip:asterisk@x.x.public.pbxIP:5060
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2290 NOTIFY
Event: refer
Subscription-State: active;expires=600
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1
Content-Type: message/sipfrag;version=2.0

Session Initiation Protocol (NOTIFY)
Request-Line: NOTIFY sip:113@x.x.public.officeIP:41028 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPj45050282-e6f8-4488-83c1-215c97307c5b
From: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
To: sip:113@x.x.public.officeIP;tag=1963616130
Contact: sip:asterisk@x.x.public.pbxIP:5060
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2291 NOTIFY
Event: refer
Subscription-State: terminated;reason=noresource
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1
Content-Type: message/sipfrag;version=2.0

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport=5060;branch=z9hG4bKPj6691b94d-48ac-4a5f-8c5c-d5ae5184122d
From: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
To: sip:113@x.x.public.officeIP;tag=1963616130
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2290 NOTIFY
Contact: sip:113@x.x.public.officeIP:41028
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport=5060;branch=z9hG4bKPj45050282-e6f8-4488-83c1-215c97307c5b
From: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
To: sip:113@x.x.public.officeIP;tag=1963616130
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 2291 NOTIFY
Contact: sip:113@x.x.public.officeIP:41028
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (BYE)
Request-Line: BYE sip:x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK3262536343
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
Call-ID: 0_2540107197@10.14.0.25
CSeq: 3 BYE
Contact: sip:113@x.x.public.officeIP:41028
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK3262536343
Call-ID: 0_2540107197@10.14.0.25
From: “113” sip:113@pbx-FQDN;tag=4249554357
To: sip:114@pbx-FQDN;tag=9c7da449-b595-41eb-a273-092f4994ebd5
CSeq: 3 BYE
Server: Asterisk PBX 16.5.1

Session Initiation Protocol (BYE)
Request-Line: BYE sip:114@x.x.public.officeIP:39878 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjb67256ea-c616-4143-b426-16634263a859
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP;tag=3338905157
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28169 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk PBX 16.5.1

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.pbxIP:5060;rport;branch=z9hG4bKPjb67256ea-c616-4143-b426-16634263a859
From: “Robert Sutton” sip:113@x.x.public.pbxIP;tag=ab64e926-18d9-4f74-ad09-8652aad99e32
To: sip:114@x.x.public.officeIP;tag=3338905157
Call-ID: 2d12f216-3a9d-4c6a-bf22-431dff63136d
CSeq: 28169 BYE
User-Agent: Yealink SIP-T28P 2.73.193.50

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:asterisk@x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK2255045401
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 4 INVITE
Contact: sip:113@x.x.public.officeIP:41028
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

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK2255045401
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
CSeq: 4 INVITE
Contact: sip:asterisk@x.x.public.pbxIP:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Server: Asterisk PBX 16.5.1
Content-Type: application/sdp

Session Initiation Protocol (ACK)
Request-Line: ACK sip:asterisk@x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK2467535765
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 4 ACK
Contact: sip:113@x.x.public.officeIP:41028
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (BYE)
Request-Line: BYE sip:asterisk@x.x.public.pbxIP:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;branch=z9hG4bK1007374853
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
CSeq: 5 BYE
Contact: sip:113@x.x.public.officeIP:41028
Max-Forwards: 70
User-Agent: Yealink SIP-T42G 29.83.0.50

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP x.x.public.officeIP:41028;rport=41028;received=x.x.public.officeIP;branch=z9hG4bK1007374853
Call-ID: f2ff607e-ac1f-4ddf-931a-1207c0335655
From: sip:113@x.x.public.officeIP;tag=1963616130
To: sip:275@x.x.public.pbxIP;tag=65eddbec-e34c-4a58-97a5-ebb8cc2bbb23
CSeq: 5 BYE
Server: Asterisk PBX 16.5.1

SOLVED!

Thank you.

It turns out ALG was turned on in the router, turning it off solved the problem.

For a little further explanation for those who come after me.

Some of the SIP Call-ID’s contained an internal IP address, and the router was re-writing the CALL-ID in the Refer-To header when it should not have.

0_2540107197 @10.14.0.25 is a SIP CALL-ID and even though it looks like an IP address, it is not and should not be re-written.

So this :

Refer-To: <sip:x.x.public.pbxIP:5060?Replaces=0_2540107197 @10.14.0.25;to-tag=9c7da449-b595-41eb-a273-092f4994ebd5;from-tag=4249554357

was re-written to :

Refer-To: <sip:x.x.public.pbxIP:5060?Replaces=0_2540107197 @x.x.public.officeIP;to-tag=9c7da449-b595-41eb-a273-092f4994ebd5;from-tag=4249554357

Which caused asterisk to consider the transfer to be remote because it did not have any call with a Call-ID of 0_2540107197 @x.x.public.officeIP

I prefer traces inline like this!

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