0

I need to be able to choose some trunk based on result of some SQL query, while making outbound call, i spent many time google some answers, but i cant find any. I know i can use outbound routes in freepxb, but i need to be more specific in conditions that defines trunks choosing, so i need to do it directly from context. Im sorry for my english (it's quite bad), but i hope u guys would able to understand what i mean.

2 Answers2

0

In case someone is intrested in, you ll need to override [macro-dialout-trunk] to do that.

  • Can you provide a bit more detail, for example *how* to implement this? – I say Reinstate Monica May 25 '17 at 12:52
  • FreePBX makes it difficult to select a trunk within the dialplan. The simplest way as MarcoZink has suggested is to copy the dial macro and copy it to extensions_custom.conf. There you can reverse engineer the code, and add trunk selection based on some variable you have defined. – TSG May 29 '17 at 13:10
0

You could create a custom trunk with a custom dial string:

Local/$OUTNUM$@query-out

Then you can create an outbound route to send the calls to that trunk. The $OUTNUM$ is the variable with the number dialed according to what the route sends to the trunk and will use the dialplan according to the context "query-out"

Then you can add the context "query-out" to your extensions_custom.conf file:

[query-out]
;--
Your dialplan for query and result processing
with corresponding Dial according to query result
--;

Hope I could help.

Marco Zink
  • 126
  • 7