cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays

Delete the top-most diversion header or change order of Multiple Diversion

1680
Views
0
Helpful
1
Comments
This document was generated from CDN thread

Created by: Rune Heggelund on 07-11-2011 10:36:57 PM
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.

For INVITEs received on a SIP trunk, the following behavior applies:
¿ 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 need to either change the order, or to delete all Diversion headers but the bottom-most diversion header.

Diversion: "nn" <sip:4981@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4983@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4986@172.29.1.12>;reason=unconditional;privacy=off;screen=yes

Subject: RE: Delete the top-most diversion header or change order of Multiple Divers
Replied by: Charles Ragan on 08-11-2011 12:13:55 AM
Rune - what is your call flow?

What is your voicemail system?

Charles

Subject: RE: Delete the top-most diversion header or change order of Multiple Divers
Replied by: Rune Heggelund on 08-11-2011 08:14:32 AM
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.

Subject: RE: Delete the top-most diversion header or change order of Multiple Divers
Replied by: Rune Heggelund on 08-11-2011 01:30:09 PM
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" <sip:4981@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4983@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4986@172.29.1.12>;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: <sip:4980@172.29.1.12?Reason=sip;cause=302;text="unconditional">;index=1
History-Info: <sip:4981@172.29.1.12?Reason=sip;cause=302;text="unconditional">;index=1.1
History-Info: <sip:9999@172.29.1.17:5060>;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.

Subject: RE: Delete the top-most diversion header or change order of Multiple Divers
Replied by: Charles Ragan on 08-11-2011 12:59:36 PM
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

Subject: RE: New Message from Rune Heggelund in Cisco Unified Communications Manager
Replied by: Charles Ragan on 08-11-2011 02:28:06 PM
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" <sip:4981@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4983@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4986@172.29.1.12>;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: <sip:4980@172.29.1.12?Reason=sip;cause=302;text="unconditional">;index=1
History-Info: <sip:4981@172.29.1.12?Reason=sip;cause=302;text="unconditional">;index=1.1
History-Info: <sip:9999@172.29.1.17:5060>;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:

<http://developer.cisco.com/web/sip/forums/-/message_boards/view_message/4725147>

or simply reply to this email.

Subject: RE: New Message from Charles Ragan in Cisco Unified Communications Manager
Replied by: Charles Ragan on 08-11-2011 02:56:06 PM
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" <sip:4981@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4983@172.29.1.12>;reason=unconditional;privacy=off;screen=yes
Diversion: "nn" <sip:4986@172.29.1.12>;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: <sip:4980@172.29.1.12?Reason=sip;cause=302;text="unconditional">;index=1
History-Info: <sip:4981@172.29.1.12?Reason=sip;cause=302;text="unconditional">;index=1.1
History-Info: <sip:9999@172.29.1.17:5060>;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:

<http://developer.cisco.com/web/sip/forums/-/message_boards/view_message/4725147>

or simply reply to this email.
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/sip/forums/-/message_boards/view_message/4727040>

or simply reply to this email.
Comments
Leonard
Beginner

Did you have any luck on this?  As Im trying to modify the diversion headers just as you describe as well.

Content for Community-Ad

This widget could not be displayed.