Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Modifying an incoming SIP INVITE message

I've read this article: http://www.cisco.com/en/US/products/sw/voicesw/ps5640/products_configuration_example09186a0080982499.shtml

Is it possible to modify or change the inbound SIP INVITE message from an ITSP to my CUCME system? For example, I want to replace the INVITE header with what is contained in the TO part of the message.

I want to go from this:

002204: Jun 15 07:29:53.143 GMT: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:17774552435320@192.168.192.253:5060 SIP/2.0
v: SIP/2.0/UDP 204.11.192.22:5080;branch=z9hG4bK-113932baa49d06fdbd144e638a6ade87
f: <sip:61401999081@66.193.176.35>;tag=3548730592-612072
t: <sip:18455845013@ss.callcentric.com>
i: 24383076-3548730592-612040@msw1.telengy.net
CSeq: 1 INVITE
Max-Forwards: 15
m: <sip:4f3be9aa1255edc4211fec09999d6232@204.11.192.22:5080;transport=udp>
Supported: timer
c: application/sdp
l: 348


To this:

002204: Jun 15 07:29:53.143 GMT: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:18455845013@192.168.192.253:5060 SIP/2.0
v: SIP/2.0/UDP 204.11.192.22:5080;branch=z9hG4bK-113932baa49d06fdbd144e638a6ade87
f: <sip:61401999081@66.193.176.35>;tag=3548730592-612072
t: <sip:18455845013@ss.callcentric.com>
i: 24383076-3548730592-612040@msw1.telengy.net
CSeq: 1 INVITE
Max-Forwards: 15
m: <sip:4f3be9aa1255edc4211fec09999d6232@204.11.192.22:5080;transport=udp>
Supported: timer
c: application/sdp
l: 348


I can only see reference to outbound dial peers. I tried anyway and of course my SIP profile does not get applied.

Everyone's tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions

Modifying an incoming SIP INVITE message

Hi Tony,

SIP normalization can be configured on both inbound/outbound dialpeers but it is applicable only for outgoing SIP messages (not incoming).

I believe you want to match the number in INVITE header with TO header. Looks that your ITSP is sending string in the INVITE header rather than number. You need to ask your ITSP to modify there config to send number in INVITE header. In this case, your INVITE header will look as follow:

INVITE sip:18455845013@192.168.192.253:5060 SIP/2.0; username=phone

"If you find this post useful, please rate it"

13 REPLIES
VIP Super Bronze

Modifying an incoming SIP INVITE message

You can apply sip profiles to aby dial-peer. Did you try applying to inbound dial-peer from your ITSP?

NB: I havent modified an invite header before, but try it on your inbound dial-peer..see if it works. Can you send the profile you are trying to use..

Please rate useful posts

"For the love of God is broader than the measure of man's mind And the heart of the Eternal is most wonderfully kind"

Please rate all useful posts "The essence of christianity is not the enthronement but the obliteration of self --William Barclay"

Modifying an incoming SIP INVITE message

Hi Tony,

SIP normalization can be configured on both inbound/outbound dialpeers but it is applicable only for outgoing SIP messages (not incoming).

I believe you want to match the number in INVITE header with TO header. Looks that your ITSP is sending string in the INVITE header rather than number. You need to ask your ITSP to modify there config to send number in INVITE header. In this case, your INVITE header will look as follow:

INVITE sip:18455845013@192.168.192.253:5060 SIP/2.0; username=phone

"If you find this post useful, please rate it"

New Member

Modifying an incoming SIP INVITE message

Thanks Mohammed,

I guess if the ITSP is uncooperative then I could use a CUBE to do the modifications when the SIP is outbound from the CUBE to my CUCME. Since it is a lab home setup I cannot / wont do this but this is useful to know for the future.

The username=phone part - does the ITSP have to put this in as well?

Also, since the normalisation can only be applied outgoing, does this include the SIP responses from my CUCME or ONLY the initiations from my CUCME?

Thanks,

Modifying an incoming SIP INVITE message

Yes SIP responses are included as long as they are in outgoing direction from CME. In your SIP profile configuration, you have option to edit requests (INVITE/SUBSCRIBE/ etc) or responses (200,180, etc).

Regarding username=phone, yes it should be included in the INVITE sent from ITSP. I don't know about other vendors, but CUCM will include it by default.

"If you find this post useful, please rate"

New Member

Modifying an incoming SIP INVITE message

Hello, we have the Problem that the Provider sends the Username in the Invite Header. I have a chance that the VGW looks into the "to" field for the called number instead into the Invite Header?

HTH, please rate all useful posts!

HTH, please rate all useful posts and right answers.
VIP Super Bronze

Re: Modifying an incoming SIP INVITE message

Armin,

CUBE typically routes call based on request URI and not the TO header

You  need to use conditional sip profiles to do this..please refer to this documentation

http://tblog.cisco.be/2011/02/17/cube-conditional-sip-profiles/

Please rate all useful posts

"opportunity is a haughty goddess who waste no time with those who are unprepared"

Please rate all useful posts "The essence of christianity is not the enthronement but the obliteration of self --William Barclay"
New Member

Re: Modifying an incoming SIP INVITE message

Hello, thanks for the docu, it is very helpfull to have an idea how it works. But not for my problem. I have ddid +49XXXXXX00-29 and all the time I get the same Username in the invite header, so I can make no differences between the ddid 00-29. Only in the "to" field I get allthe time the right ddid. So the idea is that the VGW looks into the "to" field.

You have any further Idea how I can solve this problem?

HTH, please rate all useful posts!

HTH, please rate all useful posts and right answers.
VIP Super Bronze

Modifying an incoming SIP INVITE message

I have already responded to your other posts..

Try this profile..

voice class sip-profiles 1
request INVITE peer-header TO copy "<>" u01
request INVITE sip-header SIP-Req-URI modify “.*@(.*)” “INVITE sip:\u01@213.777.22.11:5060 SIP/2.0

Please rate all useful posts

"opportunity is a haughty goddess who waste no time with those who are unprepared"

Please rate all useful posts "The essence of christianity is not the enthronement but the obliteration of self --William Barclay"
New Member

Re: Modifying an incoming SIP INVITE message

Hi, really thanks for the replay. The main problem is, the parameter doesn´t appear in my Router, I have only

tkvgw(config-class)#request invite ?

  sdp-header  SDP header

  sip-header  SIP header

not peer-header.

request INVITE sip-header TO copy "<>" u01

request INVITE sip-header SIP-Req-URI modify “.*@(.*)” “INVITE sip:\u01@213.777.22.11:5060 SIP/2.0

also not work because I have no "copy" command only modify.

28xx router. flash:c2800nm-adventerprisek9_ivs-mz.124-24.T4.bin"

Is this a IOS based Problem?

Thanks Armin

HTH, please rate all useful posts!

HTH, please rate all useful posts and right answers.
New Member

Re: Modifying an incoming SIP INVITE message

Hi, please see this thread. Thanks Armin

https://supportforums.cisco.com/message/4121103#4121103

HTH, please rate all useful posts!

HTH, please rate all useful posts and right answers.
New Member

Hello, I have a similar

Hello, I have a similar problem. In my case I have a PBX connected via SIP trunk against a Cisco CUBE.

The problem is that when I originate a call from the PBX to CUBE, the "contact" and "from" fields in the INVITE method are "Contact: <sip:4?2@10.12.12.30:5060>" and "From: "4?2" <sip:4?2@10.12.12.150:5060>;tag=79185331b3e33-17" to which the CUBE replies "Status-Line: SIP/2.0 400 Bad Request - 'Malformed/Missing Contact field'".

I don't have control over the PBX, so, is there any way for the CUBE to ignore this error? and then maybe modify the problematic field? I know that is posible modify the header fields in outgoing mesages, but in incoming ones?

Thanks.

 

 

 

VIP Super Bronze

Menoni,With IOS 15.4, you can

Menoni,

With IOS 15.4, you can configure inbound sip profiles. With this you should be able to modify your contact header field to an acceptable value.

 

eg

CUBE(config)#dial-peer voice 9 voip
CUBE(config-dial-peer)#voice-class sip profiles ?
  <1-10000>  The sip profiles group tag number
CUBE(config-dial-peer)#voice-class sip profiles 10 ?
  inbound  Set this as inbound SIP Profile
  <cr>
CUBE(config-dial-peer)#voice-class sip profiles 10 inbound

Request INVITE sip-header Contact modify <sip:(.*)@(.*)> "<sip:4000\1>"

Where 4000 can be any valid number you want to use.. Ensure that this is applied to the inbound dial-peer from the PBX to the CUBE

Please rate all useful posts "The essence of christianity is not the enthronement but the obliteration of self --William Barclay"
New Member

I had the same issue - here

I had the same issue - here is how i solved it

I  made a new inbound dial-peer that POINTED TO SELF

ex.

INCOMING CALL ->DIAL-PEER 1 VOIP (INBOUND)->DIAL-PEER 1 VOIP (OUTBOUND) -> DIAL-PEER 2 VOIP (INBOUND) -> DIAL-PEER 3 POTS

 

Dial-peer 1 modifies the sip messages and feeds the new info back into dial-peer 2

EXAMPLE

 

OUR CALLED NUMBER IS 10 DIGITS (Lets say your phone number when someone calls  you is 3105551234 - we receive exactly that, and not +13105551234 or 13105551234. If your ITSP does not send you 10 digits you will need to modify dial-peer 1 ("incoming called-number" section))

dial-peer voice 1 voip
 translation-profile incoming STRIP_CNAM
 translation-profile outgoing STRIP_CNAM_2
 preference 1
 destination-pattern ^C1[2-9]..[2-9]......$
 modem passthrough nse codec g711ulaw
 session protocol sipv2
 session target ipv4:IP ADDRESS OF THE ROUTER
 incoming called-number ^[2-9]..[2-9]......$
 voice-class codec 1
 voice-class sip profiles 1
 dtmf-relay rtp-nte digit-drop h245-alphanumeric
 fax-relay ecm disable
 fax-relay sg3-to-g3
 fax nsf 000000
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711ulaw
 no vad

 

dial-peer voice 2 voip
 preference 1
 destination-pattern ^1[2-9]..[2-9]......$
 modem passthrough nse codec g711ulaw
 session protocol sipv2
 session target sip-server
 voice-class codec 1
 dtmf-relay rtp-nte digit-drop h245-alphanumeric
 fax-relay ecm disable
 fax-relay sg3-to-g3
 fax nsf 000000
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711ulaw
 no vad

 

 

voice translation-profile STRIP_CNAM
 translate called 3
voice translation-profile STRIP_CNAM_2
 translate called 4

 

voice translation-rule 3
 rule 1 /1?\([2-9]..[2-9]......$\)/ /C1\1/
voice translation-rule 4
 rule 1 /C1\([2-9]..[2-9]......$\)/ /1\1/
voice translation-rule 11

 

*** OR ANY SIP PROFILE ***

voice class sip-profiles 1
 request ANY sip-header Remote-Party-ID copy "sip:(.*)@" u01
 request ANY sip-header Remote-Party-ID modify "(.*)sip:" "Remote-Party-ID: \"\u01\" <sip:"

 

voice service voip
 ip address trusted list

  ipv4 (YOUR PUBLIC IP ADDRESS)

 

**** If you have a ACL you will also need to modify it to allow  your public address to come back into it self ****

ip access-list extended access-in

 permit udp host (YOUR PUBLIC IP ADDRESS) ANY

 

 

 

 

 

 

3637
Views
0
Helpful
13
Replies
CreatePlease login to create content