Re: [OpenSIPS-Users] Call fetch_dlg_value inside a timer route

2023-06-14 Thread Bogdan-Andrei Iancu

https://github.com/OpenSIPS/opensips/commit/a5f85013ea9156410a48614079105a7c5b41fe8e

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 6/13/23 5:39 PM, Daniel Zanutti wrote:

That's a hack! Thanks, i'll try out.

On Tue, Jun 13, 2023 at 3:31 AM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


What Alberto said still applies.

The timer route is outside the context of any SIP message, while
the function you want to use (get_profile_size) is part of the
dialog module, where most of the functions do requires the context
of a SIP dialog. I agree get_profile_size() does not need the
context and could be more flexible.
So, try this hack of using a intermediary route[], like:
    timer_route[]
   { route(foo); }
    route[foo]
   { get_profile_size(); }

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  
   https://www.siphub.com  

On 5/18/23 3:13 PM, Daniel Zanutti wrote:

Hi Alberto

In fact, i need to use: get_profile_size()

I want to count some type of calls. I've done using statistics
but not very precise.


On Wed, May 17, 2023 at 7:48 PM Alberto
mailto:alberto.rina...@gmail.com>> wrote:

This reminded me of something else, maybe it can be used here
too:
In a event route, before you can use dialog variables, you
have to load the dialog context by using
func_load_dialog_ctx. Maybe it's the same with timer routes.

https://opensips.org/docs/modules/3.2.x/dialog#func_load_dialog_ctx


On Wed, 17 May 2023, 21:07 Daniel Zanutti,
mailto:daniel.zanu...@gmail.com>>
wrote:

Hi folks

Why is it not possible to call *fetch_dlg_value *inside a
timer route? Is there any other alternative to it?

I wanted to generate some statistics every X seconds.

Thanks
___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org  
http://lists.opensips.org/cgi-bin/mailman/listinfo/users  





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Call fetch_dlg_value inside a timer route

2023-06-13 Thread Daniel Zanutti
That's a hack! Thanks, i'll try out.

On Tue, Jun 13, 2023 at 3:31 AM Bogdan-Andrei Iancu 
wrote:

> What Alberto said still applies.
>
> The timer route is outside the context of any SIP message, while the
> function you want to use (get_profile_size) is part of the dialog module,
> where most of the functions do requires the context of a SIP dialog. I
> agree get_profile_size() does not need the context and could be more
> flexible.
> So, try this hack of using a intermediary route[], like:
> timer_route[]
>{ route(foo); }
> route[foo]
>{ get_profile_size(); }
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
>   https://www.siphub.com
>
> On 5/18/23 3:13 PM, Daniel Zanutti wrote:
>
> Hi Alberto
>
> In fact, i need to use: get_profile_size()
>
> I want to count some type of calls. I've done using statistics but not
> very precise.
>
>
> On Wed, May 17, 2023 at 7:48 PM Alberto  wrote:
>
>> This reminded me of something else, maybe it can be used here too:
>> In a event route, before you can use dialog variables, you have to load
>> the dialog context by using func_load_dialog_ctx. Maybe it's the same with
>> timer routes.
>>
>> https://opensips.org/docs/modules/3.2.x/dialog#func_load_dialog_ctx
>>
>> On Wed, 17 May 2023, 21:07 Daniel Zanutti, 
>> wrote:
>>
>>> Hi folks
>>>
>>> Why is it not possible to call *fetch_dlg_value *inside a timer route?
>>> Is there any other alternative to it?
>>>
>>> I wanted to generate some statistics every X seconds.
>>>
>>> Thanks
>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Call fetch_dlg_value inside a timer route

2023-06-13 Thread Bogdan-Andrei Iancu

What Alberto said still applies.

The timer route is outside the context of any SIP message, while the 
function you want to use (get_profile_size) is part of the dialog 
module, where most of the functions do requires the context of a SIP 
dialog. I agree get_profile_size() does not need the context and could 
be more flexible.

So, try this hack of using a intermediary route[], like:
    timer_route[]
   { route(foo); }
    route[foo]
   { get_profile_size(); }

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 5/18/23 3:13 PM, Daniel Zanutti wrote:

Hi Alberto

In fact, i need to use: get_profile_size()

I want to count some type of calls. I've done using statistics but not 
very precise.



On Wed, May 17, 2023 at 7:48 PM Alberto > wrote:


This reminded me of something else, maybe it can be used here too:
In a event route, before you can use dialog variables, you have to
load the dialog context by using func_load_dialog_ctx. Maybe it's
the same with timer routes.

https://opensips.org/docs/modules/3.2.x/dialog#func_load_dialog_ctx


On Wed, 17 May 2023, 21:07 Daniel Zanutti,
mailto:daniel.zanu...@gmail.com>> wrote:

Hi folks

Why is it not possible to call *fetch_dlg_value *inside a
timer route? Is there any other alternative to it?

I wanted to generate some statistics every X seconds.

Thanks
___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Call fetch_dlg_value inside a timer route

2023-05-18 Thread Daniel Zanutti
Hi Alberto

In fact, i need to use: get_profile_size()

I want to count some type of calls. I've done using statistics but not very
precise.


On Wed, May 17, 2023 at 7:48 PM Alberto  wrote:

> This reminded me of something else, maybe it can be used here too:
> In a event route, before you can use dialog variables, you have to load
> the dialog context by using func_load_dialog_ctx. Maybe it's the same with
> timer routes.
>
> https://opensips.org/docs/modules/3.2.x/dialog#func_load_dialog_ctx
>
> On Wed, 17 May 2023, 21:07 Daniel Zanutti, 
> wrote:
>
>> Hi folks
>>
>> Why is it not possible to call *fetch_dlg_value *inside a timer route?
>> Is there any other alternative to it?
>>
>> I wanted to generate some statistics every X seconds.
>>
>> Thanks
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Call fetch_dlg_value inside a timer route

2023-05-17 Thread Alberto
This reminded me of something else, maybe it can be used here too:
In a event route, before you can use dialog variables, you have to load the
dialog context by using func_load_dialog_ctx. Maybe it's the same with
timer routes.

https://opensips.org/docs/modules/3.2.x/dialog#func_load_dialog_ctx

On Wed, 17 May 2023, 21:07 Daniel Zanutti,  wrote:

> Hi folks
>
> Why is it not possible to call *fetch_dlg_value *inside a timer route? Is
> there any other alternative to it?
>
> I wanted to generate some statistics every X seconds.
>
> Thanks
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Call fetch_dlg_value inside a timer route

2023-05-17 Thread Daniel Zanutti
Hi folks

Why is it not possible to call *fetch_dlg_value *inside a timer route? Is
there any other alternative to it?

I wanted to generate some statistics every X seconds.

Thanks
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users