[HELP]: Dialing an extension to switch IVR on/off

This is probably very easy to do, but I’m new at all this and struggling to find any instructions.

How, in Asterisk, can I set up extensions (or feature codes) that will tell my inbound route to do different things. For example, I would like to set up a code to send inbound calls to the IVR, and another to send inbound calls to a ring group.

I’m sure this must be relatively easy, but if someone could point me at instructions or tell me how to do it, I would be most grateful.

I’m running Trixbox, if that’s relevant, however I am more than happy to work directly with Asterisk if necessary.

Thanks in advance! :smiley:

Based on response (or the lack thereof), very. This would be very easy in plain Asterisk, but apparently not many people are well versed in TrixBox. It might help if you include the name in the subject.

Ah, perhaps I was unclear. I’m pretty sure it’s not especially simple via Trixbox. Whether it is or not, I’m more than happy to get under the hood and work directly with Asterisk (bypassing Trixbox…)

I’ll amend my original post.

Thanks valley.

With plain Asterisk, could be as simple as

[incoming] ; assume all calls come into incoming exten => s,1,Answer exten => s,n,Background(dial-55-for-self-help&dial-50-for-sales); you must make these prompts exten => 55,1,Goto(MyIVR,s,1); you must create the IVR context exten => 50,1,Dial(SIP/sales1&SIP/sales2) exten => t,1,Dial(SIP/sales1&SIP/sales2); catch timeout

But if Trixbox is already running, don’t know how safe it is to look under the hood :wink:


This will do it on Asterisk I do not have Trixbox. It uses the Asterisk database. A user can switch something on or off by dialing an ext.

eg; switch between IVR and ring group by dialing and ext.
or turn on/off the after hours message when they leave/arrive at the office.

Dial ext. 50 puts a value of 1 in the database.
Dial ext. 51 deletes the value.
Dial ext. 52 and it checks the database.
If the value is 1 it goes to internal,10,1.
If there is no value it goes to internal,8500,1.

exten => 50,1,Set(DB(SWITCH/001)=1)
exten => 50,2,SayAlpha(on)
exten => 50,3,Hangup

exten => 51,1,DBdel(SWITCH/001)
exten => 51,2,SayAlpha(off)
exten => 51,3,Hangup

exten => 52,1,Set(SWITCH_POS=$[${DB(SWITCH/001)}])
exten => 52,2,GotoIf($[${SWITCH_POS} = 1]?internal,10,1:internal,8500,1)
exten => 52,3,Hangup