1. Brekeke Product Name and Version:
Brekeke SIP Server - 3.14.5.17/563.2
2. Java version:
11.0.15
3. OS type and the version:
Windows Server 2012
4. UA (phone), gateway or other hardware/software involved:
3CX
5. Your problem:
I want to use $alias.lookup to determine if a number that has been dialed from a PBX connected to BSS, is in the Alias List or not. If it is, then I want to set $rtp = false and if it is not, I want to set $rtp = true, in the Deploy Patterns.
$request = ^INVITE
$registered("UserName") = true
$addr = ^PBX_IP-Address$
To = sip:(.+)@
$alias.lookup("%1") = (.+)
This part works to determine if the number dialed (the To number) is in the Alias List or not. In other programming languages, I would do something like:
IF $alias.lookup("%1") = TRUE THEN
$rtp = false
ELSE
$rtp = true
END IF
How can something like the above be set up in the Dial Plan for BSS?
John Rayfield, Jr.
Using $If in Dial Plan
Moderator: Brekeke Support Team
Use $not
https://docs.brekeke.com/sip/not
[Matching Patterns]
$request = ^INVITE
$registered("UserName") = true
$addr = ^PBX_IP-Address$
To = sip:(.+)@
$not($alias.lookup("%1")) = (.+)
[Deploy Patterns]
$rtp = %2
You can also use $if
[Matching Patterns]
$request = ^INVITE
$registered("UserName") = true
$addr = ^PBX_IP-Address$
To = sip:(.+)@
$if($alias.lookup("%1"),"false","true") = (.+)
[Deploy Patterns]
$rtp = %2
https://docs.brekeke.com/sip/not
[Matching Patterns]
$request = ^INVITE
$registered("UserName") = true
$addr = ^PBX_IP-Address$
To = sip:(.+)@
$not($alias.lookup("%1")) = (.+)
[Deploy Patterns]
$rtp = %2
You can also use $if
[Matching Patterns]
$request = ^INVITE
$registered("UserName") = true
$addr = ^PBX_IP-Address$
To = sip:(.+)@
$if($alias.lookup("%1"),"false","true") = (.+)
[Deploy Patterns]
$rtp = %2
Thanks for these suggestions.
This also helps me to better understand how the BSS programming works overall. In other language that I'm most familiar with, I tended to use Subprograms instead of Functions. I have to remember that with BSS, these are Functions, therefore are returning a result itself, instead of returning results in 'parameters' that are being passed through the Subprogram.
So, I see in the case of using $not, $alias.lookup is returning "true" (so in effect, the Function $alias.lookup = "true", and the $not changes that to $alias.lookup = "false". And since $alias.lookup is in (), it can be retrieved by using %2.
And in the case of using $if, since alias.lookup = "true" or "false", and alias.lookup is in (), then again, the 'value' ("true" or "false") can be retrieved by using %2.
Am I getting closer to understanding how the syntax of BSS dial plan programming works?
John
This also helps me to better understand how the BSS programming works overall. In other language that I'm most familiar with, I tended to use Subprograms instead of Functions. I have to remember that with BSS, these are Functions, therefore are returning a result itself, instead of returning results in 'parameters' that are being passed through the Subprogram.
So, I see in the case of using $not, $alias.lookup is returning "true" (so in effect, the Function $alias.lookup = "true", and the $not changes that to $alias.lookup = "false". And since $alias.lookup is in (), it can be retrieved by using %2.
And in the case of using $if, since alias.lookup = "true" or "false", and alias.lookup is in (), then again, the 'value' ("true" or "false") can be retrieved by using %2.
Am I getting closer to understanding how the syntax of BSS dial plan programming works?
John
John, you are right.
In DialPlan method parameter, there is no data types such as Boolean and Integer. So the true should be written as "true".
If you are familiar with Java, you can develop your own DialPlan method.
https://docs.brekeke.com/sip/bss-dial-p ... pers-guide
In DialPlan method parameter, there is no data types such as Boolean and Integer. So the true should be written as "true".
If you are familiar with Java, you can develop your own DialPlan method.
https://docs.brekeke.com/sip/bss-dial-p ... pers-guide