[Asterisk-Dev] hunt --- beta

John Harragin jharragi at mw.k12.ny.us
Mon Mar 31 20:03:04 MST 2003

> Is app_hunt technology independent?
> Can I specify a hunt group with Zap and SIP and H323 if I want?

Yea, it is simply an intermediary to  app_dial. As far as I've tested it
seems to work ok, but the pbx may do some housekeeping between priority
steps - I don't understand all the particulars of how dial can modify a
channel yet. Of course if that is the case that would have to be handled.
Some code to prevent a channel from calling itself is also being added.

Does anybody know which field in the chan structure is the calling resource?


----- Original Message -----
From: "Benjamin Miller" <BGMiller at dccinc.com>
To: <asterisk-dev at lists.digium.com>
Sent: Monday, March 31, 2003 6:13 PM
Subject: RE: [Asterisk-Dev] hunt --- beta

> Is app_hunt technology independent?
> Can I specify a hunt group with Zap and SIP and H323 if I want?
> Ben
> -----Original Message-----
> From: John Harragin [mailto:jharragi at mw.k12.ny.us]
> Sent: Monday, March 31, 2003 2:30 PM
> To: asterisk-dev at lists.digium.com
> Subject: RE: [Asterisk-Dev] hunt --- beta
> Jeremy,
> Why didn't you just specify a group in zapta.conf and use   Dial,Zap/g1 ?
> Because you have no control over who gets dialed.
> > Or am I really missing what this app does?
> This allows you to hunt through a series of extensions in a particular
> order.
> For example if you are not at your phone, hunt might try the main
> receptionist 1st, office clerk 2nd, then the exec assistant before moving
> to whatever the next priority is - maybe voicemail. If you were one of the
> devices in the hunt (and defined as skipdev) it would skip over your
> but may dial you first if you call it with a timeout. Anyway, hunt can be
> used to build up a rather sophisticated dial plan with minimal typing (and
> confusion). Used in conjunction with macros, a compact and easy to
> understand extensions.conf can represent a fairly tricky to understand
> plan.
> Here is a very small example. These 3 lines equal the following 8,
> [globals]
> HUNT_GROUP_OFFICE=Zap/1,Zap/2,Zap/3,Zap/4&Zap/5
> exten => _1114,1,hunt(HUNT_GROUP_OFFICE,Zap/2,20)
> exten => _1115,1,hunt(HUNT_GROUP_OFFICE,Zap/3,20)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> exten => _1114,1,dial(Zap/2,20)
> exten => _1114,2,dial(Zap/1,10)
> exten => _1114,3,dial(Zap/3,10)
> exten => _1114,4,dial(Zap/4&Zap/5,10)
> exten => _1115,1,dial(Zap/3,20)
> exten => _1115,2,dial(Zap/2,10)
> exten => _1115,3,dial(Zap/3,10)
> exten => _1115,4,dial(Zap/4&Zap/5,10)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> Also, I found a bug in the posted app_hunt. It shouldn't be any problem
> unless you have a lot of hunt elements (although in general would not want
> to many more than 4). I'm not putting up a new version until making it
> easier to read and putting in a few more tweaks.
> John
> >>>>End of new message...
> Jeremy McNamara
> John Harragin wrote:
> I have been working on a new app to get the hang of the * environment. I
> have more pressing things going on for the next week, so I figure
> it will make duplication of effort less likely. It should be regarded as
> development and not run in a production environment (in case dial
> alters the channel structure for subsequent dials - tips welcome here) -
> if anyone wants to try it now, make sure to LOOK AT THE EXAMPLE regarding
> pipes and commas.
> Hunt(HUNT_VARIABLE_name,SkipDev,opt1...): Executes a hunt pattern using
> current priority. One argument must be passed - HUNT_VARIABLE_name. A
> argument skipdev (generally, the calling resource) will be skipped over -
> if a timeout (or any additional dial options) are defined it will be
> first then be skipped if it is uniquely defined in HUNT_VARIABLE_name. (1)
> * HUNT_VARIABLE_name must be passed naked - that is with no $ or{}.
> * The HUNT_VARIABLE currently must be defined as a global variable.
> By default, a timeout of 10 seconds (compiled in as DFT_HUNT_TaO) with no
> additional options are passed to dial. These options remain in effect
> new options are encountered in any HUNT_VARIABLE element. These will in
> become the new persistent values.
> HUNT_VARIABLE Example (note the use of pipes to delimit options and commas
> to delimit elements):
> [globals]
> HUNT_GROUP1=Zap/2,Zap/3|8|tm,Zap/10|9,Zap/4
> Incantation Example:
> exten => _1114,2,hunt(HUNT_GROUP1,Zap/10) ----------- Skips Zap/10
> Dials Zap/2|10 > Zap/3|8|tm > Zap/4|9
> Incantation Example:
> exten => _1114,1,hunt(HUNT_GROUP1,Zap/10,20) -------- Dials Zap/10 first -
> then skips it
> Dials Zap/10|20 > Zap/2|10 > Zap/3|8|tm > Zap/4|9
> Notes:
> (1) The default skip behavior can be altered by compiling in #define
> DFT_HUNT_TaO 40|tm = 40 sec music & then transferable just like dial. Skip
> behavior can be restored by SkipDev with a trailing pipe (|) -
> hunt(HUNT_GROUP1,Zap/10|).

More information about the asterisk-dev mailing list