This document was generated from CDN thread Created by: Christa Sherker on 08-09-2011 11:34:14 AM <pre>We need to utilize LUA to manipulate SIP headers for interoperabilitywith our SIP trunking provider.We need the ability to parse the first 6 digits of the From URI-user field of the INVITEheader. Does anyone know of any documentation on the parsing capabilities of the LUAscripting or any modules that can be added to support this. Thanks.</pre>Subject: RE: Parsing capabilities in CUCM LUA Replied by: Yossi Ben Hagai on 08-09-2011 03:07:07 PMHi,The this calling party number manipulation functionality you have described can be achieved with number translation on the CUCM admin GUI.However, doing it with normalization script should be just as easy, for example to add a prefix of "1" to the 6 leftmost digits, the following script should do the trick (never actually tested this one):1
2M = {}
3function M.inbound_INVITE(msg)
4msg:applyNumberMask("From", "1XXXXXX")
5end
6return M
The Lua environment on CUCM does not include all standard Lua libraries, fortunately you have the string manipulation library at hand if you want to go freestyle.Regards,Yossi.