Help to manage calls between 2 PBX with IAX2

this is my situation

PBX1 with 15 lines PRI and IVR
PBX2 with 2 lines BRI and IVR

The two systems are independent but being 2 partner companies can work together and the extensions are called to each other.

The PBX2 having only 2 lines available asked me for this possibility.

Create on the pbx1 two new numbers to give to the customers, when the numbers are called the call must go on the trunk iax that is between the 2 PBXs and go to the queue present in the pbx2 but passing first from the time control.

Until now I managed to transfer the call via trunk iax and get the queue to answer but I can’t send it to the time group first

This in detail:

exten => _XXXXXX900,1, Dial (IAX2 / / $ {EXTEN: 1}, tT)
exten => _XXXXXX900, n, HangUp
exten => _XXXXXX901,1, Dial (IAX2 / / $ {EXTEN: 1}, tT)


exten => _XXXXXX900,1, Dial (SIP / 900) (where 900 is the queue number)
exten => _XXXXXX900, n, HangUp
exten => _XXXXXX901,1, Dial (SIP / 901) (where 901 is the queue number)
exten => _XXXXXX901, n, HangUp

Is it possible to send the call to the queue time group instead of directly to the queue?

the XXXX are only to mask the public number
Thanks in advance

This is not how you put calls in a queue. You have to execute the Queue() app with the correct options passed through.

If 901 is the queue number, or any dialable destination in FreePBX, you can use:


This way the call goes directly to the queue?

I managed, perhaps, to do all the configuration is really articulated and surely I can do better, also because I feel correctly the message of office closed while when the call goes in the queue I see by cli that asterisk reproduces the message of how many people are in the queue and the average waiting time but in reality nothing is heard (but I see that the extension rings).
This is what I did.

exten => _XXXXX901,1,Goto(time-conditions-verbali,1,1)
exten => _XXXXX901,n,HangUp

exten => _XXXXX902,1,Goto(time-conditions-viabilita,1,1)
exten => _XXXXX902,n,HangUp


exten => 1,1,GotoIfTime(17:00-19:00,tue,,?dayselect-viabilita,s,1:nightselect2-viabilita,s,1)

exten => s,1(nightselect2),GotoIfTime(10:00-13:00,tue,,?dayselect-viabilita,s,1:nightselect-viabilita,1,1)

exten => 1,1(nightselect),Playback(ufficio-viabilitĂ -chiuso)
exten => h,1,Hangup()

exten => s,1(dayselect),Queue(901)
exten => h,1,Hangup()


exten => 1,1,GotoIfTime(15:00-18:00,wed,,?dayselect-verbali,s,1:nightselect2-verbali,s,1)

exten => 1,1(nightselect2),GotoIfTime(09:00-12:00,fri,,?dayselect-verbali,s,1:nightselect-verbali,s,1)

exten => 1,1(nightselect),Playback(ufficio-verbali-chiuso)
exten => h,1,Hangup()

exten => 1,1(dayselect),Queue(900)
exten => h,1,Hangup()

exten => s,1,Queue(901)

exten => s,1,GotoIfTime(11:00-13:00,sat,,?dayselect-viabilita,s,1:nightselect-viabilita,s,1)

exten => s,1,Playback(ufficio-viabilitĂ -chiuso)

exten => s,1,Queue(901)

exten => s,1,GotoIfTime(09:00-12:00,fri,,?dayselect-verbali,s,1:nightselect-verbali,s,1)

exten => s,1,Playback(ufficio-verbali-chiuso)

Thanks in advance

You should follow what @lgaetz said about dialing the queue. Just doing Queue(900) will bypass all the settings/flags/variables that are set by FreePBX to make all those settings you spent time setting up in the GUI worthless.

Yes you’re right…but before goes into the queue i need to pass the time check

OK so you route the call to the Time Condition and then make the queue a destination for the proper match you want. I’m not sure why you are doing all this custom when you’re not doing anything special here. All this could be done via the GUI.

1 Like

If you need a dialable feature code for a destination, you want a Misc Application. Create a Misc application of 90210 that goes to the time condition, and then in your dialplan:


This is very usefull, i go to try!

I’ve tried but i can’t unable to intercept calls from iax…must probably because i’m noob

Great man! It works like a charm! Thank you so much sir!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.