Topic: Different outbound trunks for extension groups [Comments: 16]
andrewyager

Mon, 01/05/2009 - 23:46 | Different outbound trunks for extension groups

Hi,

One of our clients would like to deploy a 50 user STE, but within their organisation they have a number of "sub-businesses" which they would like to arrange to call out using different outbound SIP trunks.

They don't want a full multi-tennant solution, as they want all of the extension to be able to call eachother internally etc, and won't have overlapping extension numbers - just want to be able to put extensions in "extension groups" for outbound calls.

Does anyone have any suggestions on the best way to make this happen?

Andrew

eeman

Tue, 01/06/2009 - 12:05 | I take it that you are not

I take it that you are not the ITSP in this case?

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

andrewyager

Tue, 01/06/2009 - 21:50 | One of, but not the

One of, but not the only.

The current plan is to design extension numbers so that the different groups have different prefixes, and then write a script that rewrites the outbound routes prefixed by the business group name, then dialing rules that handle the calls according to their rules.

e.g.

Extension 3000 dials 5551234, gets rewritten to bg15551234 (script just mangles based on gotoifs and source extension) and then there is a rule that matches bg1555. and forwards it to Zap/1

Extension 2000 dials 5551234, gets rewritten to bg25551234 and then there is a rule that matches bg2555. and forwards the call to a SIP trunk (the original number - 5551234).

Any problems real with that?

Andrew

---
Andrew Yager,
Managing Director, Real World Technology Solutions
www.rwts.com.au

eeman

Tue, 01/06/2009 - 22:50 | i could do it with a lot

i could do it with a lot less outbound routes...

clone tl-dialout-1-trunk and change

exten => s,n(dial),Macro(tl-dialout-base,${ARG1},${ARG2},${ARG3},${ARG4},${ARG5})

to

exten => s,n(dial),Macro(tl-dialout-base,${ARG1},${DB(TL/${MYEXTENSION}/tag)},${ARG3},${ARG4},${ARG5})

just keep in mind you wont actually use ARG2 when creating the outbound route.

and in each extension just put the trunk name in each Custom Tag field..

eg Zap/1

SIP/provider1

etc

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

Skydoc

Sun, 01/11/2009 - 23:51 | Slight Problemn with this - is it me?

Erik,

Thanks for this example of how to use Tags - its just what I needed - so I gave it a go but found that ${MYEXTENSION}/tag)} returned null and so the route wasn't enforced - even though

database show reveals the tag -

/TL/5006/tag : IAX/8444XXXX

Should the variable be _MYEXTENSION or can I use MYID ?

As ever - any guidance would be appreciated.

Regards,

Geoff.

eeman

Mon, 01/12/2009 - 01:50 | call

call Macro(tl-set-myvariables) in the dialplan, that should set the variables going into the script

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

Skydoc

[from-inside]

exten => _X,1,Macro(tl-set-variables2,from-inside-redir,)

exten => _*.,1,Macro(tl-set-variables2,from-inside-redir,)

exten => _X.,1,Macro(tl-set-variables2,from-inside-redir,)

exten => _+X.,1,Macro(tl-set-variables2,from-inside-redir,)

Do I need to add sections that run - (tl-set-myvariables)?

Sorry to be a pain but the learning curve is steep!

Regards,

Geoff.

eeman

Tue, 01/13/2009 - 14:59 | no you need to call it in

no you need to call it in your newly created script for routing outbound calls.

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

jesperkjeldsen

Mon, 02/16/2009 - 18:40 | Forwarding

What will happend if the user forwards all calls - will it still be using the right trunk (specified in the custom tag field) or will it be forwarded using the normal outbound rules?

Its a bit funny that it is so hard to find Asterisk-based PBXs with the functionality to allow og disallow extensions access to trunks. In 3CX you can type what extensions that has access to dial a specific trunk - and by that easily managed that every extension dial out with its own number. Also if the calls are forwarded.

Regards

Jesper

jesperkjeldsen

Sun, 05/03/2009 - 13:32 | What if it is MTE

Hi again

What to do if it is the MTE version?

I tried to figure it out, and thought this would be the way to do it, but apperantly not ;-)

exten => s,n(dial),Macro(tl-dialout-base,${ARG1},${DB(TL/TENANT/${MYEXTENSION}/tag)},${ARG3},${ARG4},${ARG5})

I have tried to enter the trunk name (SIP/number) directly as ARG2 and it works that way. So it is something I doesn't get right in how to get the costum tag out of the database (I think)!

What is it I doesn't get right?!

Regards

Jesper

jesperkjeldsen

Sun, 05/03/2009 - 15:17 | Am I doing it right?

A couple of hours and trying later...

I get it to work with this:

exten => s,n(dial),Macro(tl-dialout-base,${ARG1},${DB(TL/${tenant}-${MYEXTENSION}/tag)},${ARG3},${ARG4},${ARG5})

Is it the "right" way to do it? Or should I use ${TL_DASH} instead of -?

show database is a great command - it made it much easier to understand what I wanted to get out of the database :-)

Regards

Jesper

eeman

Sun, 05/03/2009 - 17:00 | always use ${TL_DASH} so

always use ${TL_DASH} so that the same script works with both STE and MTE

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

jesperkjeldsen

Tue, 05/12/2009 - 07:17 | Thanks

Thanks for the explanation why I should do it with TL_DASH.

THe more I work wotk the Thirdlane the better it is :-)

Regards

Jesper

sardinha

Fri, 10/30/2009 - 17:15 | When make dial there is no trunk to use

Hi,

My problem in using tags is that ${MYEXTENSION}/tag)} returned null and database show not reveals the tag.

in sip.conf:

[200]
tag=SIP/211452690

and in the script used for related outbound route:

exten => s,1,GotoIf($["${MACRO_EXTEN}" = "s"]?dial)
exten => s,n,Set(__DIALED_NUMBER=${MACRO_EXTEN})
exten => s,n(dial),Macro(tl-dialout-base,${ARG1},${DB(TL/${tenant}${TL_DASH}${MYEXTENSION}/tag)},${ARG3},${ARG4},${ARG5})

Can you tell me where is the problem?

eeman

Fri, 10/30/2009 - 17:26 | for starters the tag isnt

for starters the tag isnt part of sip.conf

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com

sardinha

Mon, 11/02/2009 - 10:15 | This topic is really what i

This topic is really what i need to try in my business scenario.

Excuse me for not understanding the concept of "Tag" in this context. I'm confusing how the variable "tag" is defined in BD by extension. How can I define tag in each extention? Can you pointing the right direction by showing me an example ?

Thank you for the patience.

eeman

Mon, 11/02/2009 - 19:05 | Extensions and Directories ->

Extensions and Directories -> User Extensions -> Custom Tag

Erik Smith
CTO
BluegrassNet Voice
dCAP
Thirdlane Support by BluegrassNet Voice
eeman at bluegrassnetvoice dot com