cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JTricHall
New Contributor

Unable to change Contact IP address with HMR rule

I've got a client with an Adtran 908 that we are doing a SIP to PRI conversion on. I need an HMR rule to overwrite the contact header and change the private IP to the public IP. This is working for the SDP messages but not the Contact header and I can't figure out why. I'm using the follow rule I found on another forum:

 

hmr rule-set ContactNAT
message-rule ReplaceIP message-type any 10
modify header contact position all match-value /(.*@)(192\.168\.200\.10)(.*)/ new-value /\XXX.XXX.XXX.XXX\3/ 10
modify body match-value /192\.168\.200\.10/ new-value /XXX.XXX.XXX.XXX/ 20
modify body match-value /192\.168\.200\.10/ new-value /XXX.XXX.XXX.XXX/ 30

The two body match rules work fine but the contact one fails no matter how I change the match-value and debug hmr traffic show me this:

SIP.HMR TRAFFIC Modifying SIP message headers matching contact
SIP.HMR TRAFFIC No match or failed to substitute
SIP.HMR TRAFFIC No match to header value <sip:+1234567890@192.168.200.10:5060;transport=UDP>
SIP.HMR TRAFFIC Found 1 headers : Modified 0 headers using /(.*@)(192\.168\.200\.10)(.*)/

Any help or ideas would be appreciated.

Thanks

Jamie

 

0 Kudos
1 Reply

Re: Unable to change Contact IP address with HMR rule

I figured this out I had misplaced a part of the string.