Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
get the number from "TO" OR the "URI" Goto page 1, 2  Next
Author Message
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Wed Jul 03, 2013 8:24 am    Post subject: get the number from "TO" OR the "URI" Reply with quote

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
View user's profile
hope
Brekeke Master Guru


Joined: 15 Jan 2008
Posts: 862

PostPosted: Wed Jul 03, 2013 9:04 am    Post subject: Reply with quote

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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Wed Jul 03, 2013 9:07 am    Post subject: Reply with quote

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
View user's profile
hope
Brekeke Master Guru


Joined: 15 Jan 2008
Posts: 862

PostPosted: Wed Jul 03, 2013 1:35 pm    Post subject: Reply with quote

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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Wed Jul 03, 2013 2:22 pm    Post subject: Reply with quote

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
View user's profile
hope
Brekeke Master Guru


Joined: 15 Jan 2008
Posts: 862

PostPosted: Wed Jul 03, 2013 4:54 pm    Post subject: Reply with quote


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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Thu Jul 04, 2013 6:18 am    Post subject: Reply with quote

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
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Fri Jul 05, 2013 11:45 pm    Post subject: Reply with quote

Izzyg,

What does your "URI" mean??
Are you talking about URI in To header?
or are you talking about Request-URI?
Back to top
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Sat Jul 06, 2013 12:20 am    Post subject: Reply with quote

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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Sun Jul 07, 2013 5:09 pm    Post subject: Reply with quote

i am on Version 2.

should it work fine ?
Back to top
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Sun Jul 07, 2013 5:16 pm    Post subject: Reply with quote

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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Mon Jul 08, 2013 7:15 am    Post subject: Reply with quote

whats an easy way to edit multiple dial plans (over 2000) and add the new lines to it ?
Back to top
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Mon Jul 08, 2013 9:05 am    Post subject: Reply with quote

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
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Mon Jul 08, 2013 8:34 pm    Post subject: Reply with quote

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
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Mon Jul 08, 2013 8:47 pm    Post subject: Reply with quote

> 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
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Mon Jul 08, 2013 8:53 pm    Post subject: Reply with quote

> 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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Tue Jul 09, 2013 4:29 am    Post subject: Reply with quote

$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
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Tue Jul 09, 2013 11:33 am    Post subject: Reply with quote

$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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Tue Jul 09, 2013 11:37 am    Post subject: Reply with quote

i tried it earlier and ti didnt work
Back to top
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Tue Jul 09, 2013 11:39 am    Post subject: Reply with quote

Use Brekeke SIP Server 3.1
Back to top
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Tue Jul 09, 2013 11:48 am    Post subject: Reply with quote

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
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Tue Jul 09, 2013 12:01 pm    Post subject: Reply with quote

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
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Wed Jul 17, 2013 9:02 am    Post subject: Reply with quote

can anyone advise how to do it in V2?
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Wed Jul 17, 2013 10:35 am    Post subject: Reply with quote

Have you tested the above dialplan rule but didn't work?
Back to top
View user's profile
Izzyg
Brekeke Talented


Joined: 25 Jun 2013
Posts: 91
Location: Sip Land

PostPosted: Thu Jul 18, 2013 10:10 am    Post subject: Reply with quote

thats correct
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2