[asterisk-users] How to return dialstatus of second (sub) call
Robert Lister
robl at linx.net
Sat Apr 7 17:53:48 MST 2007
On Thu, Apr 05, 2007 at 02:06:53AM -0500, Jonathan Rivera wrote:
> Hello all
>
> I have this problem, i need a way to balance my "trunks" which are SIP
> peers, when a SIP peer is busy then send the call for another peer and
> so until i can send away the call, i think i can do it with queues.
>
> Ok this is the scenario:
>
> In extensions.conf
>
> [balance]
> exten => _XXXXXXXX,1,NoOp(Call to: ${EXTEN})
> exten => _XXXXXXXX,2,Answer()
> exten => _XXXXXXXX,3,SetVar(_ORGEXTEN=${EXTEN})
> exten => _XXXXXXXX,4,SetVar(_ORGUNIQUEID=${UNIQUEID})
> exten => _XXXXXXXX,5,Set(CDR(userfield)=${ORGUNIQUEID})
> exten => _XXXXXXXX,6,Queue(qtest,r)
> exten => _XXXXXXXX,7,Hangup()
>
> I have a queue with 100 members which are local channels
>
> In queues.conf
>
> [qtest]
> strategy=random
> member=>Local/1 at salidas
> member=>Local/2 at salidas
> member=>Local/3 at salidas
I had a similar problem of returning state to the queue manager to check the
call state.
You might want to try something like:
exten => check,1,ChanIsAvail(Local/1 at salidas,js);
exten => check,102,Goto(busy,1);
exten => busy,1,Busy();
Obviously you could replace this with a macro/DB lookup to avoid having lots
of repeated entries in the dial plan.
Busy() should return busy to the queue application if the Local
channel is in use, causing it to skip to the next entry in the queue.
After having a nightmare with chan_agent not working properly, I implemented
a modified (for 1.2.x) version of:
http://www.voip-info.org/wiki/view/Agents+without+agent+channel
and stopped using AgentCallBackLogin(), which digium it appears have
deprecated anyway in 1.4.x
Agents without agent channel is a bit of a hack, but it works better than
chan_agent in my case.
This caused various other problems, notably that hints do not seem to work
with Local/ channels, it shows them as always available. I have not found
a workaround to this as yet. Any attempts I have made to dynamically update
hints in the dialplan from asterisk CLI (add extension .....) seems to
cause it to core dump in my case. Other than that, it works quite well.
Rob
--
Robert Lister - London Internet Exchange - http://www.linx.net/
robl at linx.net - tel: +44 (0)20 7645 3510 - RL786-RIPE
More information about the asterisk-users
mailing list