<?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>RE: Remove "Asserted Identity" from SIP header using LUA</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_category?p_l_id=386195&amp;mbCategoryId=0" />
  <subtitle>RE: Remove "Asserted Identity" from SIP header using LUA</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_category?p_l_id=386195&amp;mbCategoryId=0</id>
  <updated>2013-05-23T22:57:33Z</updated>
  <dc:date>2013-05-23T22:57:33Z</dc:date>
  <entry>
    <title>RE: SIP Normalization Script - Insert Plus for a varable length dial plan</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=386195&amp;messageId=4459814" />
    <author>
      <name>Yossi Ben Hagai</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=386195&amp;messageId=4459814</id>
    <updated>2011-09-08T20:37:39Z</updated>
    <published>2011-09-08T20:37:39Z</published>
    <summary type="html">You can try something like the below (haven't tested it):
[code]
M = {}
	function M.outbound_INVITE(msg)
		local div = msg:getHeader("Diversion")")
		local uri = string.gsub(div, "&lt;", "&lt;+")
		msg:modifyHeader("Diversion")", uri)
	end
return M
[/code]

Regards,
Yossi.</summary>
    <dc:creator>Yossi Ben Hagai</dc:creator>
    <dc:date>2011-09-08T20:37:39Z</dc:date>
  </entry>
  <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=386195&amp;messageId=4459770" />
    <author>
      <name>Yossi Ben Hagai</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=386195&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>RE: Remove "Asserted Identity" from SIP header using LUA</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=386195&amp;messageId=4278173" />
    <author>
      <name>Yossi Ben Hagai</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=386195&amp;messageId=4278173</id>
    <updated>2011-07-27T20:07:32Z</updated>
    <published>2011-07-27T20:07:32Z</published>
    <summary type="html">[quote]Hi.
 
Can someone help me make a LUA script which removes the "Asserted Identity" field in the SIP header for inbound calls to a CUCM 8 SIP trunk?
 
Thanks.
 
Best reg,
 
Tore S[/quote]
 
The following code should do what you have requested:
 
[i]M = {}
function M.inbound_INVITE(msg)
    msg:removeHeader("P-Asserted-Identity")
end
return M[/i]</summary>
    <dc:creator>Yossi Ben Hagai</dc:creator>
    <dc:date>2011-07-27T20:07:32Z</dc:date>
  </entry>
</feed>

