Author |
Message |
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Wed Jul 03, 2013 8:24 am Post subject: get the number from "TO" OR the "URI" |
|
|
1. Brekeke Product Name and Version: 2.4.8.6/286.3
2. Java version: 1.6.0_31
3. OS type and the version: Windows Server 2008 R2
4. UA (phone), gateway or other hardware/software involved:
5. Your problem: i need to be able to get the phone number from the TO field as well as from the URI
sometimes carriers will send us the calls to the Brekeke using the number in the TO field and some times int he URI (when they send it in the URI the TO has a differen tnumber, the LRN)
this is my current dial plan examples
Matching Patterns | $request = ^INVITE To = sip:(.+)@ To = sip:2124588888
|
Deploy Patterns | $auth = false To = sip:%1@192.168.1.15 $session = failover sip:%1@192.168.1.15 sip:%1@192.168.1.16 &failover.timer.inviting = 5 &failover.timer.provisional = 360 $continue = false
|
i want to see the 2124558888 if its int he TO field or int he URI field (doesnt have to be both) |
|
Back to top |
|
hope Brekeke Master Guru
Joined: 15 Jan 2008 Posts: 862
|
Posted: Wed Jul 03, 2013 9:04 am Post subject: |
|
|
Code: |
sometimes carriers will send us the calls to the Brekeke using the number in the TO field and some times int he URI (when they send it in the URI the TO has a differen tnumber, the LRN) |
Could you give an example?
and which number do you want to use for sending the call to? |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Wed Jul 03, 2013 9:07 am Post subject: |
|
|
i want to look in the TO or the URI for the number specified in the 3rd entry
"To = sip:2124588888"
if it exists in the TO or the URI then it should be considered legit, and i want to send (Deploy) the number i specified int he "To = sip:2124588888" |
|
Back to top |
|
hope Brekeke Master Guru
Joined: 15 Jan 2008 Posts: 862
|
Posted: Wed Jul 03, 2013 1:35 pm Post subject: |
|
|
do you want to use 2124588888 in deploy pattern no matter what number is used in the INVITE from caller?
or caller send INVITE request and the number in the INVITE request line is different from the number in the INVITE To header
if so, which number you want to use in deploy pattern?
the number shown in the INVITE request line or the number in the INVITE To header |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Wed Jul 03, 2013 2:22 pm Post subject: |
|
|
i want to check the Number thats in this line "To=sip:2124588888 "
so if i have
"To=sip:2124447777" then the TO or the URI can have 2124447777
if i have
"To=sip:6178888888" then the TO or URI can have 6178888888
and when i Deploy the call, i want to show the 2124447777 or 6178888888 depends on the "To=sip:xxxxxxxxx" |
|
Back to top |
|
hope Brekeke Master Guru
Joined: 15 Jan 2008 Posts: 862
|
Posted: Wed Jul 03, 2013 4:54 pm Post subject: |
|
|
Matching Patterns | $request = ^INVITE To = sip:(.+)@
| Deploy Patterns | $auth = false To = sip:%1@192.168.1.15 $session = failover sip:%1@192.168.1.15 sip:%1@192.168.1.16 &failover.timer.inviting = 5 &failover.timer.provisional = 360 $continue = false
|
does above dial plan rule work as you need?
how many To headers in the caller INVITE? |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Thu Jul 04, 2013 6:18 am Post subject: |
|
|
No it wont work
i need to specify the exact number
the dial plan i am using works excellent, i just need to add to check for the information in the TO header like it is doing now,
but i need to add to check what it is checking now, OR if it is int he URI |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Fri Jul 05, 2013 11:45 pm Post subject: |
|
|
Izzyg,
What does your "URI" mean??
Are you talking about URI in To header?
or are you talking about Request-URI? |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Sat Jul 06, 2013 12:20 am Post subject: |
|
|
I've tested it in BSS v3.1.7.8
The rule matches if 2124588888 is in To-URI or Request-URI.
Matching Patterns | $request = ^INVITE "2124588888" = (.+) $getUri($request) = sip:(\d*) $getUri(To) = sip:(\d*) $or($str.equals("%1","%2"),$str.equals("%1","%3")) = true
| Deploy Patterns | $auth = false To = sip:%1@192.168.1.15 $session = failover sip:%1@192.168.1.15 sip:%1@192.168.1.16 &failover.timer.inviting = 5 &failover.timer.provisional = 360 $continue = false
|
|
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Sun Jul 07, 2013 5:09 pm Post subject: |
|
|
i am on Version 2.
should it work fine ? |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Sun Jul 07, 2013 5:16 pm Post subject: |
|
|
just tested and it seems to work
so i understand and learn, can you explain to me what each line does?
thanks so much |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Mon Jul 08, 2013 7:15 am Post subject: |
|
|
whats an easy way to edit multiple dial plans (over 2000) and add the new lines to it ? |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Mon Jul 08, 2013 9:05 am Post subject: |
|
|
i just had a chance to reach out to the carrier that we had an issue with
they sent us the call, the phone number was only in the Request-Line: INVITE sip:phonenumber@ip:port SIP/2.0
in the To field it had a different number <sip:wrongnumber@ip>
and the brekeke rejected the call, i assume because it didnt find the phonenumber in the URI?
is that above rule you asked me to use looking for the phonenumber in the To OR in the Request-URI ? |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Mon Jul 08, 2013 8:34 pm Post subject: |
|
|
Yes
---------------------------------------
$request = ^INVITE
"phonenumber" = (.+)
$getUri($request) = sip:(\d*)
$getUri(To) = sip:(\d*)
$or($str.equals("%1","%2"),$str.equals("%1","%3")) = true
---------------------------------------
The above definition will be fulfilled if phonenumber is shown in Request-Line or To header |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Mon Jul 08, 2013 8:47 pm Post subject: |
|
|
> whats an easy way to edit multiple dial plans (over 2000) and add the new lines to it ?
If you use Alias, you don't have to create multiple rules if they look same. |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Mon Jul 08, 2013 8:53 pm Post subject: |
|
|
> so i understand and learn, can you explain to me what each line does?
$request = ^INVITE
if Request-Line is INVITE
"2124588888" = (.+)
2124588888 --> %1
$getUri($request) = sip:(\d*)
Request-URI's digits --> %2
$getUri(To) = sip:(\d*)
To-URI's digits --> %3
$or($str.equals("%1","%2"),$str.equals("%1","%3")) = true
if %1 is same as %2 -or- %2 is same as %3 |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Tue Jul 09, 2013 4:29 am Post subject: |
|
|
$request = ^INVITE
if Request-Line is INVITE
"2124588888" = (.+)
2124588888 --> %1
$getUri($request) = sip:(\d*)
Request-URI's digits --> %2
$getUri(To) = sip:(\d*)
To-URI's digits --> %3
$or($str.equals("%1","%2"),$str.equals("%1","%3")) = true
if %1 is same as %2 -or- %2 is same as %
what i want the rule to be, if %1 is same as %2 or %3 |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Tue Jul 09, 2013 11:33 am Post subject: |
|
|
$or($str.equals("%1","%2"),$str.equals("%1","%3")) = true
correction: if %1 is same as %2 -or- %1 is same as %3
Let you test yourself. |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Tue Jul 09, 2013 11:37 am Post subject: |
|
|
i tried it earlier and ti didnt work |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Tue Jul 09, 2013 11:39 am Post subject: |
|
|
Use Brekeke SIP Server 3.1 |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Tue Jul 09, 2013 11:48 am Post subject: |
|
|
is it possible to get it working in V2?
not sure if i want to buy a license just for this option ? |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Tue Jul 09, 2013 12:01 pm Post subject: |
|
|
I tested the above dialplan definition in ver 3.1.7.8.
I don't have v2.
You can download an evaluation version from brekeke's web. |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Wed Jul 17, 2013 9:02 am Post subject: |
|
|
can anyone advise how to do it in V2? |
|
Back to top |
|
Tata Brekeke Master Guru
Joined: 27 Jan 2008 Posts: 223
|
Posted: Wed Jul 17, 2013 10:35 am Post subject: |
|
|
Have you tested the above dialplan rule but didn't work? |
|
Back to top |
|
Izzyg Brekeke Talented
Joined: 25 Jun 2013 Posts: 91
Location: Sip Land
|
Posted: Thu Jul 18, 2013 10:10 am Post subject: |
|
|
thats correct |
|
Back to top |
|
|