UserAd
September 11, 2018, 8:04am
1
I have PSJIP endpoint configured for outgoing calls:
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5081
[in]
type = aor
contact = sip:192.168.0.17:5060
[in]
type = identify
endpoint = in
match = 192.168.0.17
[in]
type = endpoint
context = pjsip-queue
disallow = all
allow = ulaw
rtp_symmetric = no
force_rport = no
rewrite_contact = no
connected_line_method=update
direct_media = no
aors = in
disable_direct_media_on_nat=yes
direct_media_method=update
allow_overlap=no
allow_transfer=no
allow_subscribe=no
user_eq_phone=yes
direct_media=no
timers=no
And after call is established asterisk make re-invite to received Contact.
INVITE sip:1-5001@192.168.0.17:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5081;rport;branch=z9hG4bKPjc4dc927a-f974-4f2c-b0d5-f45f18af12d4
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb
To: <sip:1-5001@192.168.0.17>
Contact: <sip:asterisk@192.168.0.20:5081>
Call-ID: 0764993a-ed6f-4ff6-9e0c-24c580f45456
CSeq: 12539 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, replaces, norefersub
Max-Forwards: 70
User-Agent: Asterisk PBX 15.5.0~dfsg-1.1ubuntu4.8
Content-Type: application/sdp
Content-Length: 235
v=0
o=- 871558414 871558414 IN IP4 192.168.0.20
s=Asterisk
c=IN IP4 192.168.0.20
t=0 0
m=audio 13904 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
===================================
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 192.168.0.20:5081;rport=5081;branch=z9hG4bKPjc4dc927a-f974-4f2c-b0d5-f45f18af12d4;received=192.168.0.20
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb
To: <sip:1-5001@192.168.0.17>
Call-ID: 0764993a-ed6f-4ff6-9e0c-24c580f45456
CSeq: 12539 INVITE
Content-Length: 0
===================================
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.20:5081;received=192.168.0.20;rport=5081;branch=z9hG4bKPjc4dc927a-f974-4f2c-b0d5-f45f18af12d4
Record-Route: <sip:192.168.0.17;lr=on;ftag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb>
From: 1234567890 <sip:1234567890@192.168.0.20;user=phone>;tag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb
To: <sip:1-5001@192.168.0.17:5060>;tag=as050d89d3
Call-ID: 0764993a-ed6f-4ff6-9e0c-24c580f45456
CSeq: 12539 INVITE
Server: Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
Contact: <sip:5001@XXX.XXX.XXX.XXX:5060>
Content-Type: application/sdp
Content-Length: 310
Allow: ACK, CANCEL, OPTIONS, BYE
Supported: replaces, timer
v=0
o=root 1693610465 1693610465 IN IP4 XXX.XXX.XXX.XXX
s=Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
c=IN IP4 XXX.XXX.XXX.XXX
t=0 0
m=audio 18850 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv
===================================
ACK sip:5001@XXX.XXX.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5081;rport;branch=z9hG4bKPj159c1807-acf4-4290-a1a5-bd5c452a2e6c
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb
To: <sip:1-5001@192.168.0.17>;tag=as050d89d3
Call-ID: 0764993a-ed6f-4ff6-9e0c-24c580f45456
CSeq: 12539 ACK
Route: <sip:192.168.0.17;lr;ftag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb>
Max-Forwards: 70
User-Agent: Asterisk PBX 15.5.0~dfsg-1.1ubuntu4.8
Content-Length: 0
===================================
INVITE sip:5001@XXX.XXX.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5081;rport;branch=z9hG4bKPjdef70972-15cf-46f8-b8e5-b93d650ce577
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb
To: <sip:1-5001@192.168.0.17>;tag=as050d89d3
Contact: <sip:asterisk@192.168.0.20:5081>
Call-ID: 0764993a-ed6f-4ff6-9e0c-24c580f45456
CSeq: 12540 INVITE
Route: <sip:192.168.0.17;lr;ftag=802ef779-db95-4ec7-bed5-bb8dc4bf4edb>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, replaces, norefersub
Max-Forwards: 70
User-Agent: Asterisk PBX 15.5.0~dfsg-1.1ubuntu4.8
Content-Type: application/sdp
Content-Length: 235
v=0
o=- 871558414 871558415 IN IP4 192.168.0.20
s=Asterisk
c=IN IP4 192.168.0.20
t=0 0
m=audio 13904 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
Is any way to disable this behaviour?
jcolp
September 11, 2018, 9:07am
2
The Asterisk 13.1.0 you are calling seems to be responding with multiple codecs that Asterisk didn’t originally offer. (We asked for ulaw, it answered with ulaw/alaw/gsm which it should not have done). I think the code is doing a re-invite to try to force it back to the original offer, but I’m not certain and there would be no way to disable that - except for allowing the codecs it responded with.
1 Like
UserAd
September 11, 2018, 10:06am
3
I have same results when I lock codecs on both sides to ulaw.
INVITE sip:1-5001@192.168.0.17:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5081;rport;branch=z9hG4bKPj46708e44-fc4d-4d2b-bf34-20384586c848
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c
To: <sip:1-5001@192.168.0.17>
Contact: <sip:asterisk@192.168.0.20:5081>
Call-ID: b3c0b0e6-78a4-4bda-8cda-a14dba82312e
CSeq: 10269 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, replaces, norefersub
Max-Forwards: 70
User-Agent: Asterisk PBX 15.5.0~dfsg-1.1ubuntu4.8
Content-Type: application/sdp
Content-Length: 235
v=0
o=- 209700365 209700365 IN IP4 192.168.0.20
s=Asterisk
c=IN IP4 192.168.0.20
t=0 0
m=audio 12044 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
=======================================
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 192.168.0.20:5081;rport=5081;branch=z9hG4bKPj46708e44-fc4d-4d2b-bf34-20384586c848;received=192.168.0.20
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c
To: <sip:1-5001@192.168.0.17>
Call-ID: b3c0b0e6-78a4-4bda-8cda-a14dba82312e
CSeq: 10269 INVITE
Content-Length: 0
=======================================
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.20:5081;received=192.168.0.20;rport=5081;branch=z9hG4bKPj46708e44-fc4d-4d2b-bf34-20384586c848
Record-Route: <sip:192.168.0.17;lr=on;ftag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c>
From: 1234567890 <sip:1234567890@192.168.0.20;user=phone>;tag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c
To: <sip:1-5001@192.168.0.17:5060>;tag=as52fe5326
Call-ID: b3c0b0e6-78a4-4bda-8cda-a14dba82312e
CSeq: 10269 INVITE
Server: Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
Contact: <sip:5001@XXX.XXX.XXX.XXX:5060>
Content-Type: application/sdp
Content-Length: 273
Allow: ACK, CANCEL, OPTIONS, BYE
Supported: replaces, timer
v=0
o=root 163575941 163575941 IN IP4 XXX.XXX.XXX.XXX
s=Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
c=IN IP4 XXX.XXX.XXX.XXX
t=0 0
m=audio 14768 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
=======================================
ACK sip:5001@XXX.XXX.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5081;rport;branch=z9hG4bKPj705f9185-4163-4914-bdeb-6df68e2ee452
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c
To: <sip:1-5001@192.168.0.17>;tag=as52fe5326
Call-ID: b3c0b0e6-78a4-4bda-8cda-a14dba82312e
CSeq: 10269 ACK
Route: <sip:192.168.0.17;lr;ftag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c>
Max-Forwards: 70
User-Agent: Asterisk PBX 15.5.0~dfsg-1.1ubuntu4.8
Content-Length: 0
=======================================
INVITE sip:5001@XXX.XXX.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5081;rport;branch=z9hG4bKPj5e68ce85-9153-4637-bfc2-596ab72c229d
From: "KT" <sip:1234567890@192.168.0.20;user=phone>;tag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c
To: <sip:1-5001@192.168.0.17>;tag=as52fe5326
Contact: <sip:asterisk@192.168.0.20:5081>
Call-ID: b3c0b0e6-78a4-4bda-8cda-a14dba82312e
CSeq: 10270 INVITE
Route: <sip:192.168.0.17;lr;ftag=cd34e3f2-6a1f-497c-bb69-4e5f81be1e6c>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, replaces, norefersub
Max-Forwards: 70
User-Agent: Asterisk PBX 15.5.0~dfsg-1.1ubuntu4.8
Content-Type: application/sdp
Content-Length: 235
v=0
o=- 209700365 209700366 IN IP4 192.168.0.20
s=Asterisk
c=IN IP4 192.168.0.20
t=0 0
m=audio 12044 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
jcolp
September 11, 2018, 10:08am
4
Then I’d suggest providing the actual Asterisk side of things with console output and debug enabled, it’ll generally tell you why it is doing what it is doing in this case.
UserAd
September 11, 2018, 10:52am
5
We use ARI for creating calls. This is all that we got in asterisk console.
-- Executing [5001@pjsip-queue-out:1] NoOp("PJSIP/agents-00000040", "OUTBOUND START FROM PJSIP") in new stack
-- Executing [5001@pjsip-queue-out:2] Stasis("PJSIP/agents-00000040", "ARIBRIDGE,out,1,YTYzMzczOWQwMTRkZmNhNjhhZTliMzcxNWEwNDQ4ZWU.,1536662919.169") in new stack
-- Channel PJSIP/agents-00000040 joined 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1>
-- Channel PJSIP/in-00000041 joined 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1>
> 0x7f334c243830 -- Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:10244
> 0x7f334c22f340 -- Strict RTP learning after remote address set to: 192.168.0.162:8000
> 0x7f334c243830 -- Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:10244
> Bridge 456fc00e-e345-4ffa-9db6-0b903a7152a1: switching from simple_bridge technology to native_rtp
> Locally RTP bridged 'PJSIP/agents-00000040' and 'PJSIP/in-00000041' in stack
> Locally RTP bridged 'PJSIP/agents-00000040' and 'PJSIP/in-00000041' in stack
> Locally RTP bridged 'PJSIP/agents-00000040' and 'PJSIP/in-00000041' in stack
> Bridge 456fc00e-e345-4ffa-9db6-0b903a7152a1: switching from native_rtp technology to simple_bridge
-- Channel Snoop/out-456fc00e-e345-4ffa-9db6-0b903a7152a1-00000015 joined 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1-recording>
-- Channel Recorder/ARI-00000015;2 joined 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1-recording>
-- x=0, open writing: /var/spool/asterisk/recording/456fc00e-e345-4ffa-9db6-0b903a7152a1 format: wav, 0x7f3350004918
> 0x7f334c22f340 -- Strict RTP switching to RTP target address 192.168.0.162:8000 as source
> 0x7f334c243830 -- Strict RTP switching to RTP target address XXX.XXX.XXX.XXX:10244 as source
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
> 0x7f334c22f340 -- Strict RTP learning complete - Locking on source address 192.168.0.162:8000
> 0x7f334c243830 -- Strict RTP learning complete - Locking on source address XXX.XXX.XXX.XXX:10244
-- Channel PJSIP/agents-00000040 left 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1>
-- Channel PJSIP/in-00000041 left 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1>
-- Channel Snoop/out-456fc00e-e345-4ffa-9db6-0b903a7152a1-00000015 left 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1-recording>
-- Channel Recorder/ARI-00000015;2 left 'simple_bridge' stasis-bridge <456fc00e-e345-4ffa-9db6-0b903a7152a1-recording>
jcolp
September 11, 2018, 10:53am
6
That does not include debug information (core set debug 9 and debug set to go to console in logger.conf)
UserAd
September 11, 2018, 11:40am
7
jcolp
September 11, 2018, 11:46am
9
I believe it is trying to do a connected line update, but I don’t know why it’s doing it as an INVITE or why it is doing one in the first place with your configuration. Someone would need to lab it up and dig in deeper to understand.