<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table in Call Control</title>
    <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425479#M91</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&amp;nbsp; I presumed so but wanted to make sure...&amp;nbsp; Half-baked API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Sep 2017 14:10:44 GMT</pubDate>
    <dc:creator>Jonathan Els</dc:creator>
    <dc:date>2017-09-07T14:10:44Z</dc:date>
    <item>
      <title>SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425477#M89</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SIP Messages APIs support the following methods for updating tables of headers (e.g. multiple Diversion headers):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;getHeaderValues&lt;/LI&gt;&lt;LI&gt;removeHeaderValue&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I cannot find a mechanism to modify individual headers in a table.&amp;nbsp; For example, if the SIP message contains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Diversion: &amp;lt;sip:1000@&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&amp;gt;;reason=user-busy;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Diversion: "Jonathan Els" &amp;lt;sip:2000@192.168.100.10&amp;gt;;reason=unconditional;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;If we apply the modifyHeader API,&amp;nbsp; assuming we have a new header string &lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;newHeaderString &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;string, which has modified SIP URI &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;sip:9999@&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;msg:modifyHeader("Diversion", newHeaderString)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;This will modify the &lt;STRONG&gt;first header&lt;/STRONG&gt;, and delete subsequent headers, resulting in:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;Diversion: &amp;lt;sip:9999@&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;&amp;gt;;reason=user-busy;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Is there a way to modify &lt;STRONG&gt;&lt;EM&gt;specific&lt;/EM&gt;&lt;/STRONG&gt; diversion headers in the header table from the &lt;SPAN style="font-family: 'courier new', courier;"&gt;getHeaderValues &lt;/SPAN&gt;API , without having to read in the table, modify the table values, delete all headers from the SIP Message using a for loop, and then re-provision them again?&amp;nbsp; My intended end result should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;Diversion: &amp;lt;sip:9999@&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;&amp;gt;;reason=user-busy;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;Diversion: &lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;"Jonathan Els" &lt;/SPAN&gt;&amp;lt;sip:2000@&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;&amp;gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;;reason=unconditional;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 13:38:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425477#M89</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-07T13:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425478#M90</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given the current set of header manipulation functions available, it looks like your approach - read all header values, remove the headers from the message, then re-add the modified headers - is going to be the one to go with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:07:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425478#M90</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2017-09-07T14:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425479#M91</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&amp;nbsp; I presumed so but wanted to make sure...&amp;nbsp; Half-baked API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:10:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425479#M91</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-07T14:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425480#M92</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to add new headers to the table which I got from &lt;EM&gt;getHeaderValues.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;local diversionTable = msg:getHeaderValues("Diversion")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;local lastForwardingStation = diversionTable[1]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;local newForwardingStation = string.gsub(lastForwardingStation , "&amp;lt;sip:.*@" , "&amp;lt;sip:" .. finalVmUser .. "@")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;table.insert&lt;/STRONG&gt;(diversionTable, 1, newForwardingStation)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try run this, CUCM logs the following script error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;attempt to index global 'table' (a nil value)"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any reason that it wouldn't find table.insert?&amp;nbsp; This works running against a local Lua shell using v5.3.&amp;nbsp; It appears to be looking for a variable instead of finding the built-in table methods...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong,&amp;nbsp; or are the table built-ins not available on CUCM?&amp;nbsp; I read the CiscoLive presentation &lt;STRONG&gt;BRKCOL-2455&lt;/STRONG&gt;, which does allude to this being supported.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:38:50 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425480#M92</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-07T14:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425481#M93</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table add-ins aren't available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want to drop everything except the first diversion header? Or just change the first header and leave the rest in place?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:46:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425481#M93</guid>
      <dc:creator>Mark Stover</dc:creator>
      <dc:date>2017-09-07T14:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425482#M94</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to insert a new header at the start of the table, then replace the existing list of diversion headers with my modified table.&amp;nbsp; I know my initial question indicated just an in-line modify of one header - apologies for that.&amp;nbsp; The principle is the same though&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, start with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Diversion: &amp;lt;sip:1000@&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&amp;gt;;reason=user-busy;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Diversion: "Jonathan Els" &amp;lt;sip:2000@192.168.100.10&amp;gt;;reason=unconditional;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Desired output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px;"&gt;Diversion: &amp;lt;sip:&lt;STRONG&gt;9999&lt;/STRONG&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-style: inherit; font-weight: inherit; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px;"&gt;&amp;gt;;reason=user-busy;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Diversion: &amp;lt;sip:1000@&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px;"&gt;192.168.100.10&lt;/SPAN&gt;&amp;gt;;reason=user-busy;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Diversion: "Jonathan Els" &amp;lt;sip:2000@192.168.100.10&amp;gt;;reason=unconditional;privacy=off;screen=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ive successfully achieved the desired result doing this, but its ugly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;local diversionTable = msg:getHeaderValues("Diversion")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;local lastForwardingStation = diversionTable[1]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;local newForwardingStation = string.gsub(lastForwardingStation , "&amp;lt;sip:.*@" , "&amp;lt;sip:" .. finalVmUser .. "@")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for k,v in ipairs(msg:getHeaderValues("Diversion")) do&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg:removeHeaderValue("Diversion", v)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;msg:addHeader("Diversion", newForwardingStation) -- workaround for table.insert failing&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;-- write new header from modified Diversion table&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for k,v in ipairs(diversionTable) do&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg:addHeader("Diversion", v)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:54:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425482#M94</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-07T14:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425483#M95</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dropping everything and replacing with a single header seems to work with just single call to &lt;EM&gt;modifyHeader&lt;/EM&gt;.&amp;nbsp; That removes the need to delete, then re-add...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;However&lt;/STRONG&gt;&lt;/EM&gt;...&amp;nbsp; this results in the Diversion headers being split in the INVITE, as the SIP Messages API appends headers by default.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:55:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425483#M95</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-07T14:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425484#M96</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, you can't add a header to the beginning of a list of Diversion headers...we don't have that fine level of control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried just doing a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;msg:removeHeader("Diversion")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to remove the full list of Diversion headers? I thought that worked that way, but it's been a while since I tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you have to 'readd' the new header, then loop through the table to add the rest of the headers since addHeader only appends a single header to the message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 16:37:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425484#M96</guid>
      <dc:creator>Mark Stover</dc:creator>
      <dc:date>2017-09-07T16:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425485#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your prompt response, I will try a simple &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px;"&gt;msg:removeHeader("Diversion")&lt;/SPAN&gt; without specifying the exact Diversion header as I have now in a for-loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 22:02:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425485#M97</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-07T22:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425486#M98</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px;"&gt;msg:removeHeader("Diversion")&lt;/SPAN&gt; but the script fails with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;64922113.009 |09:35:43.986 |AppInfo&amp;nbsp; |SIPNormalizationScriptError - A script error occurred Device Name:MYCUCMNAME Script Name:line-group-forwarder Script Function:M.outbound_INVITE Script Type:Custom Error Code:3 Error Code Text:&lt;STRONG&gt;Execution Error Error Message:line-group-forwarder at line 65: wrong number of arguments, usage: &lt;SPAN style="text-decoration: underline;"&gt;msg:removeHeaderValue(header-name, header-value)&lt;/SPAN&gt; where header- Configured&lt;/STRONG&gt; Action:Rollback Only Resulting Action:Rollback Only In Use Memory:6530 Memory Threshold:51200 In Use Lua Instructions:0 Lua Instruction Threshold:1000 App ID:Cisco CallManager Cluster ID:StandAloneCluster Node ID:&lt;EM style="font-size: 13.3333px;"&gt;MYCUCMNAME&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on this, looks like I have to loop through all the headers twice.&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This behaviour conflicts with &lt;SPAN style="background-color: #f6d5d9;"&gt;&lt;A href="https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/sip_tn/9_1_1/sip_t_n/3-sip_msg.html#wp1075106"&gt;the &lt;/A&gt;&lt;/SPAN&gt;&lt;A href="https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/sip_tn/9_1_1/sip_t_n/3-sip_msg.html#wp1075106"&gt;API guide&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 class="p_H_Head2" style="margin-top: 20px; margin-bottom: 8px; font-weight: 400; font-size: 2.1rem; font-family: CiscoSans, Arial, sans-serif; color: #39393b;"&gt;removeHeader&lt;/H3&gt;&lt;P&gt;&lt;A name="wp1075107" style="font-size: 14px; font-family: CiscoSans, Arial, sans-serif; color: #007fab; margin-top: 0 !important;"&gt;&lt;/A&gt;&lt;/P&gt;&lt;PRE style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: monospace;"&gt;removeHeader(header-name) &lt;/PRE&gt;&lt;P&gt;&lt;A name="wp1075108" style="font-size: 14px; font-family: CiscoSans, Arial, sans-serif; color: #007fab;"&gt;&lt;/A&gt;&lt;A name="wp1075109" style="font-size: 14px; font-family: CiscoSans, Arial, sans-serif; color: #007fab;"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P class="pB1_Body1" style="margin-top: 12px; margin-bottom: 12px; font-size: 14px; font-family: CiscoSans, Arial, sans-serif; color: #58585b;"&gt;Given the string name of a header, this method removes the header from the message.&lt;/P&gt;&lt;P&gt;&lt;A name="wp1075110" style="font-size: 14px; font-family: CiscoSans, Arial, sans-serif; color: #007fab;"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 07:45:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425486#M98</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-08T07:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425487#M99</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting...the error message references the 'removeHeaderValue' function, though you are talking about 'removeHeader'.&amp;nbsp; The former does require an additional parameter (the value to be removed from the header), though I believe you do want to be using removeHeader for your scenario. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is no typo, and you are specifying removeHeader but the interpreter is trying to parse it as removeHeaderValue then this would seem to indicate an issue with the Lua parser in CUCM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can provide a basic sample script that reproduces the problem, along with the full CUCM version, we can probably go ahead and open a defect.&amp;nbsp; I can also suggest opening a ticket with DevNet Developer Support, who can work directly with engineering to analyze the issue in more detail, potentially working towards including a fix in a CUCM 'engineering special' release: &lt;A href="https://developer.cisco.com/site/devnet/support/" title="https://developer.cisco.com/site/devnet/support/"&gt;Cisco DevNet: DevNet Developer Support&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 16:44:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425487#M99</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2017-09-08T16:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425488#M100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, let's back up a second.&amp;nbsp; My deletion for-loop used removeHeaderValue, so I may have (read: &lt;EM&gt;most probably&lt;/EM&gt;) made a copy-paste fail.&amp;nbsp; I'm pretty sure I messed this up, and it's probably a legitimate failure then.&amp;nbsp; This should then work as @mstover suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me re-test on Monday, and will report back.&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;In any case, I'm not gonna pay 250 USD to open a ticket for this, if I'm honest &lt;/SPAN&gt;&lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 20:24:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425488#M100</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-08T20:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425489#M101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tested again.&amp;nbsp; remove API works as expected.&amp;nbsp; I had incorrectly used by &lt;EM style="font-size: 12px; font-family: arial; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;removeHeaderValue &lt;/STRONG&gt;&lt;/EM&gt;mistake.&amp;nbsp; Changing to use a single call to &lt;EM style="font-size: 12px; font-family: arial; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;removeHeader &lt;/STRONG&gt;&lt;/EM&gt;deleted all diversion headers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 08:08:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425489#M101</guid>
      <dc:creator>Jonathan Els</dc:creator>
      <dc:date>2017-09-11T08:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script in Lua: Modifying individual headers within a Header table</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425490#M102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool, glad to hear it worked. Thanks for being persistent.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 12:33:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-in-lua-modifying-individual-headers/m-p/3425490#M102</guid>
      <dc:creator>Mark Stover</dc:creator>
      <dc:date>2017-09-15T12:33:05Z</dc:date>
    </item>
  </channel>
</rss>

