[OpenSIPS-Devel] [NEW] exchanging info between dialogs
Richard Revels
rrevels at bandwidth.com
Sun Jun 13 20:44:52 CEST 2010
I wanted to be able to adjust the dialog timeout after getting a look at some dialog values so I added the timer change code to the bottom of the dlg_validate_dialog function. I prefer not to have local changes running so was wondering if this could be added to the release code.
I added the timeout int to the function variables and then pasted the code right before the return.
timeout = get_dlg_timeout(req);
/* update timer during sequential request? */
if (timeout!=default_timeout) {
dlg->lifetime = timeout;
if (update_dlg_timer( &dlg->tl, dlg->lifetime )==-1)
LM_ERR("failed to update dialog lifetime\n");
}
Richard
On Jun 13, 2010, at 8:54 AM, Richard Revels wrote:
> Nevermind. t_newtran() in the config block for re-invite lines up the dialog so the dialog flag I set is found. Still can't seem to use get_dialog_info to find a dialog in that block but I don't need it anymore.
>
> Richard
>
> On Jun 12, 2010, at 7:40 PM, Richard Revels wrote:
>
>> Sorry, wrong log entries for the call in the BYE block.
>>
>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:check_dlg_value_unsafe: looking for <credit_user> with <9194395395>
>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:check_dlg_value_unsafe: var found with val <9194395395>!
>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:check_dlg_value_unsafe: var found!
>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:get_dlg_by_val: ref dlg 0x2b0a65ce0d78 with 1 -> 2
>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:w_get_dlg_info: dialog found, fetching variable
>>
>>
>> Richard
>>
>>
>> On Jun 12, 2010, at 7:30 PM, Richard Revels wrote:
>>
>>> I'm having a bit of a problem with this functionality and re-invites. The call comes in, a dialog is created, a dialog flag is set, and a couple of values are stored in the dialog. When the called party re-invites I want to look at those values so started trying with checking the dialog flag. That came up empty so I decided that Opensips was thinking of this as a new dialog (hmm). No big deal, I would use get_dialog_info.
>>>
>>> The if block around get_dialog_info never triggers and the debug log indicates the dialog is not found.
>>>
>>> Jun 12 22:40:38 guinea-pig2 osips-log[14664]: DBG:dialog:get_dlg_by_val: dlg in state 4 to check
>>> Jun 12 22:40:38 guinea-pig2 osips-log[14664]: DBG:dialog:w_get_dlg_info: no dialog found
>>>
>>> Since the dialog flag check works just fine in the BYE block, I decided to try the get_dialog_info there as well even though the current dialog would also be the one I was searching for. It worked just fine using the same logic and values I am sending in from the re-invite block.
>>>
>>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:fetch_dlg_value: looking for <credit_user>
>>> Jun 12 23:14:13 guinea-pig2 osips-log[15011]: DBG:dialog:fetch_dlg_value: var found-> <9194395395>!
>>>
>>> Richard
>>>
>>>
>>> On Apr 28, 2010, at 11:46 AM, Bogdan-Andrei Iancu wrote:
>>>
>>>> Hi,
>>>>
>>>> just added to the dialog module a new function that allow you to
>>>> exchange data between dialogs - mainly to extract data from a different
>>>> ongoing dialog.
>>>>
>>>> Such functionality is vital in complex scenarios (PBX related) like
>>>> attended call transfer - in such cases you may want to route a new call
>>>> based on information of existing dialogs.
>>>>
>>>> Real case example:
>>>>
>>>> OpenSIPS is doing dispatching over a set of Asterisk boxes (which
>>>> act as SIP servers).
>>>> A calls B and the call is established (by dispatching from OpenSIPS)
>>>> via A1 Asterisk server
>>>> A wants to transfer B to a new party C, so A makes a new call to C
>>>> -> this call must end on A1 also, without going via dispatcher in openSIPS.
>>>> So, when A calls C, OpenSIPS will check if A has an already existing
>>>> call and if so, it will send the new call to the same Asterisk box as
>>>> the existing call.
>>>>
>>>> In such a case, for each call, you need to attached to the call (as
>>>> dialog variables) the callee, caller and the Asterisk box . When a new
>>>> call is coming, you check if the new caller is already involved in a
>>>> call and if so, fetch the value of the proxy in order to send to the
>>>> same box.
>>>>
>>>> For more about the technical details of the function, see
>>>> http://www.opensips.org/html/docs/modules/devel/dialog.html#id272137
>>>>
>>>> Regards,
>>>> Bogdan
>>>>
>>>> --
>>>> Bogdan-Andrei Iancu
>>>> www.voice-system.ro
>>>>
>>>>
>>>> _______________________________________________
>>>> Devel mailing list
>>>> Devel at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>>>
>>
>
More information about the Devel
mailing list