How to force extensions to use a specific trunk when using DUNDI?

Here is my setup I have.
I have a number of locations that are using DUNDI to dial through one main server for its outbound calls.

Originally I had configured all my extentions with outbound groups addin module. It seemd to work OK for my needs. Each users that called out would be put through the appropriate trunk.
Now here is my problem. I need a way to do the same thing but in that each location will have there own group of extenstions. One group is in the 1000 group another 2000 and so on. I need to be able to put each caller depending on anything, like there extension number or there group of extensions or maybe even the DUNDI group they are in to be put out a certian trunk and use a specific callerid.

Is there something I can do myself outside of freepbx that would facilitate this?

I am using Freepbx 2.4 beta and 1.4.17. I am willing to go to 1.6 if there are features there that would make this work.

BTW, I have found that the DUNDI support/examples for 2.4 need some fixing/adding to.

I am really not sure if this should be in the beta section or not, this is really not about DUNDI so much as it is finding a way to send users out a selected trunk.


If I understand you right - then you could setup multiple IAX trunks that access different custom contexts (other than from-internal) and those could have the different desired outbound routes. You could then use different mappings and other DUNDi configurations that result in the proper IAX trunk be returned to the caller. You then create multiple DUNDi trunks on the remote ends that you funnel numbers to and you may further require one of the unsupported solutions that you already have used on those ends also to choose the DUNDi trunk where the calls should go.

My first intention was to get some form of dynamic routing going on with the different locations, so thinking about a static route kinda was not what I was looking for.

So what I did do was like you suggested as follows

I configured an IAX route that is in the context, lets call it group1-context on both ends.
My goal is to have a way to track the cost of the users that dial out the premium services.

I setup the unsupported module outbound groups that points to the above iax trunk on the calling end. So based on the configuration within outbound-grps, it forces the user(s) to go through this route.

So with one DUNDi route and depending on needs there is at least one iax trunk setup and on each system. So for instance if they have two departments that have different services like one dept uses a unlimited plan, while another has chosen a per minute plan. Each dept is handled by there needs.
So when the users dial the prefix needed for there specific trunk they happily are put through. .

On the final end I am capturing the prefix and using it to place them out the needed trunk.

If need be, I can put up a howto on this.

BTW, is there going to be something that will do officially what some of the unsupported modules are doing (i.e. custom-context, outbound groups)?

Thanks for the pointers.