Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
<pre>We need to utilize LUA to manipulate SIP headers for interoperability
with our SIP trunking provider.

We need the ability to parse the first 6 digits of the From URI-user field of the INVITE
header. Does anyone know of any documentation on the parsing capabilities of the LUA
scripting or any modules that can be added to support this. Thanks.
</pre>

Hi,

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.