Re: [asterisk-users] How to return dialstatus of second (sub) call

2007-04-07 Thread Robert Lister
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 = _,1,NoOp(Call to: ${EXTEN})
 exten = _,2,Answer()
 exten = _,3,SetVar(_ORGEXTEN=${EXTEN})
 exten = _,4,SetVar(_ORGUNIQUEID=${UNIQUEID})
 exten = _,5,Set(CDR(userfield)=${ORGUNIQUEID})
 exten = _,6,Queue(qtest,r)
 exten = _,7,Hangup()
 
 I have a queue with 100 members which are local channels
 
 In queues.conf
 
 [qtest]
 strategy=random
 member=Local/[EMAIL PROTECTED]
 member=Local/[EMAIL PROTECTED]
 member=Local/[EMAIL PROTECTED]

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/[EMAIL PROTECTED],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/
[EMAIL PROTECTED]   -   tel: +44 (0)20 7645 3510-  RL786-RIPE
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] How to return dialstatus of second (sub) call

2007-04-05 Thread Jonathan Rivera
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 = _,1,NoOp(Call to: ${EXTEN})
exten = _,2,Answer()
exten = _,3,SetVar(_ORGEXTEN=${EXTEN})
exten = _,4,SetVar(_ORGUNIQUEID=${UNIQUEID})
exten = _,5,Set(CDR(userfield)=${ORGUNIQUEID})
exten = _,6,Queue(qtest,r)
exten = _,7,Hangup()

I have a queue with 100 members which are local channels

In queues.conf

[qtest]
strategy=random
member=Local/[EMAIL PROTECTED]
member=Local/[EMAIL PROTECTED]
member=Local/[EMAIL PROTECTED]
...
...
member=Local/[EMAIL PROTECTED]

Each member is an extension.

In extensions.conf

[salidas]
exten = 1,1,Dial(SIP/TRUNK1/${ORGEXTEN},60,r)
exten = 2,1,Dial(SIP/TRUNK2/${ORGEXTEN},60,r)
exten = 3,1,Dial(SIP/TRUNK3/${ORGEXTEN},60,r)
...
...
exten = 100,1,Dial(SIP/TRUNK100/${ORGEXTEN},60,r)
exten = h,1,Set(CDR(userfield)=${ORGUNIQUEID})


Each TRUNK is a SIP peer. And i have anothers users which have the
context balance.

The question now is that i need return on the SIP message the
dialstatus of the Dial on salidas context to the peer which is doing
the call, now i always return ANSWARED because the Queue always
answare, i need some way to tell the queue not return the dialstatus
until the second call finish and i know the dialstatus and then return
it dialstatus to the peer which is doing the call in the SIP message.


Something like this

User --- doing the call  Queue
|
-- Trying
  |
  -- Dial on salidas
|
  -- Finish the call
  |
  Return the dial status--

Someone have an idea?

Regards.

-- 
Jonathan Alberto Rivera Gomez
http://linuxuanl.org
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users