[SOLVED] Dialplan for after hours helpdesk

Hello all,

We are revamping our helpdesk phones, specifically, we are looking to increase the flexibility of our after hours call system. Currently, if someone calls in after hours, it is routed to the on-call agent, then to an escalation agent. Note that the system is dialing our external cell phones (nextel is the carrier, if it might help) so this isn’t as simple as it first appears (at least not to me).

There are two things we’d like to do:

First, we’d like to be able to ring multiple escalation agents in succession - so we’d ring agent 1 for 15 seconds, then route to agent 2 for 15 seconds, until the chain has been exhausted. This is easy - I can just have several dial strings in a row, no big deal.

Second, we’d like to avoid calls going to our mobile’s voicemail if possible - let’s say my phone is off and I’m second in line. The call will be answered immediately by my voicemail and won’t route to the next person.

So, in reality, we only have one issue.

I thought about setting up a queue and having it ring each phone in turn, but we still come back to the same problem the mobile’s voicemail ending the chain early.

I also looked at using BackGroundDetect, but wanted to see if anyone had any better ideas first.

I’m all ears to any suggestions. Thanks.

Well, I came up with something that works pretty good, at least for us…

In our after hours auto-attendant, we have the following:

exten => s,1,Wait(1) exten => s,2,Answer exten => s,3,Set(TIMEOUT(digit)=1) exten => s,4,Set(TIMEOUT(response)=5) exten => s,5,Background(IT_NIGHT) exten => 1,1,Dial(Zap/G1/${ITONCALL},,mM(helpdesk)) ; On Call exten => 1,1,Dial(Zap/G1/1913xxxxxxx,,mM(helpdesk)) exten => 1,n,Dial(Zap/G1/1913xxxxxxx,,mM(helpdesk)) exten => 1,n,Dial(Zap/G1/1913xxxxxxx,,mM(helpdesk))

This calls each user in order…the helpdesk macro we call is below…

[macro-helpdesk] exten => s,1,Background(something-terribly-wrong) exten => s,2,Background(attention-required) exten => s,3,Read(ACCEPT|press-1|1|||3) exten => s,2,ResponseTimeout(5) exten => s,4,Gotoif($[${ACCEPT} = 1] ?10:20) ;connect exten => s,10,Wait(1) exten => s,20,SetVar(MACRO_RESULT=CONTINUE)

We play a couple of background messages to alert the callee of impending doom, then prompt them to press a key. If they press 1, the call is connected (since MACRO_RESULT is null), and if they press anything else, the Dial command fails and the next person in line is called.

The ONLY problem with this is that if the tech hangs up instead of pressing a key, the entire call is dropped. I don’t think the Read command deals with that very well, or maybe I’m missing something obvious.

In any case, hopefully this will help someone else…


You can route the calls depending of the day and the time of the day by using the GotoIfTime application. This way you can have all kinds of time, day and date depending routing for a call, thee time, dinertime, christmas time,daytime etc. etc.


exten => s,2,GotoIfTime(9:00-17:00|mon-fri||?ringphone,s,1)
exten => s,3,GotoIfTime(17:01-8:59|mon-fri||?menuclosed,s,1)
exten => s,4,GotoIfTime(|sat-sun||*?menuclosed,s,1)

-= Info about application ‘GotoIfTime’ =-

Conditional goto on current time

If the current time matches the specified time, then branch to the specified
extension. Each of the elements may be specified either as ‘*’ (for always)
or as a range. See the ‘include’ syntax for details.

Another approach is to include different parts of the dialplan depending on the time of day rather than using GotoIf statements. Eg:

  include => ext-local
  include => autoattendant-day|09:00-20:59|*|*|*
  include => autoattendant-night|00:00-08:59|*|*|*
  include => autoattendant-night|21:00-23:59|*|*|*

  ; Set some variables, and play greeting.
  exten => s,1,Answer
  exten => s,2,Wait(1)
  exten => s,3,Set(TIMEOUT(digit)=3)
  exten => s,4,Set(TIMEOUT(response)=20)
  exten => s,5,BackGround(autoattendant/welcome)
  exten => s,6,BackGround(autoattendant/pls-wait-connect-call)
  ; s,7 and s,8 provided by included day or night context
  exten => s,9,NoOp()
  exten => s,10,Background(autoattendant/mainmenu)
 .... menu options....
  exten => s,7,Queue(allphones,tThHnr,,,5)
  exten => s,8,Background(autoattendant/daywarn&autoattendant/extension)
  ; Only include this option in day mode
  exten => 1,1,Queue(allphones,tThHnr,,,5)
  exten => 1,2,Background(autoattendant/unavailable)
  exten => 1,3,Goto(s,10)

  exten => s,7,Background(autoattendant/nightwarn&autoattendant/extension)
  exten => s,8,NoOp()
  exten => 1,1,Background(autoattendant/phonesdonotringatnight)
  exten => 1,2,Background(autoattendant/extension)
  exten => 1,3,Goto(s,10)

As you can see, the option “1” is redefined by day or night mode, and s,7 and s,8 are set to play back an appropriate greeting on the autoattendant startup depending on the included context.

An I dea that you can try that should work.

  1. Have the incoming call automatically parked (at exten 701)
  2. Dial 1st tier of tech support
  3. (this is the part you need to figure out) when the call is answered asterisk will play a backgound command that says please enter digits 111. Then you set it (with Gotoif) so that when the digits gets entered you know there is a life person and then in the next priority have asterisk dial to the parking lot 701 where the client is. If these is no input when asterisk calls the agent (i.e voicemail) then asterisk will hangup that call and dial the next tech.

Get the idea?

already got it sorted guys, check out post #2.

IAX Man and I think alike - that is pretty much what I ended up doing, just without the park extension. I just set the dial command to play hold music instead of rings.

thanks guys.

I just want to say thank you to all you guys that worked on this. I can’t imagine that you and I are the only two people who need this feature, but this is the ONLY answer I’ve been able to find to do this.

In addition to saying thanks to all of you guys, I am responding to this message because I’ve noticed that when you search, the most recent posts are returned first. If this didn’t have a date of 2006 on it, I may have found it sooner.

I will test this out in my test environment and let you know that I have it working.

Again, thanks