<?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 to modify FROM header in Call Control</title>
    <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591987#M2322</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;Do you want the script to change it on outbound direction or inbound direction? It's straightforward if you want to add an inbound section. You just need a corresponding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M.inbound_INVITE(msg)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before the "return M"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Dec 2017 13:00:23 GMT</pubDate>
    <dc:creator>Mark Stover</dc:creator>
    <dc:date>2017-12-04T13:00:23Z</dc:date>
    <item>
      <title>SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591982#M2317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hello. I'm looking to remove and replace the FROM header as the invite ingresses from Skype for Business into CUCM. Would the below script accomplish this? The invite currently just says "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:first.last@test.com"&gt;first.last@test.com&lt;/A&gt;&lt;SPAN&gt;:10.1.1.1". I'm looking to replace it with a phone number so its routable. Any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M={}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function M.outbound_INVITE(msg)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; local from = msg:getHeader("FROM")&amp;nbsp; --Get FROM Header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; local b = string.gsub(from, "(&amp;lt;sip:.+@)", "&amp;lt;sip:5551112222")&amp;nbsp; --New FROM Header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg:modifyHeader("From", b)&amp;nbsp; --Replace FROM Header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 21:16:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591982#M2317</guid>
      <dc:creator>Robert Craig</dc:creator>
      <dc:date>2017-06-05T21:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591983#M2318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Have moved your question under UC Manager SIP community. Please refer this url for related information&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.cisco.com/thread/73584?start=0&amp;amp;tstart=0" title="https://communities.cisco.com/thread/73584?start=0&amp;amp;tstart=0"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;https://communities.cisco.com/thread/73584?start=0&amp;amp;tstart=0&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Geevarghese&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2017 02:51:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591983#M2318</guid>
      <dc:creator>Geevarghese Cheria</dc:creator>
      <dc:date>2017-07-03T02:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591984#M2319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the SIP INVITE is being received by Unified CM from S4B, it is an "inbound_INVITE" from the perspective of SIP Normalization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, There's a couple other minor tweaks I would make to your above...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;M={}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;function M.outbound_INVITE(msg)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; local from = msg:getHeader("From")&amp;nbsp; --Get FROM Header&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; local b = string.gsub(from, "&amp;lt;sip:.+@", "&amp;lt;sip:5551112222@")&amp;nbsp; --New FROM Header&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; msg:modifyHeader("From", b)&amp;nbsp; --Replace FROM Header&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;return M&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;I always use header names using a format of "From" rather than "FROM".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Since you aren't trying to 'capture' what you matched, the () in your match string aren't needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 12:55:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591984#M2319</guid>
      <dc:creator>Mark Stover</dc:creator>
      <dc:date>2017-07-07T12:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591985#M2320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 13:37:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591985#M2320</guid>
      <dc:creator>Robert Craig</dc:creator>
      <dc:date>2017-07-07T13:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591986#M2321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. Is there a way to modify this script to capture From header "unknown" or "anonymous" and change it to say +1234567890 under the same script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2017 21:26:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591986#M2321</guid>
      <dc:creator>nalonsovoip</dc:creator>
      <dc:date>2017-12-01T21:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591987#M2322</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;Do you want the script to change it on outbound direction or inbound direction? It's straightforward if you want to add an inbound section. You just need a corresponding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M.inbound_INVITE(msg)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before the "return M"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2017 13:00:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591987#M2322</guid>
      <dc:creator>Mark Stover</dc:creator>
      <dc:date>2017-12-04T13:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591988#M2323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI. I know how to change directions. What I’m not sure is how to make the script change the From header based on multiple “From” header values like Unknown, anonymous and Restricted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2017 13:34:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3591988#M2323</guid>
      <dc:creator>nalonsovoip</dc:creator>
      <dc:date>2017-12-04T13:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: SIP Normalization Script to modify FROM header</title>
      <link>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3774143#M2641</link>
      <description>Hello Mark,&lt;BR /&gt;&lt;BR /&gt;Can we have inbound and outbound in the same script, Inbound script is working but when it comes to outbound, it still displaying the messages, which we dont want. Outbound call is made by the CCB funtionality. &lt;BR /&gt;&lt;BR /&gt;M = {}&lt;BR /&gt;function M.inbound_ANY(msg)&lt;BR /&gt;  local from = msg:getHeader("Remote-Party-ID")&lt;BR /&gt;  if (from ~= nil) then &lt;BR /&gt;    from = string.gsub(from, "--CVP[_0-9]*", "")&lt;BR /&gt;    msg:modifyHeader("Remote-Party-ID", from )&lt;BR /&gt;  end&lt;BR /&gt;end&lt;BR /&gt;function M.outbound_ANY_ANY(msg)&lt;BR /&gt;  local from = msg:getHeader("Remote-Party-ID")&lt;BR /&gt;  if (from ~= nil) then &lt;BR /&gt;    from = string.gsub(from, "--CVP[_0-9]*", "")&lt;BR /&gt;    msg:modifyHeader("Remote-Party-ID", from )&lt;BR /&gt;  end&lt;BR /&gt;end&lt;BR /&gt;return M&lt;BR /&gt;&lt;BR /&gt;Can you let us know if that work ?</description>
      <pubDate>Mon, 07 Jan 2019 14:19:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/sip-normalization-script-to-modify-from-header/m-p/3774143#M2641</guid>
      <dc:creator>sharath_gudimella12</dc:creator>
      <dc:date>2019-01-07T14:19:35Z</dc:date>
    </item>
  </channel>
</rss>

