SIP Trunk Asterisk-Cisco Call Hold Issue

Hy everybody,

it’s first time i post on this support forum, so i hope someone can pull me out from this trouble.
I’m going to show you a test environment i’ve developed for testing purposes between my Asterisk 1.6.0 and Cisco CallManager 9.1.
I set up a SIP Trunk between Cisco and Asterisk. Basic calls work well from cisco to asterisk and vice versa - RTP flows end to end between cisco sccp phone and asterisk sip phone. When i put call on hold from my asterisk to cisco also it works fine. However when i put call on hold from cisco to asterisk i have sip messages renegotiating the RTP ports, but from wireshark i see Asterisk does not forward the ACK message containing the renegotiated RTP port to its registered sip phone. In this way the sip Phone still contacts the old RTP port. This behaviour becomes destructive when i resume the call from hold.
These are SIP messages exchanged in two different scenario: first scenario refers to hold from asterisk, the second scenario refers to hold coming from cisco callmanager.

First scenario: sip phone establishing first call and then put cisco on hold, i omit sip 100 and 180 because they do not carry SDP.
sip phone (172.23.112.194) --> asterisk (172.23.112.10) --> cisco callmanager (172.23.112.20) --> cisco sccp phone (172.23.112.23)

INVITE sip:572322@172.23.112.20 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.10:5060;branch=z9hG4bK41395fc0;rport
Max-Forwards: 70
From: " 7229 Fata Logistic Clemente N." < sip:5207229@172.23.112.10> ;tag=as6aa9ace3
To: < sip:572322@172.23.112.20>
Contact: < sip:5207229@172.23.112.10>
Call-ID: 3653ef9620e74dea6f48a89e4acd9a46@172.23.112.10
CSeq: 102 INVITE
User-Agent: AmtecSPA_IPPABX:V2.20.X.RHEL5U5
Date: Wed, 21 May 2014 14:42:11 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PRACK
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 315
v=0
o=root 2109028682 2109028682 IN IP4 172.23.112.194
s=Asterisk PBX 1.6.0.15
c=IN IP4 172.23.112.194
t=0 0
m=audio 11784 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.23.112.10:5060;branch=z9hG4bK41395fc0;rport
From: " 7229 Fata Logistic Clemente N." < sip:5207229@172.23.112.10> ;tag=as6aa9ace3
To: < sip:572322@172.23.112.20> ;tag=166~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677043
Date: Wed, 21 May 2014 15:59:20 GMT
Call-ID: 3653ef9620e74dea6f48a89e4acd9a46@172.23.112.10
CSeq: 102 INVITE
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
Allow-Events: presence
Supported: replaces
Supported: X-cisco-srtp-fallback
Supported: Geolocation
Session-Expires: 1800;refresher=uas
Require: timer
P-Asserted-Identity: " User Capodichino" < sip:551322@172.23.112.20>
Remote-Party-ID: " User Capodichino" < sip:551322@172.23.112.20> ;party=called;screen=yes;privacy=off
Contact: < sip:572322@172.23.112.20:5060>
Content-Type: application/sdp
Content-Length: 236
v=0
o=CiscoSystemsCCM-SIP 166 1 IN IP4 172.23.112.20
s=SIP Call
c=IN IP4 172.23.112.23
b=TIAS:64000
b=AS:64
t=0 0
m=audio 22112 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

ACK sip:572322@172.23.112.20:5060 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.10:5060;branch=z9hG4bK028e17df;rport
Max-Forwards: 70
From: " 7229 Fata Logistic Clemente N." < sip:5207229@172.23.112.10> ;tag=as6aa9ace3
To: < sip:572322@172.23.112.20> ;tag=166~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677043
Contact: < sip:5207229@172.23.112.10>
Call-ID: 3653ef9620e74dea6f48a89e4acd9a46@172.23.112.10
CSeq: 102 ACK
User-Agent: AmtecSPA_IPPABX:V2.20.X.RHEL5U5
Content-Length: 0

<--------------------------------- END-TO-END RTP (works fine) -------------------------------------------------->

ASTERISK SENDs HOLD TO CISCO:

INVITE sip:572322@172.23.112.20:5060 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.10:5060;branch=z9hG4bK712eccd4;rport
Max-Forwards: 70
From: " 7229 Fata Logistic Clemente N." < sip:5207229@172.23.112.10> ;tag=as6aa9ace3
To: < sip:572322@172.23.112.20> ;tag=166~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677043
Contact: < sip:5207229@172.23.112.10>
Call-ID: 3653ef9620e74dea6f48a89e4acd9a46@172.23.112.10
CSeq: 103 INVITE
User-Agent: AmtecSPA_IPPABX:V2.20.X.RHEL5U5
Require: timer
Session-Expires: 1800;refresher=uas
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PRACK
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 266
v=0
o=root 2109028682 2109028683 IN IP4 172.23.112.10
s=Asterisk PBX 1.6.0.15
c=IN IP4 172.23.112.10
t=0 0
m=audio 22684 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.23.112.10:5060;branch=z9hG4bK712eccd4;rport
From: " 7229 Fata Logistic Clemente N." < sip:5207229@172.23.112.10> ;tag=as6aa9ace3
To: < sip:572322@172.23.112.20> ;tag=166~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677043
Date: Wed, 21 May 2014 15:59:29 GMT
Call-ID: 3653ef9620e74dea6f48a89e4acd9a46@172.23.112.10
CSeq: 103 INVITE
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
Allow-Events: presence
Supported: replaces
Supported: X-cisco-srtp-fallback
Supported: Geolocation
Session-Expires: 1800;refresher=uas
Require: timer
P-Asserted-Identity: " User Capodichino" < sip:551322@172.23.112.20>
Remote-Party-ID: " User Capodichino" < sip:551322@172.23.112.20> ;party=called;screen=yes;privacy=off
Contact: < sip:572322@172.23.112.20:5060>
Content-Type: application/sdp
Content-Length: 236
v=0
o=CiscoSystemsCCM-SIP 166 2 IN IP4 172.23.112.20
s=SIP Call
c=IN IP4 172.23.112.23
b=TIAS:64000
b=AS:64
t=0 0
m=audio 22112 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

ACK sip:572322@172.23.112.20:5060 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.10:5060;branch=z9hG4bK378086e1;rport
Max-Forwards: 70
From: " 7229 Fata Logistic Clemente N." < sip:5207229@172.23.112.10> ;tag=as6aa9ace3
To: < sip:572322@172.23.112.20> ;tag=166~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677043
Contact: < sip:5207229@172.23.112.10>
Call-ID: 3653ef9620e74dea6f48a89e4acd9a46@172.23.112.10
CSeq: 103 ACK
User-Agent: AmtecSPA_IPPABX:V2.20.X.RHEL5U5
Content-Length: 0

By means of wireshark i can see RTP end-to-end between 2 ip phones. Cisco sccp phone sends RTP traffic toward sip phone using destination port 11784, sip phone sends RTP traffic toward cisco sccp phone using destination port 22112.

When call is put on hold: Cisco sccp phone sends RTP traffic toward Asterisk PBX using destination port 22684, Asterisk PBX sends MOH toward cisco sccp phone using destination port 22112 RTP.

In this scenario i can see:

  • asterisk puts cisco on hold with a SIP re-invite, by means of INVITE SIP message
  • Cisco onorates SIP SDP content when put on hold

If i finally, resume the call, everything works fine

-------------------------------------------------------------------- END -------------------------------------------

Second scenario: cisco sccp phone establishing first call and then put sip phone on hold, i omit sip 100 and 180 because they do not carry SDP.
cisco sccp phone (172.23.112.23) --> cisco callmanager (172.23.112.20) --> asterisk (172.23.112.10) --> sip phone (172.23.112.194)

INVITE sip:5207229@172.23.112.10 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.20:5060;branch=z9hG4bK8e2a7938c4
From: " User Capodichino" < sip:551322@172.23.112.20> ;tag=158~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677038
To: < sip:5207229@172.23.112.10> ;tag=as6bc4461b
Date: Wed, 21 May 2014 15:54:17 GMT
Call-ID: 27763300-37c1cc27-12-147017ac@172.23.112.20
Supported: timer,resource-priority,replaces
Min-SE: 1800
User-Agent: Cisco-CUCM9.1
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
CSeq: 102 INVITE
Max-Forwards: 70
Expires: 180
Allow-Events: presence
Supported: X-cisco-srtp-fallback
Supported: Geolocation
Session-Expires: 1800;refresher=uas
P-Asserted-Identity: " User Capodichino" < sip:551322@172.23.112.20>
Remote-Party-ID: " User Capodichino" < sip:551322@172.23.112.20> ;party=calling;screen=yes;privacy=off
Contact: < sip:551322@172.23.112.20:5060>
Content-Type: application/sdp
Content-Length: 236
v=0
o=CiscoSystemsCCM-SIP 158 2 IN IP4 172.23.112.20
s=SIP Call
c=IN IP4 172.23.112.23
b=TIAS:64000
b=AS:64
t=0 0
m=audio 24246 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.23.112.20:5060;branch=z9hG4bK8e2a7938c4;received=172.23.112.20
From: " User Capodichino" < sip:551322@172.23.112.20> ;tag=158~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677038
To: < sip:5207229@172.23.112.10> ;tag=as6bc4461b
Call-ID: 27763300-37c1cc27-12-147017ac@172.23.112.20
CSeq: 102 INVITE
User-Agent: AmtecSPA_IPPABX:V2.20.X.RHEL5U5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PRACK
Supported: replaces, timer
Require: timer
Session-Expires: 1800;refresher=uas
Contact: < sip:5207229@172.23.112.10>
Content-Type: application/sdp
Content-Length: 268
v=0
o=root 1852687734 1852687735 IN IP4 172.23.112.194
s=Asterisk PBX 1.6.0.15
c=IN IP4 172.23.112.194
t=0 0
m=audio 11780 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

ACK sip:5207229@172.23.112.10 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.20:5060;branch=z9hG4bK8f320690f5
From: " User Capodichino" < sip:551322@172.23.112.20> ;tag=158~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677038
To: < sip:5207229@172.23.112.10> ;tag=as6bc4461b
Date: Wed, 21 May 2014 15:54:17 GMT
Call-ID: 27763300-37c1cc27-12-147017ac@172.23.112.20
Max-Forwards: 70
CSeq: 102 ACK
Allow-Events: presence
Content-Length: 0

<--------------------------------- END-TO-END RTP (works fine) -------------------------------------------------->

CISCO SENDs HOLD TO ASTERISK:

INVITE sip:5207229@172.23.112.10 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.20:5060;branch=z9hG4bK90486c1cbc
From: " User Capodichino" < sip:551322@172.23.112.20> ;tag=158~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677038
To: < sip:5207229@172.23.112.10> ;tag=as6bc4461b
Date: Wed, 21 May 2014 15:54:28 GMT
Call-ID: 27763300-37c1cc27-12-147017ac@172.23.112.20
Supported: timer,resource-priority,replaces
Min-SE: 1800
User-Agent: Cisco-CUCM9.1
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
CSeq: 103 INVITE
Max-Forwards: 70
Expires: 180
Allow-Events: presence
Supported: X-cisco-srtp-fallback
Supported: Geolocation
Session-Expires: 1800;refresher=uas
P-Asserted-Identity: " User Capodichino" < sip:551322@172.23.112.20>
Remote-Party-ID: " User Capodichino" < sip:551322@172.23.112.20> ;party=calling;screen=yes;privacy=off
Contact: < sip:551322@172.23.112.20:5060>
Content-Length: 0
---------------------------------------------- NO SDP in this re-invite ----------------------------------------
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.23.112.20:5060;branch=z9hG4bK90486c1cbc;received=172.23.112.20
From: " User Capodichino" < sip:551322@172.23.112.20> ;tag=158~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677038
To: < sip:5207229@172.23.112.10> ;tag=as6bc4461b
Call-ID: 27763300-37c1cc27-12-147017ac@172.23.112.20
CSeq: 103 INVITE
User-Agent: AmtecSPA_IPPABX:V2.20.X.RHEL5U5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PRACK
Supported: replaces, timer
Require: timer
Session-Expires: 1800;refresher=uas
Contact: < sip:5207229@172.23.112.10>
Content-Type: application/sdp
Content-Length: 315
v=0
o=root 1852687734 1852687736 IN IP4 172.23.112.194
s=Asterisk PBX 1.6.0.15
c=IN IP4 172.23.112.194
t=0 0
m=audio 11780 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

ACK sip:5207229@172.23.112.10 SIP/2.0
Via: SIP/2.0/UDP 172.23.112.20:5060;branch=z9hG4bK9146b1d4bd
From: " User Capodichino" < sip:551322@172.23.112.20> ;tag=158~7f87b13b-88e1-47cb-8053-49b5f18eaf17-32677038
To: < sip:5207229@172.23.112.10> ;tag=as6bc4461b
Date: Wed, 21 May 2014 15:54:28 GMT
Call-ID: 27763300-37c1cc27-12-147017ac@172.23.112.20
Max-Forwards: 70
CSeq: 103 ACK
Allow-Events: presence
Content-Type: application/sdp
Content-Length: 179
v=0
o=CiscoSystemsCCM-SIP 158 3 IN IP4 172.23.112.20
s=SIP Call
c=IN IP4 172.23.112.20
t=0 0
m=audio 24598 RTP/AVP 0
a=X-cisco-media:umoh
a=rtpmap:0 PCMU/8000
a=ptime:20

By means of wireshark i can see RTP end-to-end between 2 ip phones. Cisco sccp phone sends RTP traffic toward sip phone using destination port 11780, sip phone sends RTP traffic toward cisco sccp phone using destination port 24246.

When call is put on hold: Cisco CallManager sends MOH toward cisco sccp phone using destination port 11780 RTP (sip phone can hear MOH from cisco), sip phone - unfortunately still contacts the cisco sccp phone using destination port 24246 (exchanged in the previous SIP handshake).

In this scenario i can see:

  • Cisco CallManager puts sip phone on hold, by means of ACK SIP message
  • Asterisk does not onorate SIP ACK SDP content when put on hold, also Asterisk doesn’t forward re-INVITE and ACK to its registered sip phone. From wireshark i can see Asterisk doesn’t forward any other SIP messages to its registered sip phone after the first call is established.

If i finally resume the call i get one-way audio (cisco sccp phone cannot hear sip phone, but sip phone can hear cisco sccp phone).

---------------------------------------------------------- END -----------------------------------------------------------

I appreciate if someone can help me understanding this Asterisk’s behaviour.

I’d like to know if it could depend on Asterisk version, and why Asterisk does not onorates renegotiation in SIP ACK message.

At Cisco CallManager side, if i configure MTP required over SIP trunk, everything works fine because there is no media path breaking since all RTP traffic pass through CallManager. I don’t want MTP checked anyway. Also if i configure Asterisk to pass RTP through itself everything works since there is not media path breaking.

best regards
Marco

1.6.0.x is obsolete.

1.6.1.0 is also obsolete and has a bug in handling resume from hold with late offer SDP (it offers its current (held) state, rather than the desired state. I’m not sure that this is fixed before PJSIP in Asterisk 12. I presume that bug is present in 1.6.0.x. Late offer is related to MTP usage.

Asterisk is a back to back user agent, so it regenerates SDP, rather than forwarding it.

In any case, Asterisk doesn’t forward hold states, and certainly for 1.6.1.0 does return the media path to Asterisk for the side that send hold, so, if you have direct media, you will get a mix of Cisco and Asterisk hold music. Again I don’t know if and when this was fixed.

[quote=“david55”]1.6.0.x is obsolete.

1.6.1.0 is also obsolete and has a bug in handling resume from hold with late offer SDP (it offers its current (held) state, rather than the desired state. I’m not sure that this is fixed before PJSIP in Asterisk 12. I presume that bug is present in 1.6.0.x. Late offer is related to MTP usage.

Asterisk is a back to back user agent, so it regenerates SDP, rather than forwarding it.

In any case, Asterisk doesn’t forward hold states, and certainly for 1.6.1.0 does return the media path to Asterisk for the side that send hold, so, if you have direct media, you will get a mix of Cisco and Asterisk hold music. Again I don’t know if and when this was fixed.[/quote]

many thanks david55,

i tried asterisk 1.8 today and it solves hold\resume issue. I also solved mix of Cisco and Asterisk MOH by removing Annunciator and MOH over Cisco SIP Trunk. Now i have transf and conferencing also working.

best regards
Marco