cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
1140
Views
0
Helpful
11
Replies
dhirajachhra
Beginner

Modifying SIP header

I have interesting scenario, on Incoming SIP call

If call from field has 2222 @10.X.X.X then i need to send invite to 919191@10.X.X.X

 

Let me know if possible

11 REPLIES 11

Original post has been deleted

Please rate all useful posts

Will it be applicable if i want to modify TO in Invite as per Remote-Party-ID:  

Apologies,

Using the IF logic feature of SIP profile will not work for your scenario. This can only be used to add a SIP header it cant be used to modify a header. In your Scenario you are looking for a way to modify the RURI based on a specific calling number.

Please rate all useful posts

URI dialing does not allow you to match dialpeer as per Remote iD

 

Do you have reference config

Dheeraj,

Thats your answer right there. You can use uri dialing to match an inbound dial-peer if the calling number is a certain number and you can then apply voice translation rule to change the called number.

Example below:

### Configure voice class uri to match the from field ++

voice class uri 500 sip
pattern 2222@10.x.x.x

 

##configure translation rule to change the called number to what you want

voice translation-rule 500
rule 1 /^\(.*\)/ /919191/

 

voice translation-profile test
translate called 500

 

## configure dial-peer to match the calling number 2222, apply the sip uri and translation profile##
dial-peer voice xxx voip
translation-profile incoming test
session protocol sipv2
incoming uri from 500

Please rate all useful posts

In calling number Remote ID field will remain same

So my Remote  id is 22222 and username field also remain same

Now any call coming from remote id or username should change TO field whch mean where i want to send call out.

 

Remote-Party-ID: <sip:22222@10.X.X.21>;party=calling;screen=no;privacy=off

--uniqueBoundary
Content-Type: application/sdp
Content-Disposition: session;handling=required

v=0
o=CiscoSystemsSIP-GW-UserAgent 2884 2524 IN IP4 172.X.X.X
s=SIP Call
c=IN IP4 0.0.0.0
t=0 0
m=audio 19994 RTP/AVP 0
a=inactive

--uniqueBoundary
Content-Type: application/x-cisco-cpa
Content-Disposition: signal;handling=optional

Events=FT,Asm,AsmT,Sit,Piano
CPAMinSilencePeriod=608
CPAAnalysisPeriod=2500
CPAMaxTimeAnalysis=3000
CPAMaxTermToneAnalysis=30000
CPAMinValidSpeechTime=112

--uniqueBoundary--
Apr 19 09:54:31.764 UTC: //-1/7DF42398B563/CCAPI/cc_api_display_ie_subfields:
cc_api_call_setup_ind_common:
cisco-username=22222
----- ccCallInfo IE subfields -----
cisco-ani=sip:7006013@10.X.X.X
cisco-anitype=0
cisco-aniplan=0
cisco-anipi=0
cisco-anisi=0
dest=sip:81040011XXX@10.X.X.X

"To" is not used for call routing in SIP. You should look at the Request URI rather which would be "81040011XXX" number.
You are trying to route these calls based on calling numbers for how many called numbers. This is not going to be dynamic.

Did you add the translation and URI voice class as Deji highlighted in the example in his last post ?

Nipun Singh Raghav
"We cannot solve our problems with the same thinking we used when we created them"

Is your Remote-Party-Id different from your From header?

Please post your full SIP INVITE so we see what your headers look like. You cant match uri based on RAI, but ideally your From and RAI should be the same..

Please rate all useful posts

Apr 19 09:54:31.760 UTC: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:81040011919XXXXXXX@10.X.X.X SIP/2.0
Via: SIP/2.0/UDP 10.X.X.X:58800;branch=z9hG4bK-d8754z-880d6463691bfe11-1---d8754z-;rport
Max-Forwards: 70
Require: 100rel
Contact: <sip:7006013@10.X.X.X:58800>
To: <sip:81040011919XXXX@10.X.X.X>
From: <sip:7006013@10.X.X.X>;tag=dc20f56d
Call-ID: f93b6c36-59036901-94543f2c-b56a0e13
CSeq: 1 INVITE
Session-Expires: 1800
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, NOTIFY, PRACK, REFER, NOTIFY, OPTIONS
Content-Type: Multipart/mixed;boundary=uniqueBoundary
Supported: timer, resource-priority, replaces
User-Agent: Cisco-SIPDialer/UCCE8.0
--More--  
Content-Length: 530
Remote-Party-ID: <sip:33333@10.X.X.X>;party=calling;screen=no;privacy=off

Hi,

Here is what you need to do. I just tested this and it worked.

Here is the summary of what we need to do to get this to work.

 

++ 1. perform sip profile inbound globally to copy RPID to From header++

++2. match inbound dial-peer based on From header +++

++3. Apply translation rule to modify the called number once our inbound dial-peer is matched ++

 

<< Step 1 >>

++ Configure sip profile and apply it globally ++
voice class sip-profiles 10
 rule 1 request INVITE sip-header Remote-Party-ID copy "sip:(.*)@.*" u01
 rule 2 request INVITE sip-header From modify "sip:.*@(.*)" "sip:\u01@\1"

or ( in case your IOS does not support the above )

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


voice service voip
sip

sip-profiles inbound
sip-profiles 10 inbound

 

<< Step 2 >>
++Configure voice class uri to match the from field ++
voice class uri 500 sip
pattern 33333@10.X.X.X

 

++ configure translation rule to change the called number  to what you want ++


voice translation-rule 500
rule 1 /^\(.*\)/ /9191919/
voice translation-profile test
translate called 500

 

++ configure inbound dial-peer to match the calling number 3333, apply the sip uri and translation profile ++


dial-peer voice XXX voip
translation-profile incoming test
session protocol sipv2
incoming uri from 500

 

++ If this doesnt work please send the following debugs ++

debug voip ccapi inout
debug ccsip mess
debug ccsip info
debug ccsip feature sip-profile

debug voice translation

Please rate all useful posts
Content for Community-Ad

Spotlight Awards 2021