<?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>Delete the top-most diversion header or change order of Multiple Diversion</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=4721500" />
  <subtitle>Delete the top-most diversion header or change order of Multiple Diversion</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=4721500</id>
  <updated>2013-05-26T00:44:16Z</updated>
  <dc:date>2013-05-26T00:44:16Z</dc:date>
  <entry>
    <title>RE: New Message from Charles Ragan in Cisco Unified Communications Manager</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4727078" />
    <author>
      <name>Charles Ragan</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4727078</id>
    <updated>2011-11-08T20:56:06Z</updated>
    <published>2011-11-08T20:56:06Z</published>
    <summary type="html">Rune ¿ if the pai is there (it would be the original To:  I believe) ¿ you should be able to do something similar to...

M = {}
function M.outbound_INVITE(msg)
    local uri = msg:getUri("P-Asserted-Identity")
msg:removeHeader("Diversion")
msg:addHeader("Diversion", uri)
end
return M

Rune Heggelund has created a new message in the forum "SIP Transparency and Normalization Questions":

--------------------------------------------------------------
Thank you for replying.

The setup is as follow;
pstn-----sip----cucm-----sip------trio-vmail

I can apply the script at the outgoing invite to the trio-vmail.
I still need some help to create the script.

Here is what sendt in the Invite header;
Diversion: "nn" &lt;sip:4981@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4983@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4986@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes

If I convert the diversion headers into History-Info headers for outbound INVITE messages. And then remove the Diversion header. This is what I got;

M = {}
function M.outbound_INVITE(msg)
if msg:getHeader("Diversion")
then
msg:convertDiversionToHI()
msg:removeHeader("Diversion")
end
end
return M

History-Info: &lt;sip:4980@172.29.1.12?Reason=sip;cause=302;text="unconditional"&gt;;index=1
History-Info: &lt;sip:4981@172.29.1.12?Reason=sip;cause=302;text="unconditional"&gt;;index=1.1
History-Info: &lt;sip:9999@172.29.1.17:5060&gt;;index=1.1.1

The Trio System understands both diversion headers and History-Info headers.

If I first convert the diversion headers into History-Info headers, then I got information I need in index=1.
If I now remove all other index lines everything should be ok.
--
To respond to this post, please click the following link:

&lt;http://developer.cisco.com/web/sip/forums/-/message_boards/view_message/4725147&gt;

or simply reply to this email.
--
To respond to this post, please click the following link:

&lt;http://developer.cisco.com/web/sip/forums/-/message_boards/view_message/4727040&gt;

or simply reply to this email.</summary>
    <dc:creator>Charles Ragan</dc:creator>
    <dc:date>2011-11-08T20:56:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: New Message from Rune Heggelund in Cisco Unified Communications Manager</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4727040" />
    <author>
      <name>Charles Ragan</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4727040</id>
    <updated>2011-11-08T20:28:06Z</updated>
    <published>2011-11-08T20:28:06Z</published>
    <summary type="html">Ahh..okay.  So trio can¿t choose between 1st redirect or last redirect?  ¿

In the values below ¿ what is the numbering scheme for the ¿nn¿ on the dh¿s?



From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, November 08, 2011 1:30 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Rune Heggelund in Cisco Unified Communications Manager SIP (SIP) - SIP Transparency and Normalization Questions: RE: Delete the top-most diversion header or change order of Multiple Divers

Rune Heggelund has created a new message in the forum "SIP Transparency and Normalization Questions":

--------------------------------------------------------------
Thank you for replying.

The setup is as follow;
pstn-----sip----cucm-----sip------trio-vmail

I can apply the script at the outgoing invite to the trio-vmail.
I still need some help to create the script.

Here is what sendt in the Invite header;
Diversion: "nn" &lt;sip:4981@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4983@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4986@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes

If I convert the diversion headers into History-Info headers for outbound INVITE messages. And then remove the Diversion header. This is what I got;

M = {}
function M.outbound_INVITE(msg)
if msg:getHeader("Diversion")
then
msg:convertDiversionToHI()
msg:removeHeader("Diversion")
end
end
return M

History-Info: &lt;sip:4980@172.29.1.12?Reason=sip;cause=302;text="unconditional"&gt;;index=1
History-Info: &lt;sip:4981@172.29.1.12?Reason=sip;cause=302;text="unconditional"&gt;;index=1.1
History-Info: &lt;sip:9999@172.29.1.17:5060&gt;;index=1.1.1

The Trio System understands both diversion headers and History-Info headers.

If I first convert the diversion headers into History-Info headers, then I got information I need in index=1.
If I now remove all other index lines everything should be ok.
--
To respond to this post, please click the following link:

&lt;http://developer.cisco.com/web/sip/forums/-/message_boards/view_message/4725147&gt;

or simply reply to this email.</summary>
    <dc:creator>Charles Ragan</dc:creator>
    <dc:date>2011-11-08T20:28:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Delete the top-most diversion header or change order of Multiple Divers</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4725147" />
    <author>
      <name>Rune Heggelund</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4725147</id>
    <updated>2011-11-08T19:30:09Z</updated>
    <published>2011-11-08T19:30:09Z</published>
    <summary type="html">Thank you for replying. 

The setup is as follow;
pstn-----sip----cucm-----sip------trio-vmail

I can apply the script at the outgoing invite to the trio-vmail.
I still need some help to create the script. 

Here is what sendt in the Invite header;
Diversion: "nn" &lt;sip:4981@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4983@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4986@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes

If I convert the diversion headers into History-Info headers for outbound INVITE messages. And then remove the Diversion header.  This is what I got;

M = {}
function M.outbound_INVITE(msg) 
if msg:getHeader("Diversion") 
then 
msg:convertDiversionToHI() 
msg:removeHeader("Diversion") 
end
end
return M

[b]History-Info: &lt;sip:4980@172.29.1.12?Reason=sip;cause=302;text="unconditional"&gt;;index=1[/b]
History-Info: &lt;sip:4981@172.29.1.12?Reason=sip;cause=302;text="unconditional"&gt;;index=1.1
History-Info: &lt;sip:9999@172.29.1.17:5060&gt;;index=1.1.1

The Trio System understands both diversion headers and History-Info headers.

If I first convert the diversion headers into History-Info headers, then I got information I need in index=1. 
If I now remove all other index lines everything should be ok.</summary>
    <dc:creator>Rune Heggelund</dc:creator>
    <dc:date>2011-11-08T19:30:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: Delete the top-most diversion header or change order of Multiple Divers</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4726842" />
    <author>
      <name>Charles Ragan</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4726842</id>
    <updated>2011-11-08T18:59:36Z</updated>
    <published>2011-11-08T18:59:36Z</published>
    <summary type="html">Okay, but the call flow is what?

pstn-----sip----cucm-----sip?------trio-vmail


Is your integration from cucm to trio a sip trunk as well?

Obviously, this will determine where you apply your script.

Also, the next thing you need to do is set up a place where you can make packet captures.  This will give you an idea of what values you have for attempting to repopulate the dh with the original called number.

For example, a way to reach back into the originally called number, may be the PAI header.  At this point, you could possibly do logic similar to:

-gather pai header
-remove dh 
-add dh
-repopulate dh with pai

A lot will depend on your call flow.
Charles</summary>
    <dc:creator>Charles Ragan</dc:creator>
    <dc:date>2011-11-08T18:59:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: Delete the top-most diversion header or change order of Multiple Divers</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4724492" />
    <author>
      <name>Rune Heggelund</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4724492</id>
    <updated>2011-11-08T14:14:32Z</updated>
    <published>2011-11-08T14:14:32Z</published>
    <summary type="html">Hi!

This is an attendant system (Trio Enterprise). 
The system is not able to interoperate the diversion header different. I need a SIP Normalization Scripts that change the header. 
Support both diversion and history header.</summary>
    <dc:creator>Rune Heggelund</dc:creator>
    <dc:date>2011-11-08T14:14:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Delete the top-most diversion header or change order of Multiple Divers</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4723530" />
    <author>
      <name>Charles Ragan</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4723530</id>
    <updated>2011-11-08T06:13:55Z</updated>
    <published>2011-11-08T06:13:55Z</published>
    <summary type="html">Rune - what is your call flow?

What is your voicemail system?

Charles</summary>
    <dc:creator>Charles Ragan</dc:creator>
    <dc:date>2011-11-08T06:13:55Z</dc:date>
  </entry>
  <entry>
    <title>Delete the top-most diversion header or change order of Multiple Diversion</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4721499" />
    <author>
      <name>Rune Heggelund</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4721499</id>
    <updated>2011-11-08T05:22:42Z</updated>
    <published>2011-11-08T04:36:57Z</published>
    <summary type="html">I want to change how a voicemail system treats a diverted call. 

Calls that are diverted multiple times and eventually sent to a voicemail system are presented with the mailbox for the last forwarding party. 
I need a script that makes the voicemail system play the original called numbers mailbox. 

[b]For INVITEs received on a SIP trunk, the following behavior applies: [/b]
[i]¿ If multiple diversion headers are present in the incoming message, the bottom-most diversion header determines the original called number. The top-most diversion header determines the last forwarding party and diversion reason.
[/i]
 
I need to either change the order, or to delete all Diversion headers but the bottom-most diversion header.

Diversion: "nn" &lt;sip:4981@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4983@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" &lt;sip:4986@172.29.1.12&gt;;reason=unconditional;privacy=off;screen=yes</summary>
    <dc:creator>Rune Heggelund</dc:creator>
    <dc:date>2011-11-08T04:36:57Z</dc:date>
  </entry>
</feed>

