<?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 CUCM Lua script assistance. in Call Control</title>
    <link>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4635048#M3275</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with the Lua scripting. I have created the below response normalization Lua script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M={}&lt;BR /&gt;function M.outbound_404_INVITE(msg)&lt;BR /&gt;msg:setResponseCode(406, "Not Accepted")&lt;BR /&gt;end&lt;BR /&gt;return M&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is applied on the SIP trunk to the ITSP. I need to modify the 404 response to 406 so that the SBC stops hunting for the next server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting these errors from the logs. I tried to check online with the Lua script c&lt;SPAN&gt;ompiler&amp;nbsp;but was unable to verify the script as I dont have much experience&amp;nbsp;with scripting.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;30492831.003 |13:07:49.521 |AppInfo |//SIPLua/Info/Load and Init successful: de vice XXXXXX-XXX script Response_test module M max mem 51200 warning mem 40960&lt;BR /&gt;30492831.004 |13:07:49.523 |AppInfo |//SIPLua/Info/Device:XXXXX Script:R esponse_test -- base script memory 19604 user script memory 408&lt;BR /&gt;30492987.001 |13:08:20.967 |AppInfo |//SIPLua/Error/SipContexts_removeContext: call contexts object is missing&lt;BR /&gt;30493044.001 |13:08:21.146 |AppInfo |//SIPLua/Error/SipContexts_removeContext: call contexts object is missing&lt;BR /&gt;30493100.001 |13:08:21.632 |AppInfo |//SIPLua/Error/SipContexts_removeContext: call contexts object is missing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Rus&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jun 2022 14:44:25 GMT</pubDate>
    <dc:creator>RG84</dc:creator>
    <dc:date>2022-06-20T14:44:25Z</dc:date>
    <item>
      <title>CUCM Lua script assistance.</title>
      <link>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4635048#M3275</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with the Lua scripting. I have created the below response normalization Lua script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M={}&lt;BR /&gt;function M.outbound_404_INVITE(msg)&lt;BR /&gt;msg:setResponseCode(406, "Not Accepted")&lt;BR /&gt;end&lt;BR /&gt;return M&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is applied on the SIP trunk to the ITSP. I need to modify the 404 response to 406 so that the SBC stops hunting for the next server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting these errors from the logs. I tried to check online with the Lua script c&lt;SPAN&gt;ompiler&amp;nbsp;but was unable to verify the script as I dont have much experience&amp;nbsp;with scripting.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;30492831.003 |13:07:49.521 |AppInfo |//SIPLua/Info/Load and Init successful: de vice XXXXXX-XXX script Response_test module M max mem 51200 warning mem 40960&lt;BR /&gt;30492831.004 |13:07:49.523 |AppInfo |//SIPLua/Info/Device:XXXXX Script:R esponse_test -- base script memory 19604 user script memory 408&lt;BR /&gt;30492987.001 |13:08:20.967 |AppInfo |//SIPLua/Error/SipContexts_removeContext: call contexts object is missing&lt;BR /&gt;30493044.001 |13:08:21.146 |AppInfo |//SIPLua/Error/SipContexts_removeContext: call contexts object is missing&lt;BR /&gt;30493100.001 |13:08:21.632 |AppInfo |//SIPLua/Error/SipContexts_removeContext: call contexts object is missing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Rus&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 14:44:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4635048#M3275</guid>
      <dc:creator>RG84</dc:creator>
      <dc:date>2022-06-20T14:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM Lua script assistance.</title>
      <link>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4640964#M3286</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1369008"&gt;@RG84&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found three resources to help you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1. Configure SIP Normalization Script in CCM -&amp;nbsp;Configuration Examples and TechNotes&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.cisco.com/c/en/us/support/docs/unified-communications/unified-communications-manager-callmanager/213516-configure-sip-normalization-script-in-cc.html" target="_blank"&gt;https://www.cisco.com/c/en/us/support/docs/unified-communications/unified-communications-manager-callmanager/213516-configure-sip-normalization-script-in-cc.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. A guide to SIP Normalization on CUCM and Lua Scripting&lt;/STRONG&gt; - Examples given (please note this discussion is several pages long)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.cisco.com/t5/collaboration-voice-and-video/a-guide-to-sip-normalization-on-cucm-and-lua-scripting/ba-p/3099409" target="_blank"&gt;https://community.cisco.com/t5/collaboration-voice-and-video/a-guide-to-sip-normalization-on-cucm-and-lua-scripting/ba-p/3099409&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3. CUCM-Lua - An &lt;EM&gt;External&lt;/EM&gt; GitHub repo with 5 Lua script examples&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/gj0nyg/CUCM-Lua" target="_blank"&gt;https://github.com/gj0nyg/CUCM-Lua&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 16:36:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4640964#M3286</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2022-06-29T16:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM Lua script assistance.</title>
      <link>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4642598#M3292</link>
      <description>&lt;P&gt;Hi Rus,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this the full content of your script? When you configure the script from CUCM Admin page,&amp;nbsp; by default, max threshold allowed for your script is 50k, that's why you're getting the mem warning.&amp;nbsp; You can increase this value depending on the complexity of your script. Make sure you don't use too many global variables or too many functions. &lt;BR /&gt;&lt;SPAN class="markedContent"&gt;&lt;SPAN class=""&gt;If this API is invoked for a request, it triggers a &lt;SPAN class="highlight selected appended"&gt;run-time error&lt;/SPAN&gt;. That's probably why you're seeing the "call contexts object is missing".&lt;BR /&gt;&amp;nbsp;Try to use trace.enable and trace.format to print out the SIP msg/headers while testing your script to see what's going on and why you're getting the errors. Hope that helps.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 19:26:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/cucm-lua-script-assistance/m-p/4642598#M3292</guid>
      <dc:creator>davidn#</dc:creator>
      <dc:date>2022-07-01T19:26:09Z</dc:date>
    </item>
  </channel>
</rss>

