06-16-2012 10:02 PM - edited 03-16-2019 11:42 AM
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.
Solved! Go to Solution.
06-17-2012 11:11 AM
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"
06-17-2012 06:27 AM
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"
06-17-2012 11:11 AM
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"
06-17-2012 05:39 PM
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,
06-17-2012 10:13 PM
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"
12-18-2013 10:25 AM
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!
12-18-2013 10:58 AM
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"
12-18-2013 12:12 PM
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!
12-19-2013 01:08 AM
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"
12-19-2013 04:53 AM
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!
12-19-2013 06:48 AM
Hi, please see this thread. Thanks Armin
https://supportforums.cisco.com/message/4121103#4121103
HTH, please rate all useful posts!
03-25-2014 04:10 PM
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.
03-26-2014 03:06 AM
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
07-12-2015 10:24 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide