[OpenSIPS-Devel] Using dialog module functions from LOCAL_ROUTE

Bogdan-Andrei Iancu bogdan at voice-system.ro
Sun Sep 27 22:07:01 CEST 2009


yes, it is NULL as in LOCAL ROUTE there is no dialog information stored 
- this is by design (not intended to have dialog context in LOCAL ROUTE. 
This information can be pushed from the dialog module as the dialog 
module is the one triggering the BYE request...

...give a bit to review some code.....

Regards,
Bogdan

Alex Massover wrote:
> It fails in dialog.c in w_fetch_dlg_value () here:
>
> if ( (dlg=get_current_dialog())==NULL ) {
>                 return -1;
>
> get_current_dialog() doesn't return a dialog :(
>
> --
> Sincerely yours,
> Alex Massover
> VoIP R&D TL
> Jajah Inc.
>
>
>   
>> -----Original Message-----
>> From: devel-bounces at lists.opensips.org [mailto:devel-
>> bounces at lists.opensips.org] On Behalf Of Alex Massover
>> Sent: Sunday, September 27, 2009 1:10 PM
>> To: OpenSIPS devel mailling list
>> Subject: Re: [OpenSIPS-Devel] Using dialog module functions from
>> LOCAL_ROUTE
>>
>> Hi!
>>
>> It's a BYE request generated by dlg_end_dlg(). I need to
>> fetch_dlg_value() to get variables stored on the dialog to send them
>> with accounting extra headers.
>>
>> This is what I have in opensips.cfg:
>>
>> modparam("acc", "radius_extra", "Connect-Info=$avp(s:info);....... ")
>> ...
>> ...
>> ...
>> local_route
>> {
>>          if(is_method("BYE"))
>>          {
>>                 fetch_dlg_value("internal_callid","$avp(s:info)");
>>                 acc_rad_request("200");
>>          }
>> }
>>
>> This works for me for regular BYEs, but not with locally generated
>> BYEs, even with the hack below.
>>
>>
>> --
>> Sincerely yours,
>> Alex Massover
>> VoIP R&D TL
>> Jajah Inc.
>>
>>     
>>> -----Original Message-----
>>> From: devel-bounces at lists.opensips.org [mailto:devel-
>>> bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
>>> Sent: Sunday, September 27, 2009 1:32 PM
>>> To: OpenSIPS devel mailling list
>>> Subject: Re: [OpenSIPS-Devel] Using dialog module functions from
>>> LOCAL_ROUTE
>>>
>>> Hi Alex,
>>>
>>> for what kind of requests (from LOCAL route) you try to use the dlg
>>> stuff?
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Alex Massover wrote:
>>>       
>>>> Hi!
>>>>
>>>> I'm looking for a way to use fetch_dlg_value() inside LOCAL_ROUTE.
>>>>         
>> I
>>     
>>>> edited dialog.c to to enable it:
>>>>
>>>> {"fetch_dlg_value",(cmd_function)w_fetch_dlg_value,
>>>>         
>> 2,fixup_dlg_fval,
>>     
>>>> 0, REQUEST_ROUTE| FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE |
>>>> LOCAL_ROUTE },
>>>>
>>>> Now I can write fetch_dlg_value() inside the LOCAL_ROUTE, but I'm
>>>> getting NULLs always.
>>>>
>>>> Can anybody point me what else do I need to hack to have access to
>>>> dialog variables from LOCAL_ROUTE?
>>>>
>>>> Also what is the reason not to enable all dialog functions from
>>>> LOCAL_ROUTE?
>>>>         



More information about the Devel mailing list