Simple Dial Plan for Incoming Calls
Moderator: Brekeke Support Team
Simple Dial Plan for Incoming Calls
1. Brekeke Product Name and Version:
Brekeke SIP Server 3 (BSS3)
2. Java version:
Not sure
3. OS type and the version:
Windows 7 Pro
4. UA (phone), gateway or other hardware/software involved:
3CX IP PBX Server
5. Your problem:
I have BSS3 connected to my underlying VoIP service provider. This connection is authenticated by IP address. It is not 'registered' with username/password.
I have a 3CX IP PBX connected to BSS3. This connection is registered.
BSS3 is one one network (with a public IP address) and the 3CX IP PBX is on another network (with a different public IP address).
I have an outbound dial plan that works fine, so that I can make outbound calls from the 3CX system through BSS3.
I need to create a dial plan that will route incoming calls, from my underlying VoIP service provider, through BSS3, and into the 3CX IP PBX.
I've tried the following.
The "12223334444" is the DID telephone number (obviously, this is not the 'real' number that I'm using).
The "xxx.xxx.xxx.xxx" is the public IP address of the 3CX IP PBX server.
Matching Pattern:
$request = INVITE
To = 12223334444@xxx.xxx.xxx.xxx
Deploy Pattern:
$rtp = TRUE
To = sip:12223334444@xxx.xxx.xxx.xxx
When I try making a call to the DID telephone number, a packet capture on the BSS3 server doesn't show it ever trying to pass anything on to the 3CX IP PBX server.
What am I doing wrong?
John Rayfield, Jr.
Brekeke SIP Server 3 (BSS3)
2. Java version:
Not sure
3. OS type and the version:
Windows 7 Pro
4. UA (phone), gateway or other hardware/software involved:
3CX IP PBX Server
5. Your problem:
I have BSS3 connected to my underlying VoIP service provider. This connection is authenticated by IP address. It is not 'registered' with username/password.
I have a 3CX IP PBX connected to BSS3. This connection is registered.
BSS3 is one one network (with a public IP address) and the 3CX IP PBX is on another network (with a different public IP address).
I have an outbound dial plan that works fine, so that I can make outbound calls from the 3CX system through BSS3.
I need to create a dial plan that will route incoming calls, from my underlying VoIP service provider, through BSS3, and into the 3CX IP PBX.
I've tried the following.
The "12223334444" is the DID telephone number (obviously, this is not the 'real' number that I'm using).
The "xxx.xxx.xxx.xxx" is the public IP address of the 3CX IP PBX server.
Matching Pattern:
$request = INVITE
To = 12223334444@xxx.xxx.xxx.xxx
Deploy Pattern:
$rtp = TRUE
To = sip:12223334444@xxx.xxx.xxx.xxx
When I try making a call to the DID telephone number, a packet capture on the BSS3 server doesn't show it ever trying to pass anything on to the 3CX IP PBX server.
What am I doing wrong?
John Rayfield, Jr.
I'm slowly learning how to set up these Dial Plans. They aren't what I would call 'easy', but not extremely hard either (if you know what you're doing <G>).
I ended up with this:
Matching Pattern:
$request = ^INVITE
$geturi(To) = 12223334444@
$geturi(From) = @xxx.xxx.xxx.xxx
Deploy Pattern:
$rtp = true
$target = sip:%1@xxx.xxx.xxx.xxx
This requires an incoming INVITE from the underlying carrier to include the proper DID number (the number that the caller has called) and to come from a specific IP address (the IP address of my underlying carrier). It then passes the INVITE on to the 3CX IP PBX that is registered with BSS for use with this DID number.
John
I ended up with this:
Matching Pattern:
$request = ^INVITE
$geturi(To) = 12223334444@
$geturi(From) = @xxx.xxx.xxx.xxx
Deploy Pattern:
$rtp = true
$target = sip:%1@xxx.xxx.xxx.xxx
This requires an incoming INVITE from the underlying carrier to include the proper DID number (the number that the caller has called) and to come from a specific IP address (the IP address of my underlying carrier). It then passes the INVITE on to the 3CX IP PBX that is registered with BSS for use with this DID number.
John
If y.y.y.y is the VoIP service provider's IP address, and x.x.x.x is the 3CX's IP address.
Matching Patterns
$addr = ^y.y.y.y$
$request = ^INVITE
To = sip:12223334444@
Deploy Patterns
$rtp = true
To = sip:%1@x.x.x.x
If you use "$geturi(From) = @xxx.xxx.xxx.xxx" for checking whether the caller is the VoIP service provider or not, I recommend you use $addr instead.
http://wiki.brekeke.com/wiki/DialPlan-Matching-addr
This is because someone (such as an attacker) can pretend the VoIP provider if he/she uses the same From-header .
Matching Patterns
$addr = ^y.y.y.y$
$request = ^INVITE
To = sip:12223334444@
Deploy Patterns
$rtp = true
To = sip:%1@x.x.x.x
If you use "$geturi(From) = @xxx.xxx.xxx.xxx" for checking whether the caller is the VoIP service provider or not, I recommend you use $addr instead.
http://wiki.brekeke.com/wiki/DialPlan-Matching-addr
This is because someone (such as an attacker) can pretend the VoIP provider if he/she uses the same From-header .
Ok.
I understand why using $addr is better, for the sake of security.
Why use "To =" instead of "$geturi(To) ="? I tried both, and both of them work.
I tried using "To =" in the Deploy Pattern, but it wouldn't work. Looking at the SIP messages, the "To" line ends up looking like this:
To = sip:%1@xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the IP address of the 3CX server.
In other words, the "%1" was not replaced with the telephone number.
Using Target = sip:%1@xxx.xxx.xxx.xxx
works fine.
John
I understand why using $addr is better, for the sake of security.
Why use "To =" instead of "$geturi(To) ="? I tried both, and both of them work.
I tried using "To =" in the Deploy Pattern, but it wouldn't work. Looking at the SIP messages, the "To" line ends up looking like this:
To = sip:%1@xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the IP address of the 3CX server.
In other words, the "%1" was not replaced with the telephone number.
Using Target = sip:%1@xxx.xxx.xxx.xxx
works fine.
John
> I understand why using $addr is better, for the sake of security.
Any SIP headers (such as From and To) can be manipulated by sender or middle-entity (such as a router) because SIP content is text-based.
However, generally, source IP address/port information in IP/TCP/UDP header is not manipulated.
> Why use "To =" instead of "$geturi(To) ="? I tried both, and both of them work.
"To=" evaluates entire To-header line.
"$geturi(To)=" evaluates SIP-URI in To-header.
http://wiki.brekeke.com/wiki/DialPlan-Matching-getUri
For example, if INVITE's To-header looks like the following.
To: "Mike" <sip:12223334444@x.x.x.x;user=phone>
"To=" evaluates "Mike" <sip:12223334444@x.x.x.x;user=phone>
"$geturi(To)=" evaluates sip:12223334444@x.x.x.x
Since both strings contain "sip:12223334444@", both definitions work.
I recommend you use "To=" instead of "$geturi(To)=" in the above case to avoid an internal method call.
> I tried using "To =" in the Deploy Pattern, but it wouldn't work.
> Looking at the SIP messages, the "To" line ends up looking like this:
This is because you don't have definition for %1.
Modify the Matching Patterns like the following.
Matching Patterns
$addr = ^y.y.y.y$
$request = ^INVITE
To = sip:(12223334444)@
Enclose 12223334444 with (). If so 12223334444 will be stored into %1.
> Using Target = sip:%1@xxx.xxx.xxx.xxx
This is because $target uses IP address/FQDN part only.
Any SIP headers (such as From and To) can be manipulated by sender or middle-entity (such as a router) because SIP content is text-based.
However, generally, source IP address/port information in IP/TCP/UDP header is not manipulated.
> Why use "To =" instead of "$geturi(To) ="? I tried both, and both of them work.
"To=" evaluates entire To-header line.
"$geturi(To)=" evaluates SIP-URI in To-header.
http://wiki.brekeke.com/wiki/DialPlan-Matching-getUri
For example, if INVITE's To-header looks like the following.
To: "Mike" <sip:12223334444@x.x.x.x;user=phone>
"To=" evaluates "Mike" <sip:12223334444@x.x.x.x;user=phone>
"$geturi(To)=" evaluates sip:12223334444@x.x.x.x
Since both strings contain "sip:12223334444@", both definitions work.
I recommend you use "To=" instead of "$geturi(To)=" in the above case to avoid an internal method call.
> I tried using "To =" in the Deploy Pattern, but it wouldn't work.
> Looking at the SIP messages, the "To" line ends up looking like this:
This is because you don't have definition for %1.
Modify the Matching Patterns like the following.
Matching Patterns
$addr = ^y.y.y.y$
$request = ^INVITE
To = sip:(12223334444)@
Enclose 12223334444 with (). If so 12223334444 will be stored into %1.
> Using Target = sip:%1@xxx.xxx.xxx.xxx
This is because $target uses IP address/FQDN part only.
> So, why have:
> addr$ = ^xxx.xxx.xxx.xxx$
For example
$addr = 1.2.3.4 will match several IP addresses.
such as 111.2.3.4, 1.2.3.44, 21.2.3.45...
but $addr = ^1.2.3.4$ matches 1.2.3.4 only.
FYI:
https://en.wikipedia.org/wiki/Regular_expression
> addr$ = ^xxx.xxx.xxx.xxx$
For example
$addr = 1.2.3.4 will match several IP addresses.
such as 111.2.3.4, 1.2.3.44, 21.2.3.45...
but $addr = ^1.2.3.4$ matches 1.2.3.4 only.
FYI:
https://en.wikipedia.org/wiki/Regular_expression
If y.y.y.y and y.y.y.z are the VoIP service provider's IP addresses, and x.x.x.x is the 3CX's IP address.
Matching Patterns
$request = ^INVITE
$addr = ^x.x.x.x$
To = sip:(.+)@
Deploy Patterns will be one of followings.
Deploy Patterns
To = sip:%1@y.y.y.y
$rtp = true
$target = y.y.y.y, y.y.y.z
-OR-
Deploy Patterns
To = sip:%1@y.y.y.y
$rtp = true
$session = failover sip:%1@y.y.y.z
With $target (1st example), the SIP Server can failover with Inviting Timeout.
http://wiki.brekeke.com/wiki/multiple-target-failover
With $session=failover (2nd example) , the SIP Server can failover with Inviting Timeout, Ringing Timeout or response code.
http://wiki.brekeke.com/wiki/How-to-mak ... -Dial-Plan
I recommend that you use the 2nd Deploy Patterns.
Matching Patterns
$request = ^INVITE
$addr = ^x.x.x.x$
To = sip:(.+)@
Deploy Patterns will be one of followings.
Deploy Patterns
To = sip:%1@y.y.y.y
$rtp = true
$target = y.y.y.y, y.y.y.z
-OR-
Deploy Patterns
To = sip:%1@y.y.y.y
$rtp = true
$session = failover sip:%1@y.y.y.z
With $target (1st example), the SIP Server can failover with Inviting Timeout.
http://wiki.brekeke.com/wiki/multiple-target-failover
With $session=failover (2nd example) , the SIP Server can failover with Inviting Timeout, Ringing Timeout or response code.
http://wiki.brekeke.com/wiki/How-to-mak ... -Dial-Plan
I recommend that you use the 2nd Deploy Patterns.
John, it is time to start reading the document.
To = sip:%1@y.y.y.y
The SIP server replaces To-header with "sip:%1@y.y.y.y", and forwards the outgoing packet to y.y.y.y.
$target = y.y.y.y
The SIP server forwards the outgoing packet to y.y.y.y.
If the DeployPatterns has both "To=" and "$target=", the SIP server replaces To-header, and forwards the outgoing packet to the destination what $target defines.
To = sip:%1@y.y.y.y
The SIP server replaces To-header with "sip:%1@y.y.y.y", and forwards the outgoing packet to y.y.y.y.
$target = y.y.y.y
The SIP server forwards the outgoing packet to y.y.y.y.
If the DeployPatterns has both "To=" and "$target=", the SIP server replaces To-header, and forwards the outgoing packet to the destination what $target defines.
Simple Dial Pl
I can call out but no incoming calls. Callers complained that they can only hear a busy tone or dial tone.
NOTE: All settings are in default values. It is behind a routerconnected to one of the four sockets.
Help please....
NOTE: All settings are in default values. It is behind a routerconnected to one of the four sockets.
Help please....