Inbound Calls

Hello all…I have a submenu set up (see below) for an Incomming DID and currently I have it set to where the caller can enter an extension and be transferred to that ext or if no ext is inputted by the caller, it goes to a voicemail box (111) after 30 seconds that I have setup. What I would like to have happen is if the caller does not enter an extension, first rather than going to the voicemail, I would like it to go to a specific extension (same extension, 111) first and then if noone answers at that ext, then have it transferred to voicemail. Any ideas please? Thank You in advance for any ones help and assistance.

exten => 1,1,Noop()
exten => 1,n,Answer
exten => 1,n,GotoIfTime(09:00-21:00,mon-fri,,?daytime)
exten => 1,n(night),VoiceMail(su3500); Customer Service Voice mail
exten => 1,n,Hangup

exten => 1,n(daytime),BackGround(main_trim); Greeting
exten => 1,n,WaitExten(5)
exten => 1,n,Set(MONITOR_FILENAME=/var/spool/asterisk/incoming/cs-${CALLERID(NUM)}-${STRFTIME(,%H:%M)}.wav)
exten => 1,n,Noop(); Set(CALLERID(name)=XXXX_XXXX)
exten => 1,n,Queue(customer-service-queue|Tto|||30)
exten => 1,n,Goto(trunkinbound,111,1,Tto)
exten => 1,n,VoiceMail(su3500)
exten => 1,n,Hangup

;3 Digit Extensions Dial local sip Phone extension
exten => _XXX,1,Goto(trunkinbound,${EXTEN},1,Tto)
exten => _XXX,n,Hangup

exten => i,1,Goto(submenu,1,1)
exten => #,1,Goto(submenu,1,1)
exten => t,1,Goto(submenu,1,1)

The simplest version of this is just to add a line like:

exten => 1,n,Dial(Local/111@somecontext)

immediately after the WaitExten line.

If you actually meant the device SIP/111, you can use that, instead of the local channel.

If you use the local channel, you must ensure that there is no explicit call to Answer in the extension definition.

Often people will test DIALSTATUS and/or HANGUPCAUSE, rather than simply falling through to the voicemail.

Hi david55,

Thank you for the reply, yes, what I am attempting to accomplish is the ext 111 is a zoiper SIP phone, and for a caller to be routed to that phone w/o the Agent being logged into the “dialer”. So the SIP phone ext 111 rings to Agents phone and then if not answered at that 111ext, can it go to a landline number and if nothing there, then could it go to the voicemail that was setup 111?

Another way would be to just have it go to a landline number and then if noone picks up, go to the SIP 111 (phone) voicemail ?

I am looking for the most effecient way or should I say the easiest way.

Again, THANKs


You can do all the things you mention with sequential Dial commands. Are you having some problems with it?

Hi dejanst,

Thank You for your reply, Yes, the script works and does go to the Agents voicemail box 111 but does not ring his zoiper phone when logged in to phone ext 111 to actually receive the call prior to going to voicemail.

The way it’s set up now is… if a Caller inputs an Agents ext, it goes to them or if they are busy it goes to their voicemail, however, if a caller does not enter an ext, after 30 secs right now it just goes to ext 111’s voicemail bypassing the agent if they are logged in to ext 111 to capture any caller calling in.

I will look at some Dial commands to see if I can “fix” my missing link.

THANKs again as I appreciate your comment and assistance.

If you can not find the problem, copy/paste the latest version of the dialplan and we will see what we can do :wink: