[asterisk-users] Callback / Camp / Extention Free notify?
Daniel Johnson
dan.j at scanningsystems.com.au
Wed Jan 28 19:15:28 CST 2009
Hi,
I am trying to implement the callback feature of our old phone system.
This feature may go by a different name in asterisk?
It worked as follows. If phone A called phone B and it was BUSY, you
press a button to enable a callback.
User A is free to continue work or make other calls.
What this meant is that when both phones became free, phone A would
ring, on answer it would call phone B automatically.
Here is how I have tried to achieve this with asterisk.
When A calls B and B is busy you get a menu, 1 to set callback and 2 to
leave voicemail.
The set of the callback is done via AGI call to PHP script to set the
details in MySQL DB.
On all call hangups I check to see if there is a pending Callback via
another AGI script.
The script sets a couple of variables which I check in my Dialplan. If
there is a callback pending for the
phone that just hung up, I need to check that the other phone involved
is FREE. This is what I can not get to work.
I have tried ChanIsAvail which does not appear to work.
I have hints setup for each SIP phone. Which would be perfect, however
it does not appear that you can check the HINT STATE in the dialplan.
I have done plenty of googling and have found this
http://bugs.digium.com/view.php?id=10635 which appears that this kind of
functionality was placed in 1.4.11. (DEVICE_STATE(), EXTENSION_STATE())
I have 1.4.21.2 and do not have these features.
To continue with the rest of the feature. If the ChanIsAvail says all is
good. I then launch another AGI to write a CALLFILE and remove the
pending callback request from the DB.
This all works if A is not busy when B finishes their call etc.
I am sure that others have implemented this kind of feature. If you
could share your implementation or give me some pointers or even the
correct asterisk name so I can google and get the help I need, that
would be great.
I am considering trying out 1.6 which should have these features,
however not sure if stability is going to be a problem.
I have based my implantation based of a previous message to the list:
On Tue, Jun 10, 2008 at 5:34 PM, Phil Knighton <phil.knighton at mjog.com> wrote:
> > Hello
> >
> > I'm looking for a way to do the following using my Asterisk system and Snom
> > SIP phones...
> >
> > Scenario:
> >
> > Caller on Internal Phone 1 calls internal phone2. Phone 2 is busy (or more
> > accurately goes straight to voicemail).
> > Caller on internal phone 1 can press a button / dial a code (explained in
> > next step) and hangup
> > When phone 2 is free, phone 1 rings and on answer dials phone 2
> >
> > I was sure this was called "camping" - but all the camping stuff I can find,
> > refers to the caller having to hang on the phone and wait. Am I missing
> > something?
> >
> > Anyone have a solution?
> >
>
Quick solution that comes into mind:
Set(exten_copy = ${EXTEN});
Dial(SIP/${EXTEN})
if ("${DIALSTATUS}"="BUSY") {
// prompt for camp
Set(DB(camp/${EXTEN}/call_to)=${CALLERID(num));
}
h => {
Set(call_to=${DB(camp/${exten_copy}/call_to)});
if ("${call_to}"!="") {
Set(DB(camp/${exten_copy}/call_to)=);
System(call_to ${exten_copy} ${call_to});
}
}
So, in case if phone2 is busy, store callerid of phone1 in database,
so when phone2 will hangup it will triger a script "call_to" which
however can originate call trough manager or call-file.
Of course you will need some additional handling in case if multiple
callers decide to camp, or diferent protocols are used, etc.
Regards,
Atis
Thanks in Advance for any help.
Regards
*Daniel Johnson*
Systems Administrator / Systems Development
Scanning Systems Australia
Scanning Systems Australia
*Office:* +61 7 3387 5555
*Facsimile:* +61 7 3387 5588
*E-mail:* dan.j at scanningsystems.com.au <mailto:dan.j at scanningsystems.com.au>
*Website:* http://www.scanningsystems.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090129/ffc56d88/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ssa-logo.jpg
Type: image/jpeg
Size: 5930 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20090129/ffc56d88/attachment.jpg
More information about the asterisk-users
mailing list