cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2107
Views
0
Helpful
11
Replies

Normalization Script - Modifying INVITE

Hi guys,

I would have a question regarding the normalization scripts for SIP.

Is there a way to modify the second field in an INVITE request? (sip:DN@IP)

INVITE sip:7111@192.168.15.111:5060 SIP/2.0

Date: Mon, 28 Oct 2013 09:25:39 GMT

Call-Info: <sip:192.168.15.1:5060>;method="NOTIFY;Event=telephone-event;Duration=500"

Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY

Thanks a lot.

Regards

1 Accepted Solution

Accepted Solutions

Yes you can chnage the request URI..

The script below changes the RURI from XXXX@211.211.211.211 to XXXX@Test.com

M = {}

function M.outbound_INVITE(msg)

local method, ruri, ver = msg:getRequestLine()

local uri = string.gsub (ruri, “211.211.211.211″, “Test.com”)

msg:setRequestUri(uri)

end

Please rate all useful posts

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

Please rate all useful posts

View solution in original post

11 Replies 11

Hi Cristian,

It is possible to do using sip profiles.

http://www.cisco.com/en/US/products/sw/voicesw/ps5640/products_configuration_example09186a0080982499.shtml

Kind regards,
Andrew C.

Kind regards, Andrew C.

Hi Andrew,

thanks for the reply.

It works great using sip profiles.

But is there a way to do it on Call Manager with norm. scripts?

Thanks.

Regards

Sorry, I haven't noticed that you want to use normalization scripts. I've never used them, but it seems that yes, you can change almost everything using it.

https://supportforums.cisco.com/community/netpro/collaboration-voice-video/unified-comm-application/blog/2012/03/12/modifying-sip-header-in-call-manager-sip-normalization

http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/sip_tn/8_5_1/10-sip_transparency.html

Kind regards,

Andrew C.

Kind regards, Andrew C.

or is there a way to force the Voice Gateway to route incoming invites based on the TO header instead of the request uri?

because the TO header can be easily modified with norm. scripts:

M = {}

function M.outbound_INVITE(msg)

    msg:removeHeader("To")

    msg:addHeader("To", "<7222>")

end

return M

Thanks.

Regards

Sorry, can't help with that, I have only theoretical knowledge regarding this question. Hope someone in community would be more helpful.

Kind regards,
Andrew C.

Kind regards, Andrew C.

thanks Andrew.

It seems that you can modify nearly everything but I'm not really sure regarding the INVITE SIP-Req-URI...

Has anyone tried this?

Thanks.

Cristian,

First of all you can only use normalization scripts on CUCM. With voice gateways you only use sip profiles.

Second, you can only apply sip profiles in the outbound direction, you can use it to change headers in the outbound direction as far as the gateway is concerened.

Please rate all useful posts

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

Please rate all useful posts

Hi aokanlawon,

yes, that is clear.

The problem would be that I can't change the request uri using norm scripts on Call Manager.

Is there a way that I can access the request uri in the invite message using norm scripts (on Call Manager)?

INVITE sip:7111@192.168.15.111:5060 SIP/2.0

Date: Mon, 28 Oct 2013 09:25:39 GMT

Thanks.

Regards

Yes you can chnage the request URI..

The script below changes the RURI from XXXX@211.211.211.211 to XXXX@Test.com

M = {}

function M.outbound_INVITE(msg)

local method, ruri, ver = msg:getRequestLine()

local uri = string.gsub (ruri, “211.211.211.211″, “Test.com”)

msg:setRequestUri(uri)

end

Please rate all useful posts

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

Please rate all useful posts

great. thanks.

it seems that it can be done with setRequestUri.

M = {}

function M.outbound_INVITE(msg)

    msg:setRequestUri("tel:1234")

end

return M

Thanks.

Regards

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: