Connect: CUCM SIP Transparency and Normalization Lua scripting

Monday, July 18, 2011

CUCM SIP Transparency and Normalization Lua scripting

Cisco Unified CM is a Business to Business User Application (B2BUA). Therefore, any SIP to SIP call consists of 2 SIP dialogs. It is often useful to pass information from one dialog to the other during the life of the dialogs. This includes call setup, mid call, and end of call messaging. Using the pass through object described, it is possible to trigger transparent pass through of information on from one SIP dialog (representing 1 of the call legs) to the other.

The snippet below is an example of a script I used in order to transparently pass through an arbitrary header ("Subject" in this case) in an INVITE message from the inbound call to the outbound call leg.

B = {}
function B.inbound_INVITE(msg)
local pt = msg:getPassThrough()
local Subject = msg:getHeader("Subject")
if pt and Subject
then
pt:addHeader("X-Subject", Subject)
end
end
function B.outbound_INVITE(msg)
local Subject = msg:getHeader("X-Subject")
if Subject
then
msg:addHeader("Subject", Subject)
msg:removeHeader("X-Subject")
end
end
return B

1 comment:

  1. I have been browsing online more than 4 hours today, yet I never found
    any interesting article like yours. It's pretty worth enough for
    me. Personally, if all web owners and bloggers made gokd content aas you did, the
    internet will be a lot more useful than ever before.

    Feel free to surf to my page; ivr best practices ()

    ReplyDelete