03-28-2012 01:20 PM
I've been working with a SIP provider that has asked us to insert a CIC code into the SIP header for billing purposes. We'll have multiple numbers that will be billed to different accounts. So I wrote a sip-profile that matched the From field and modified it to send a CIC code in that field:
voice class sip-profiles 100
request INVITE sip-header From modify "<sip:4405551212@208.xx.xxx.xx>>" "<sip:4405551212;cic=9101@208.xx.xxx.xx>>"
request REINVITE sip-header From modify "<sip:4405551212@208.xx.xxx.xx>>" "<sip:4405551212;cic=9101@208.xx.xxx.xx>>"
This worked correctly and produced the results:
026828: Mar 28 19:15:25.919: //8423/5DE20A000000/SIP/Msg/ccsipDisplayMsg:
Sent:
INVITE sip:4405551212@66.xxx.xx.xx:5060 SIP/2.0
Via: SIP/2.0/UDP 208.xx,xxx,xx:5060;branch=z9hG4bK1ED421CB
Remote-Party-ID: "John Doe" <sip:4405551212@208.xx,xxx,xx>;party=calling;screen=yes;privacy=off
From: "John Doe" <sip:4405551212;cic=9101@208.xx,xxx,xx>;tag=685C7BE8-7BA
To: <sip:2165551212@66.xxx.xx.xx>
Date: Wed, 28 Mar 2012 19:15:25 GMT
Now they tell me that their accounting software cannot deal with the CIC in the From field and the need it in the INVITE string so that the result looks like this:
026828: Mar 28 19:15:25.919: //8423/5DE20A000000/SIP/Msg/ccsipDisplayMsg:
Sent:
INVITE sip:4405551212@66.xxx.xx.xx:5060 SIP/2.0 cic=9101
Via: SIP/2.0/UDP 208.xx,xxx,xx:5060;branch=z9hG4bK1ED421CB
Remote-Party-ID: "John Doe" <sip:4405551212@208.xx,xxx,xx>;party=calling;screen=yes;privacy=off
From: "John Doe" <sip:4405551212@208.xx,xxx,xx>;tag=685C7BE8-7BA
To: <sip:2165551212@66.xxx.xx.xx>
Date: Wed, 28 Mar 2012 19:15:25 GMT
Is there a way for me to change the INVITE statement rather than a field in the sip-header?
Thanks,
Terry
03-29-2012 10:32 AM
You must change the Request-URI. Use the command "request INVITE sip-header SIP-Req-URI" in your sip-profiles.
Regards.
04-19-2012 09:23 AM
Daniele... thanks for the response.
I have used the command you suggested in my sip-profile, but I can't seem to get the right syntax to produce the results that I want. Here's how the INVITE statement should look
INVITE sip:4405551212;cic=9101@66.xxx.xx.xx:5060 SIP/2.0
so here's the sip-profile command I tried:
voice class sip-profiles 9101
request INVITE sip-header SIP-Req-URI modify "sip:[^]@[^]+" "sip:\1;cic=9101\2"
The results of my command are:
INVITE sip:;cic=9101@66.xxx.xx.xx:5060 SIP/2.0
What do I need to do to add the "cic=9101" before the @ but leave everything else unchanged?
Thanks in advance.
Terry
04-19-2012 10:13 AM
Try this rule:
request INVITE sip-header SIP-Req-URI modify "sip:(.*)@[^]+" "sip:\1;cic=9101\2"
You can find more examples here:
Regards.
04-23-2012 07:22 AM
Thanks for your help. Finally got it to work using the syntax:
request INVITE sip-header SIP-Req-URI modify "(.*)@" "\1;cic=9101@"
Terry
04-23-2013 12:25 AM
Hi ,
Is there anyway that we can change the following red colured sip header using a SIP profile as follows ?
000340: *Jan 3 01:21:24.912: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Sent:
ACK sip:0771863241@123.231.4.89:5060 SIP/2.0
Via: SIP/2.0/UDP 172.25.150.11:5060;branch=z9hG4bK1A698873
From: "AnuradhaD -26593" <>117416000@172.25.150.11>;tag=C4E55424-647>
To: <0771863241>;tag=SDpau0d99-17FEF414-207C0771863241>
Date: Wed, 03 Jan 2001 01:21:23 GMT
Call-ID: 900C1B51-E04D11D4-AA28FEBB-4A247BAF@172.25.150.11
Max-Forwards: 70
CSeq: 101 ACK
Allow-Events: telephone-event
Content-Length:
we need to repalce this 117416000 number in the from header to a different number 11256373 .
please advice how to do this ..
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