Re: [SR-Users] python_exec and parameters

2017-02-10 Thread Daniel-Constantin Mierla
OK. From the code, I noticed that the old API (before kemi), it exports a getHeader(...) method to Python API. Just for sake of completion - starting with 5.0, there are more methods available, including a method to retrieve the value of any kamailio cfg variable, like in: - https://github.com

Re: [SR-Users] python_exec and parameters

2017-02-10 Thread gmele
I tested passing the parameter as suggested by Konstantin and it works fine: In kamailio.cfg : /python_exec("SendPushNotification", $_s($tU@$td!!$fU@$fd!!$ci)); / In our python script: / def SendPushNotification(self, msg, parameters): requestUri = "" fromUri = "" cal

Re: [SR-Users] python_exec and parameters

2017-02-10 Thread gmele
Hello, we are using 4.4.2. Giovanni -- View this message in context: http://sip-router.1086192.n5.nabble.com/python-exec-and-parameters-tp155803p155913.html Sent from the Users mailing list archive at Nabble.com. ___ SIP Express Router (SER) and

Re: [SR-Users] python_exec and parameters

2017-02-10 Thread Daniel-Constantin Mierla
Hello, what version of kamailio are you using? Cheers, Daniel On 10/02/2017 07:55, gmele wrote: > Hello, > > thx for the info. We will check if we wait for an enhanced version of > python_exec or pass the parameters in a string. > > Regards > > > Giovanni > > > > -- > View this message in conte

Re: [SR-Users] python_exec and parameters

2017-02-10 Thread Daniel-Constantin Mierla
On 09/02/2017 16:47, Konstantin M. wrote: > That's correct, it accepts only one parameter for now. > After many years our company has switched to kamailio, I'm actively > working on new version of app_python, more flexible and usable than > current one, many new features... > I'm not ready to pus

Re: [SR-Users] python_exec and parameters

2017-02-09 Thread gmele
Hello, thx for the info. We will check if we wait for an enhanced version of python_exec or pass the parameters in a string. Regards Giovanni -- View this message in context: http://sip-router.1086192.n5.nabble.com/python-exec-and-parameters-tp155803p155899.html Sent from the Users mailing

Re: [SR-Users] python_exec and parameters

2017-02-09 Thread Konstantin M.
That's correct, it accepts only one parameter for now. After many years our company has switched to kamailio, I'm actively working on new version of app_python, more flexible and usable than current one, many new features... I'm not ready to push new changes to current module due to raw alpha and u

Re: [SR-Users] python_exec and parameters

2017-02-09 Thread Daniel-Constantin Mierla
Hello, not very familiar with the app_python initial design, but when I added kemi support in it for kamailio 5.0, I think I noticed the limitation of 1 extra parameter. Probably you can encode your parameters in comma separated value, so you can parse it easier in the python script, as opposite t

[SR-Users] python_exec and parameters

2017-02-08 Thread gmele
Hello, in our Kamailio, we are using python_exec to execute script used to send push notifications to Google or Apple. Currenty, the method we call only accepts the message as parameter. We then extract from the message the Call Id, to URI and from URI. Here is the python method signature: *de