<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Parsing capabilities in CUCM LUA</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=4459091" />
  <subtitle>Parsing capabilities in CUCM LUA</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=4459091</id>
  <updated>2013-05-26T07:51:56Z</updated>
  <dc:date>2013-05-26T07:51:56Z</dc:date>
  <entry>
    <title>RE: Parsing capabilities in CUCM LUA</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4459770" />
    <author>
      <name>Yossi Ben Hagai</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4459770</id>
    <updated>2011-09-08T20:07:07Z</updated>
    <published>2011-09-08T20:07:07Z</published>
    <summary type="html">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):
[code]
M = {}
function M.inbound_INVITE(msg)
msg:applyNumberMask("From", "1XXXXXX")
end
return M
[/code]

The Lua environment on CUCM does not include all standard Lua libraries, fortunately you have the [url=http://www.lua.org/manual/5.1/manual.html#5.4]string manipulation library[/url] at hand if you want to go freestyle.


Regards,
Yossi.</summary>
    <dc:creator>Yossi Ben Hagai</dc:creator>
    <dc:date>2011-09-08T20:07:07Z</dc:date>
  </entry>
  <entry>
    <title>Parsing capabilities in CUCM LUA</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4459090" />
    <author>
      <name>Christa Sherker</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4459090</id>
    <updated>2011-09-08T16:34:14Z</updated>
    <published>2011-09-08T16:34:14Z</published>
    <summary type="html">&lt;pre&gt;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.
&lt;/pre&gt;</summary>
    <dc:creator>Christa Sherker</dc:creator>
    <dc:date>2011-09-08T16:34:14Z</dc:date>
  </entry>
</feed>

