cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
357
Views
10
Helpful
6
Replies
nuinoahmed
Beginner

CUBE - Copy SIP From header from Incoming INVITE to outgoing INVITE

Hi,

I have a CUBE between ITSP and CUCM.   I would like to modify the From header received in the incoming INVITE and use it in the outgoing INVITE

 

Received:
INVITE sip:+496xxxxxxxx46@192.168.1.10;user=phone SIP/2.0
Max-Forwards: 68
Session-Expires: 3600;refresher=uac
Min-SE: 600
Supported: timer, 100rel
To: "+496xxxxxxxx46" <sip:+496xxxxxxxx46@192.168.1.10;user=phone>
From: "+316xxxxxxx7" <sip:+316xxxxxxx7@212.10.1.34>;tag=3821351883-1068052432
P-Asserted-Identity: "+4930xxxxxxx10" <sip:+4930xxxxxxx10@212.10.1.34;user=phone>
Call-ID: 264551051-3821351883-200638263@SBC1-ABC-EU.exemple.com
CSeq: 1 INVITE
Allow: MESSAGE,PRACK,INFO,OPTIONS,BYE,INVITE,ACK,CANCEL
Via: SIP/2.0/UDP 212.10.1.34:5060;branch=z9hG4bKb005fb6fc6c3f229959ef2d648333f2c
Contact: <sip:+316xxxxxxx7@212.10.1.34:5060>
Content-Type: application/sdp
Accept: application/sdp
Content-Length: 347
v=0
o=SBC2-ABC-EU 2496788555450729 1 IN IP4 212.10.1.34
s=sip call
c=IN IP4 212.10.1.35
t=0 0
m=audio 65102 RTP/AVP 8 0 18 96 13 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:96 G726-32/8000
a=rtpmap:13 CN/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

Sent:
INVITE sip:+496xxxxxxxx46@10.218.11.13 SIP/2.0
Via: SIP/2.0/TCP 10.10.128.66:5060;branch=z9hG4bK1A325E32C
From: "+4930xxxxxxx10" <sip:+4930xxxxxxx10@10.10.128.66>;tag=96988838-F0A
To: <sip:+496xxxxxxxx46@10.218.11.13>
Date: Wed, 03 Feb 2021 13:41:57 GMT
Call-ID: 6B783808-655C11EB-9F6CFE9F-76F149F1@10.10.128.66
Supported: timer,resource-priority,replaces,sdp-anat
Min-SE: 600
Cisco-Guid: 1803010717-1700532715-2674327199-1995524593
User-Agent: Cisco-SIPGateway/IOS-16.6.4
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
CSeq: 101 INVITE
Timestamp: 1612359717
Contact: <sip:+4930xxxxxxx10@10.10.128.66:5060;transport=tcp>
Call-Info: <sip:10.10.128.66:5060>;method="NOTIFY;Event=telephone-event;Duration=2000"
Expires: 180
Allow-Events: telephone-event
Max-Forwards: 67
P-Asserted-Identity: "+4930xxxxxxx10" <sip:+4930xxxxxxx10@10.10.128.66>
Session-ID: d6e6a4ea31b55239a00a08ee52f06598;remote=00000000000000000000000000000000
Session-Expires: 3600;refresher=uac
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 298
v=0
o=CiscoSystemsSIP-GW-UserAgent 7598 4889 IN IP4 10.10.128.66
s=SIP Call
c=IN IP4 10.10.128.66
t=0 0
m=audio 45722 RTP/AVP 8 0 101 19
c=IN IP4 10.10.128.66
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:19 CN/8000
a=ptime:20

 

I tried following but it failed

 

voice class sip-copylist 50
sip-header FROM

!

dial­peer voice 100 voip
voice class sip-copylist 50

!

voice class sip-profiles 50
request INVITE peer-header sip From copy "sip:(.*)@" u01
request INVITE sip-header From modify ".*@(.*)" "INVITE sip:\u01@\1"

!

dial-peer voice 100 voip        <<<<<<  FROM ITSP
voice class sip-copylist 50

!

dial-peer voice 400 voip        <<<<<<<  To CUCM
voice-class sip profiles 50

 

Can someone review the above and advise what went wrong and if I missed something? 

Thanks in advance

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Roger Kallberg
VIP Advisor

Have a look at this post, it sounds like it should be similar to what you ask.

https://community.cisco.com/t5/ip-telephony-and-phones/cube-sip-profile-amp-copy-list-feature-error-when-handling-from/td-p/4270906

Please rate all useful posts

View solution in original post

Hi Roger,

 

Finally I got it working. Thanks for your help.

It was not an easy one as the SIP Profiles Test Tool may show you as working while you still have an extra \ at the end of the number.  So on cube this will of course not work.  

Here is the working config, it may help and save some time for others:

 

voice class sip-profiles 10
request INVITE peer-header sip From copy "<sip:(.*)@" u01
request INVITE sip-header From modify ".*@(.*)" "From: \"\u01\" <sip:\u01@\1"
request INVITE sip-header P-Asserted-Identity modify ".*@(.*)" "P-Asserted-Identity: \"\u01\" <sip:\u01@\1"
!
voice class sip-copylist 10
sip-header From

!

dial-peer voice 50 voip    <<<<<<<<<<<<<<  From ITSP

voice-class sip copy-list 10

!

dial-peer voice 100 voip    <<<<<<<<<<<<<<   To CUCM

voice-class sip profiles 10

 

View solution in original post

6 REPLIES 6
Roger Kallberg
VIP Advisor

Have a look at this post, it sounds like it should be similar to what you ask.

https://community.cisco.com/t5/ip-telephony-and-phones/cube-sip-profile-amp-copy-list-feature-error-when-handling-from/td-p/4270906

Please rate all useful posts

View solution in original post

Thanks Roger,

I prepared the config I think correct now.  I will apply it tomorrow to the CUBE and test.  Will let you know.

 

 

If you want to pre test the SIP profile I recommend you to look through this document about the test tool for SIP profiles that Cisco have provided for us. https://community.cisco.com/t5/collaboration-voice-and-video/sip-profile-test-tool/ta-p/3162632

Please rate all useful posts

Hi Roger,

 

Finally I got it working. Thanks for your help.

It was not an easy one as the SIP Profiles Test Tool may show you as working while you still have an extra \ at the end of the number.  So on cube this will of course not work.  

Here is the working config, it may help and save some time for others:

 

voice class sip-profiles 10
request INVITE peer-header sip From copy "<sip:(.*)@" u01
request INVITE sip-header From modify ".*@(.*)" "From: \"\u01\" <sip:\u01@\1"
request INVITE sip-header P-Asserted-Identity modify ".*@(.*)" "P-Asserted-Identity: \"\u01\" <sip:\u01@\1"
!
voice class sip-copylist 10
sip-header From

!

dial-peer voice 50 voip    <<<<<<<<<<<<<<  From ITSP

voice-class sip copy-list 10

!

dial-peer voice 100 voip    <<<<<<<<<<<<<<   To CUCM

voice-class sip profiles 10

 

View solution in original post

Glad you managed to get it work. One question, was it intentional that you marked your own reply as the answer to your post?

Please rate all useful posts

No, that was not intentional.  your first reply did put me really in the right direction.

Content for Community-Ad

Spotlight Awards 2021