[OpenSIPS-Users] route based on previous load_balance dialog

Bogdan-Andrei Iancu bogdan at opensips.org
Sun Feb 27 10:49:29 CET 2011


Hi Stefano,

A better approach (without the need of DB) is to use the 
"get_dialog_info()" function. See:
    http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id293888
   
The idea is that after the LB function, add the selected destination 
(stored in $dd variable) and the agent name into a dialog variable like:
    $dlg_val(dst) = $dd;
    $dlg_val(agent) = ??? ;

And when you have a 123 call for agent, search the to get the 
destination of the ongoing call to that agent:
    $var(x) = agent ??
    get_dialog_info("dst","$var(dst)","agent","$var(x)");

where $var(dst) will hold the destination of the server holding agent's 
call.

Regards,
Bogdan

Stefano Sasso wrote:
> Hi Dave,
>
>   
>> You might look at the dialog module. Check if what you need is stored in the
>> db for a dialog. You would need to have the db mode set to realtime.
>>     
>
> As I said, dialog module stores what I need.
> My problem is how to fetch that information to reach the right asterisk server.
>
>   
>> Either way you would use avp_db_query to pull the needed info from the db.
>>     
>
> Thanks for this hint. I'll try it asap.
>
> bye,
> stefano
>
>
>   
>> On Fri, Feb 25, 2011 at 8:34 AM, Stefano Sasso <stesasso at gmail.com> wrote:
>>     
>>> Hello folks,
>>>  I have this load_balance situation:
>>> opensips in front of 3 asterisk servers in a outbound only call-center.
>>>
>>> When a agent places a call, opensips load balance through the three
>>> asterisks.
>>> Now, we need to use the "ExtensSpy" command from asterisk, dialing
>>> something like ***123 (where 123 is the extension to spy). So,
>>> opensips need to rewritehostport directly to the asterisk server which
>>> is handling 123's conversation, without using load_balance.
>>>
>>> I thought to get informations from the dialog database table, in fact
>>> a row is like this:
>>> caller_contact: sip:8002 at aa.cc.dd.82:1029;transport=UDP
>>> callee_contact: sip:xxxxxxxxx at aa.bb.cc.54
>>>
>>> where 8002 is the caller extension and aa.bb.cc.54 is the asterisk
>>> server involved in the conversation.
>>>
>>> but... how can I get and use this information from opensips configuration?
>>>
>>> thanks so much!
>>>
>>> bye,
>>> stefano
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>       
>>     
>
>
>
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 28th February 2011
OpenSIPS solutions and "know-how"




More information about the Users mailing list