cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1620
Views
0
Helpful
3
Replies

SIP Header Modification help

lordshawn
Level 1
Level 1

I just need help with the Diversion header for FORWARDED calls.


Using SIP profile 101, the original Diversion header is stripped and replaced with the prefix.

This is a single number reach scenario.

voice class sip-profiles 101
request INVITE sip-header Diversion remove
request INVITE sip-header P-Asserted-Identity remove
request INVITE sip-header SIP-Req-URI modify "sip:00..(.*)@(.*)" "sip:\1@\2"
request INVITE sip-header To modify "<sip:00..(.*)@(.*)>" "<sip:\1@\2>"
request INVITE sip-header From modify "<sip:00..(..........)(.*)@(.*)>(.*)" "<sip:\2@\3>\4"
request INVITE sip-header Contact modify "<sip:00..(..........)(.*)@(.*)>(.*)" "<sip:\2@\3>\4"
request INVITE sip-header Remote-Party-ID modify "Remote-Party-ID:(.*)<sip:00..(..........)(.*)@(.*)>(.*)" "Diversion: <sip:\2@\4>\5"

Feb 2 14:04:17.438: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:7139225156@11.666.17.2:5060 SIP/2.0
Via: SIP/2.0/TCP 11.666.0.11:5060;branch=z9hG4bK663decb94a30
From: "Varys" <sip:00012816762244135998@11.666.0.11>;tag=1092940~66c26381-b856-4eb2-822d-7bd4cab95e4a-68686082
To: <sip:7139225156@11.666.17.2>
Date: Thu, 02 Feb 2017 20:04:17 GMT
Call-ID: c57abc00-893190c1-4c486-b00f20a@11.666.0.11
Supported: 100rel,timer,resource-priority,replaces
Min-SE: 1800
User-Agent: Cisco-CUCM10.5
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
CSeq: 101 INVITE
Expires: 180
Allow-Events: presence, kpml
Supported: X-cisco-srtp-fallback
Supported: Geolocation
Call-Info: <sip:11.666.0.11:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Call-Info: <urn:x-cisco-remotecc:callinfo>;x-cisco-video-traffic-class=VIDEO_UNSPECIFIED
Cisco-Guid: 3313155072-0000065536-0000024509-0184611338
Session-Expires: 1800
Diversion: "Shawn McDermott" <sip:2816477000@11.666.0.11>;reason=follow-me;privacy=off;screen=yes
P-Asserted-Identity: "Varys" <sip:00012816762244135998@11.666.0.11>
Remote-Party-ID: "Varys" <sip:00012816762244135998@11.666.0.11>;party=calling;screen=yes;privacy=off
Contact: <sip:00012816762244135998@11.666.0.11:5060;transport=tcp>
Max-Forwards: 70
Content-Length: 0


Feb 2 14:04:17.446: //229757/C57ABC000000/SIP/Msg/ccsipDisplayMsg:
Sent:
INVITE sip:7139225156@11.666.16.107:5060 SIP/2.0
Via: SIP/2.0/UDP 11.666.17.2:5060;branch=z9hG4bK2D9BF87
From: "Varys" <sip:135998@11.666.17.2>;tag=37D79F04-18AE
To: <sip:7139225156@11.666.16.107>
Date: Thu, 02 Feb 2017 20:04:17 GMT
Call-ID: 9C8D1421-E8B911E6-A3CCD62C-2C1285C5@11.666.17.2
Supported: 100rel,timer,resource-priority,replaces,sdp-anat
Min-SE: 1800
Cisco-Guid: 3313155072-0000065536-0000024509-0184611338
User-Agent: Cisco-SIPGateway/IOS-15.4.2.T2
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
CSeq: 101 INVITE
Timestamp: 1486065857
Contact: <sip:135998@11.666.17.2:5060>
Expires: 180
Allow-Events: telephone-event
Max-Forwards: 69
Diversion: "Shawn McDermott"<sip:2816477000@11.666.17.2>;privacy=off;reason=follow-me;screen=yes
Session-Expires: 1800
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 291
Diversion: <sip:2816762244@11.666.17.2>;party=calling;screen=yes;privacy=off


If I use SIP Profile 400 it removes the header and doesn’t rewrite it, which gives me a Unknown Number calling to my cell phone (Sip 101 atleast gave the Original called party).

!
voice class sip-profiles 400
request INVITE sip-header P-Asserted-Identity remove
request INVITE sip-header SIP-Req-URI modify "sip:00..(.*)@(.*)" "sip:\1@\2"
request INVITE sip-header To modify "<sip:00..(.*)@(.*)>" "<sip:\1@\2>"
request INVITE sip-header From modify "<sip:00..(..........)(.*)@(.*)>(.*)" "<sip:\2@\3>\4"
request INVITE sip-header Contact modify "<sip:00..(..........)(.*)@(.*)>(.*)" "<sip:\2@\3>\4"


Feb 2 14:08:12.721: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:7139225156@11.666.17.2:5060 SIP/2.0
Via: SIP/2.0/TCP 11.666.0.11:5060;branch=z9hG4bK664735a69f031
From: "Varys" <sip:00012816762244135998@11.666.0.11>;tag=1093296~66c26381-b856-4eb2-822d-7bd4cab95e4a-68686171
To: <sip:7139225156@11.666.17.2>
Date: Thu, 02 Feb 2017 20:08:12 GMT
Call-ID: 518ce380-893191ac-4c4ec-b00f20a@11.666.0.11
Supported: 100rel,timer,resource-priority,replaces
Min-SE: 1800
User-Agent: Cisco-CUCM10.5
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
CSeq: 101 INVITE
Expires: 180
Allow-Events: presence, kpml
Supported: X-cisco-srtp-fallback
Supported: Geolocation
Call-Info: <sip:11.666.0.11:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Call-Info: <urn:x-cisco-remotecc:callinfo>;x-cisco-video-traffic-class=VIDEO_UNSPECIFIED
Cisco-Guid: 1368187776-0000065536-0000024516-0184611338
Session-Expires: 1800
Diversion: "Shawn McDermott" <sip:2816477000@11.666.0.11>;reason=follow-me;privacy=off;screen=yes
P-Asserted-Identity: "Varys" <sip:00012816762244135998@11.666.0.11>
Remote-Party-ID: "Varys" <sip:00012816762244135998@11.666.0.11>;party=calling;screen=yes;privacy=off
Contact: <sip:00012816762244135998@11.666.0.11:5060;transport=tcp>
Max-Forwards: 70
Content-Length: 0


Feb 2 14:08:12.729: //229820/518CE3800000/SIP/Msg/ccsipDisplayMsg:
Sent:
INVITE sip:7139225156@11.666.16.107:5060 SIP/2.0
Via: SIP/2.0/UDP 11.666.17.2:5060;branch=z9hG4bK2DA081789
Remote-Party-ID: "Varys" <sip:00012816762244135998@11.666.17.2>;party=calling;screen=yes;privacy=off
From: "Varys" <sip:135998@11.666.17.2>;tag=37DB3618-1C30
To: <sip:7139225156@11.666.16.107>
Date: Thu, 02 Feb 2017 20:08:12 GMT
Call-ID: 28CA7541-E8BA11E6-A43CD62C-2C1285C5@11.666.17.2
Supported: 100rel,timer,resource-priority,replaces,sdp-anat
Min-SE: 1800
Cisco-Guid: 1368187776-0000065536-0000024516-0184611338
User-Agent: Cisco-SIPGateway/IOS-15.4.2.T2
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
CSeq: 101 INVITE
Timestamp: 1486066092
Contact: <sip:135998@11.666.17.2:5060>
Expires: 180
Allow-Events: telephone-event
Max-Forwards: 69
Diversion: "Shawn McDermott"<sip:2816477000@11.666.17.2>;privacy=off;reason=follow-me;screen=yes
Session-Expires: 1800
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 290


So that last line I need to have the remote party ID rewritten

3 Replies 3

Ayodeji Okanlawon
VIP Alumni
VIP Alumni

Looks like sip profile 400 is applied to the outbound dial-peer and not sip profile 101. You can add the sip profile configuration to strip the DIVERSION header to the profile 400.

Please rate all useful posts

What does this line do?

request INVITE sip-header Remote-Party-ID modify "Remote-Party-ID:(.*)<sip:00..(..........)(.*)@(.*)>(.*)" "Diversion: <sip:\2@\4>\5"

My main problem is 101 is writing a header i dont want.  

This is replacing the RPID header with a diversion header with the values in the 2nd, 4th and 5th bracket of the remote-party-id (rpid)

Please rate all useful posts