Author |
Message |
pspenn Brekeke Member
Joined: 28 Oct 2009 Posts: 16
Location: Atlanta, GA
|
Posted: Mon Feb 15, 2010 7:12 am Post subject: Need help on how to read and route on Diversion Headers |
|
|
1. Brekeke Product Name and version: 2.4.3.0/286
2. Java version: 1.6.0
3. OS type and the version: RHEL 2.6.18-164.10.1.el5xen
4. UA (phone), gateway or other hardware/software involved:
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html :
6. Your problem:
Hello All, I am looking for some documentation or a little how to on Diversion Headers. Here is what I am looking to do:
Customer calls one of 7000 phone numbers listed in the Yellow Pages. Our call statistics provider receives the call, captures call statistics and then reroutes the call to a single uri with the original called number in the diversion header.
I am almost certain they are doing it this way to prevent a nightmare in their dialplan. The issue is that I need to convert that number in the Diversion header to "TO:user@sip-server". This way my servers know what app to run.
Is it as simple as "Diversion="?
Is there any documentation covering Diversions? I have looked but I don't know if I am looking in the right place.
Thanks for any ideas.
Perry |
|
Back to top |
|
lakeview Brekeke Master Guru
Joined: 15 Nov 2007 Posts: 319
Location: Florida
|
Posted: Mon Feb 22, 2010 1:21 pm Post subject: |
|
|
You can add/replace the Diversion header by DialPlan.
> Is it as simple as "Diversion="?
Yes.
Do you want to add Diversion header in INVITE request packets?
Do you want to add Diversion header in response packets? |
|
Back to top |
|
pspenn Brekeke Member
Joined: 28 Oct 2009 Posts: 16
Location: Atlanta, GA
|
Posted: Fri Feb 26, 2010 5:15 pm Post subject: |
|
|
Thanks for the response. That is great information. What I want to do is read from the diversion header in the invite and then rewrite the header so that what is in the diversion header is now in the To: section.
I am all set up to try some things out so I am going to work on in based on your info.
Thanks again,
Perry |
|
Back to top |
|
pspenn Brekeke Member
Joined: 28 Oct 2009 Posts: 16
Location: Atlanta, GA
|
Posted: Fri Feb 26, 2010 11:45 pm Post subject: |
|
|
After much reading and trial and error, I have finally figured this out. I would like to share just in case someone else is looking for this.
It actually doesn't have very much to do with Diversions other than the fact that they are a URI and I am getting the URI for Diversion and Replacing the URI for To.
Here's what mine looks like:
Code: |
[Matching Pattern]
$request=^INVITE
$geturi(Diversion)=sip:(.+)@Your.com
To=sip:14045551212
[Deploy Pattern]
$target=Your.com
To=sip:%1@your-sip-server.com
$replaceuri=true |
I hope this helps someone.
Thanks,
Perry |
|
Back to top |
|
lakeview Brekeke Master Guru
Joined: 15 Nov 2007 Posts: 319
Location: Florida
|
Posted: Mon Mar 01, 2010 5:04 pm Post subject: |
|
|
Hi Perry,
Cool! Thank you for the info.
Matching Patterns | $request = ^INVITE $geturi(Diversion) = sip:(.+)@(.+) To = sip:14045551212
| Deploy Patterns | $target = %2 To = sip:%1@your-sip-server.com $replaceuri = true
|
This DialPlan rule can be used with any domain not only "Your.com". |
|
Back to top |
|
|