Normalization scripting for SIP Trunking first step

SIP trunks can connect to a variety of endpoints, including PBXs, gateways, and service providers. Each of these endpoints implements the SIP protocol a bit differently, causing a unique set of interoperability issues. To normalize messages per trunk, Cisco Unified Communications Manager allows you to add or update scripts to the system and then associate them with one or more SIP trunks.

The normalization scripts that you create allow you to preserve, remove, or change the contents of any SIP headers or content bodies, known or unknown. After you configure a normalization script in Cisco Unified Communications Manager, you associate the script with a SIP trunk by configuring the Normalization Script fields in the Trunk Configuration window

The language used is Lua it is an open source, lightweight scripting language.

For info on Lua see http://www.lua.org/

As a practical example we change in the SIP invite for a outgoing call on a sip trunk, the IP destination addresses in the SIP URI to a domain name.

From: 

INVITE sip:+3227784342@1.1.1.10:5060 SIP/2.0

The normalization script:

M = {}

function M.outbound_INVITE(msg)

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

local uri = string.gsub (ruri, “1.1.1.10”, “domain1.a.be”)

msg:setRequestUri(uri)

end

return M

Changes into:

INVITE sip:+3227784200@domain1.a.be:5060 SIP/2.0

For some more info see:

http://developer.cisco.com/web/sip/home

http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/admin/8_6_1/ccmcfg/b06scrpt.html#wpxref92424

Advertisements
%d bloggers like this: