Is is possible to select a SIP Trunk based on the Calling Party as well as the dialed digits?

52 views
Skip to first unread message

Alan Evans

unread,
May 17, 2012, 10:10:15 AM5/17/12
to 2600h...@googlegroups.com
Hello Group,

I'm fairly new to the Whistle platform but I'm getting to like it more and more.
I want to be able to filter the Outbound Trunks based on the Calling Party as well as the Called Party.
Does anyone know if this is possible and point me in the right direction.

It seems that the rules attribute in the resource document would be the place to filter but as far as I can see this is called party rules and not calling party.

Thanks in advance
AlanE.

Alan Evans

unread,
May 17, 2012, 12:30:02 PM5/17/12
to 2600h...@googlegroups.com
OK, so with a bit of digging I decided that this feature is not supported, I expect someone will now demonstrate otherwise :-)

Anyway I've patched cf_resources.erl so that it accepts an enhanced rule "CallerIdRegex:CalledPartyRegex". The 2 Regexs are separated by a colon.
If there is no ":" in the rule then it defaults to existing behavior. If there is a ":" then it first filters the resource by CallerId before filtering by Called Number.

If someone on the dev team wants to review my changes and suggest improvements I am more than willing to tidy it up for more general consumption.

cheers
AlanE
cf_resources.erl.patch

Alan Evans

unread,
May 17, 2012, 12:35:19 PM5/17/12
to 2600h...@googlegroups.com
BTW: Forgot to mention, this can be provisioned via winkstart by selecting "Custom" rules under Carrier Advanced Options.


cheers
AlanE

On Thursday, May 17, 2012 3:10:15 PM UTC+1, Alan Evans wrote:

James Aimonetti

unread,
May 17, 2012, 1:09:36 PM5/17/12
to 2600h...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A pull request on Github would make it easy to review and discuss.

James
- --
James Aimonetti
Distributed Systems Engineer / DJ MC_

2600hz | http://2600hz.com
sip:ja...@2600hz.com
tel: 415.886.7905
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPtTDQAAoJENc77s1OYoGg7aAH/jiBM2pGNGvPLa6NK6du4rA4
7WS7BFQY4v42LF2bPARIftgfuY0TNH9ptY16OM7Bf6N1uG1Ax5R50J3OrrZsxvXD
c98eDJjXawxj7Vn2EZjwgwpd9sbo6LDkuqJzahM23k0fSLaUk0ZPYgcUmyZ6JF5J
k6JxFsXsuSj+Q7arPPkrt9VzB1W1BdASSYBT4HfHMLqXx3p65zaR+hv5zNJTk/wX
BvaeH5+m5OYxnJz7TVHMp+QaD0wOI9HKEyXaBkeXlItfSG6iTogC8HRbI443cxaf
AaP5ALs1qQcRx9f/5tbUgV4c7rkm+3+ENEKxLvIldR+iWxzbkTNzEhyFiJe4amg=
=qWEl
-----END PGP SIGNATURE-----

Darren Schreiber

unread,
May 17, 2012, 1:20:55 PM5/17/12
to 2600h...@googlegroups.com
Hi Alan,
w00t – thanks for the patch! We love patches :-)

I'll work with James to get this, or something similar, implemented.

Our plan for this feature (to answer your other email) was to support flags. You could flag a device as say a "T38" device and then only carriers who have the same flag would be used for routing.

This could also be used for "international-plan" or "cheap-circuits" or "free-calls" and so on. It was free-form, easy to remember and flexible. But I'm open to other ideas obviously :-)

--
Darren Schreiber
CEO / Co-Founder


 visit: www.2600hz.com
 tel: 415-886-7901
Reply all
Reply to author
Forward
0 new messages