Inure to Advance
We may come across with the different providers with free calls at different times of day, Say some may give free calls at night but with high day rate compared to other providers. So in order to save money it will be tough for an administrator to change trunks manually each day. This section describes about the trunk selection based on time/day /month.
Add the below context in extensions_custom.conf . Te document is on assumption that the first two trunks in the amp are the external trunks to call outside and secondary provider with cheap night calls.
Change the context of the user to appropriate context based on the requirement.
; explains the selection of trunk based on days of month
[daybased-selection] exten => _011X.,1,GotoIfTime(*|*|1-15|*?monthstart) exten => _011X.,n,Goto(secondaryprovider,${EXTEN},1) exten => _011X.,n,Hangup exten => _011X.,n(monthstart),Goto(primaryprovider,${EXTEN},1) exten => _011X.,n,Hangup
[primaryprovider] exten => _X.,1,Macro(dialout-trunk,1,${EXTEN},,) exten => _X.,n,Macro(outisbusy,)
[secondaryprovider] exten => _X.,1,Macro(dialout-trunk,2,${EXTEN},,) exten => _X.,n,Macro(outisbusy,)
; explains the selection of trunk based on time of day
[timebased-selection] exten => _011X.,1,GotoIfTime(6:00-18:00|*|*|*?daytrunk) exten => _011X.,n,Goto(secondarytrunk,${EXTEN},1) exten => _011X.,n,Hangup exten => _011X.,n(daytrunk),Goto(primarytrunk,${EXTEN},1) exten => _011X.,n,Hangup
Voila !! You are done
Š las@avenzare
Sarn inure, to advance
2