[SR-Users] Re: rtimer intermittent failures

2024-03-04 Thread Richard Chan via sr-users
In the method can you put

return 1

at the end. KEMI python is very strict on an int return value.

On Tue, 5 Mar 2024, 07:08 Marrold via sr-users, 
wrote:

> Hi all,
>
> I am using Kamailio 5.7.4 on a Debian 12 machine, with a Python Kemi based
> config. I am seeing some intermittent failures when accessing an instance
> variable within a function called by rtimer.
>
> I'm using the rtimer module with the following parameters:
>
> modparam("rtimer", "timer", "name=hello;interval=5;mode=0;")
> modparam("rtimer", "exec", "timer=hello;route=ksr_route_hello")
>
> I initialise the kamailio class, and instance variable like this:
>
> class kamailio:
> def __init__(self):
>
> self.hello = "hi"
>
> Within the class I have the following route  function:
>
> def ksr_route_hello(self, msg, evname):
>
> KSR.info("Running ksr_route_hello\n")
> KSR.info(f"Hello? {self.hello}\n")
>
> Then in the logs I see it sometimes works, and sometimes fails:
>
>  9(15) INFO:  [core/kemi.c:106]: sr_kemi_core_info(): Running
> ksr_route_hello
>  9(15) INFO:  [core/kemi.c:106]: sr_kemi_core_info(): Hello? hi
>
>  9(15) INFO:  [core/kemi.c:106]: sr_kemi_core_info(): Running
> ksr_route_hello
>  9(15) ERROR: app_python3 [python_support.c:167]:
> python_handle_exception(): apy_exec: ksr_route_hello(rtimer): Unhandled
> exception in the Python code:
> TypeError: 'NoneType' object cannot be interpreted as an integer
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "/etc/kamailio/kamailio.py", line 1007, in ksr_route_hello
> KSR.info("Running ksr_route_hello\n")
> SystemError:  returned a result with an exception
> set
>
> Does anyone know where I'm going wrong?
>
> Thanks
> Matthew
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] rtimer intermittent failures

2024-03-04 Thread Marrold via sr-users
Hi all,

I am using Kamailio 5.7.4 on a Debian 12 machine, with a Python Kemi based
config. I am seeing some intermittent failures when accessing an instance
variable within a function called by rtimer.

I'm using the rtimer module with the following parameters:

modparam("rtimer", "timer", "name=hello;interval=5;mode=0;")
modparam("rtimer", "exec", "timer=hello;route=ksr_route_hello")

I initialise the kamailio class, and instance variable like this:

class kamailio:
def __init__(self):

self.hello = "hi"

Within the class I have the following route  function:

def ksr_route_hello(self, msg, evname):

KSR.info("Running ksr_route_hello\n")
KSR.info(f"Hello? {self.hello}\n")

Then in the logs I see it sometimes works, and sometimes fails:

 9(15) INFO:  [core/kemi.c:106]: sr_kemi_core_info(): Running
ksr_route_hello
 9(15) INFO:  [core/kemi.c:106]: sr_kemi_core_info(): Hello? hi

 9(15) INFO:  [core/kemi.c:106]: sr_kemi_core_info(): Running
ksr_route_hello
 9(15) ERROR: app_python3 [python_support.c:167]:
python_handle_exception(): apy_exec: ksr_route_hello(rtimer): Unhandled
exception in the Python code:
TypeError: 'NoneType' object cannot be interpreted as an integer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/etc/kamailio/kamailio.py", line 1007, in ksr_route_hello
KSR.info("Running ksr_route_hello\n")
SystemError:  returned a result with an exception
set

Does anyone know where I'm going wrong?

Thanks
Matthew
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: RADIUS ACC - Interim Updates

2024-03-04 Thread Henning Westerholt via sr-users
Hello,

not exactly what you are looking for, but you could switch to diameter and use 
ims_charging, which supports this kind of interim updates.

Cheers,

Henning

> -Original Message-
> From: Duarte Rocha via sr-users 
> Sent: Montag, 4. März 2024 18:20
> To: sr-users@lists.kamailio.org
> Cc: duarteroch...@gmail.com
> Subject: [SR-Users] RADIUS ACC - Interim Updates
> 
> Hello all,
> 
> I can't seem to find a way to make interim accounting requests for RADIUS.
> Can you help me with this?
> 
> I can't find any native way for doing this. I've thought of getting a custom
> timer for each dialog and run a event route similar do dialog:start or
> dialog:end. Is that possible?
> 
> Cheers,
> 
> Duarte Rocha
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe
> send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the
> sender!
> Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] RADIUS ACC - Interim Updates

2024-03-04 Thread Duarte Rocha via sr-users
Hello all, 

I can't seem to find a way to make interim accounting requests for RADIUS. Can 
you help me with this?

I can't find any native way for doing this. I've thought of getting a custom 
timer for each dialog and run a event route similar do dialog:start or 
dialog:end. Is that possible?

Cheers,

Duarte Rocha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Question syntax check / plausi check kamailio.cfg

2024-03-04 Thread Richard Edmands via sr-users
and it can only show certain types of failures, others can only be spotted at 
run time.
it’s good to have a debug toggle in the config file so if there is an issue 
then you can toggle it, try and run kamailio, then check the logs to see why it 
didn’t start.


> On 5 Mar 2024, at 12:40 am, Alex Balashov via sr-users 
>  wrote:
> 
> No, that's pretty much how it's done.
> 
>> On 4 Mar 2024, at 08:24, Valentin Christoph via sr-users 
>>  wrote:
>> 
>> Dear all,
>> 
>> Is there any other possibility to (automatically) check the 
>> plausibility/syntax of an existing kamailio.cfg, besides
>> 
>> kamailio -c -f kamailio.cfg
>> 
>> ?
>> 
>> Thanks,
>> Christoph
>> __
>> Kamailio - Users Mailing List - Non Commercial Discussions
>> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only to the 
>> sender!
>> Edit mailing list options or unsubscribe:
> 
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web: https://evaristesys.com
> Tel: +1-706-510-6800
> 
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Question syntax check / plausi check kamailio.cfg

2024-03-04 Thread Alex Balashov via sr-users
No, that's pretty much how it's done.

> On 4 Mar 2024, at 08:24, Valentin Christoph via sr-users 
>  wrote:
> 
> Dear all,
> 
> Is there any other possibility to (automatically) check the 
> plausibility/syntax of an existing kamailio.cfg, besides
> 
> kamailio -c -f kamailio.cfg
> 
> ?
> 
> Thanks,
> Christoph
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

-- 
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Question syntax check / plausi check kamailio.cfg

2024-03-04 Thread Valentin Christoph via sr-users
Dear all,

Is there any other possibility to (automatically) check the plausibility/syntax 
of an existing kamailio.cfg, besides

kamailio -c -f kamailio.cfg

?

Thanks,
Christoph
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: