Re: [SR-Users] Fwd: perl_exec() using parameter?
Hello, On 10/15/10 3:43 PM, Nicolas Rüger wrote: Hello, thanks for adding it to the list. The feature would help me a lot. In the meanwhile... I tried to use AVPs instead, but didn't work. I guess I use them in a wrong way...!? $avp(i:3) = $fu; perl_exec(mytest,$avp(i:3)); Using these lines $avp(i:3) is passed as a static string again of course. So how can I pass something like the value of $fu from routing logic to my perl script then??? you have to use the functions from perl library to get the value of any avp you want: http://kamailio.org/docs/modules/stable/modules_k/perl.html#ID-f092a1ce520e2e575c41702289adf85e So you don't pass the avps as argument, all avps are accessible via API. Cheers, Daniel -- Daniel-Constantin Mierla http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Fwd: perl_exec() using parameter?
Hello, thanks for adding it to the list. The feature would help me a lot. In the meanwhile... I tried to use AVPs instead, but didn't work. I guess I use them in a wrong way...!? $avp(i:3) = $fu; perl_exec(mytest,$avp(i:3)); Using these lines $avp(i:3) is passed as a static string again of course. So how can I pass something like the value of $fu from routing logic to my perl script then??? Thank you. Regards, Nicolas It was not in my plans, I said that development for passing kamailio cfg variables to second parameter of perl_exec() won't be big effort. I'll add it to my to-do list, but I cannot say when I will do it. You can use meanwhile Alex's solution with avps. Cheers, Daniel -- GMX DSL Doppel-Flat ab 19,99 euro;/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Fwd: perl_exec() using parameter?
Hello Daniel, sounds like you're planning to change it, so that one can pass variables via perl_exec()!? Did I understand you correctly!? Any idea when this will be ready to use? Sorry, for bothering you, but I need it for my thesis and the deadline is soon ;) Thank you... Regards, Nicolas Original-Nachricht Datum: Mon, 11 Oct 2010 23:48:12 +0200 Von: Daniel-Constantin Mierla mico...@gmail.com An: Nicolas Rüger nicolasrue...@gmx.de CC: sr-users@lists.sip-router.org Betreff: Re: [SR-Users] Fwd: perl_exec() using parameter? Hello, On 10/11/10 2:06 PM, Nicolas Rüger wrote: Hello, any ideas for parameter passing to perl-scripts are appreciated!!! as I understand the documentation, perl_exec() executes a function in Perl script set by filename parameter. I checked the sources and the second parameter to perl exec is considered static string. It won't be lot of work to make it dynamic PV container. For now you can use Alex's suggestion with passing via variables. Cheers, Daniel Regards, Nicolas original Hello, is there any chance to pass parameters (like from_uri or to_uri) from the kamailio routing logic to a perl script? I know that the whole sip message is provided as parameter but I wonder if there's a way to pass just the caller's uri (from tag) or the callee's uri (to tag) as a second parameter to the perl script. By using xlog it's clear that in $fu and $ru one can find the uri's. xlog(from: $fu to: $ru \n) OUTPUT: from: sip:use...@mykamailio.de to:use...@mykamailio.de BUT using these variables as a second parameter in perl_exec() leads to an error on kamailio start-up cause of bad config file. perl_exec(my_perl_script,$fu); Any suggestions or ideas??? Thank you... Regards, Nicolas -- Daniel-Constantin Mierla http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Fwd: perl_exec() using parameter?
On 10/12/10 12:23 PM, Nicolas Rüger wrote: Hello Daniel, sounds like you're planning to change it, so that one can pass variables via perl_exec()!? It was not in my plans, I said that development for passing kamailio cfg variables to second parameter of perl_exec() won't be big effort. I'll add it to my to-do list, but I cannot say when I will do it. You can use meanwhile Alex's solution with avps. Cheers, Daniel Did I understand you correctly!? Any idea when this will be ready to use? Sorry, for bothering you, but I need it for my thesis and the deadline is soon ;) Thank you... Regards, Nicolas Original-Nachricht Datum: Mon, 11 Oct 2010 23:48:12 +0200 Von: Daniel-Constantin Mierlamico...@gmail.com An: Nicolas Rügernicolasrue...@gmx.de CC: sr-users@lists.sip-router.org Betreff: Re: [SR-Users] Fwd: perl_exec() using parameter? Hello, On 10/11/10 2:06 PM, Nicolas Rüger wrote: Hello, any ideas for parameter passing to perl-scripts are appreciated!!! as I understand the documentation, perl_exec() executes a function in Perl script set by filename parameter. I checked the sources and the second parameter to perl exec is considered static string. It won't be lot of work to make it dynamic PV container. For now you can use Alex's suggestion with passing via variables. Cheers, Daniel Regards, Nicolas original Hello, is there any chance to pass parameters (like from_uri or to_uri) from the kamailio routing logic to a perl script? I know that the whole sip message is provided as parameter but I wonder if there's a way to pass just the caller's uri (from tag) or the callee's uri (to tag) as a second parameter to the perl script. By using xlog it's clear that in $fu and $ru one can find the uri's. xlog(from: $fu to: $ru \n) OUTPUT: from: sip:use...@mykamailio.de to:use...@mykamailio.de BUT using these variables as a second parameter in perl_exec() leads to an error on kamailio start-up cause of bad config file. perl_exec(my_perl_script,$fu); Any suggestions or ideas??? Thank you... Regards, Nicolas -- Daniel-Constantin Mierla http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Fwd: perl_exec() using parameter?
I used AVPs back when I used to use the Perl module... On 10/11/2010 08:06 AM, Nicolas Rüger wrote: Hello, any ideas for parameter passing to perl-scripts are appreciated!!! Regards, Nicolas original Hello, is there any chance to pass parameters (like from_uri or to_uri) from the kamailio routing logic to a perl script? I know that the whole sip message is provided as parameter but I wonder if there's a way to pass just the caller's uri (from tag) or the callee's uri (to tag) as a second parameter to the perl script. By using xlog it's clear that in $fu and $ru one can find the uri's. xlog(from: $fu to: $ru \n) OUTPUT: from: sip:use...@mykamailio.de to:use...@mykamailio.de BUT using these variables as a second parameter in perl_exec() leads to an error on kamailio start-up cause of bad config file. perl_exec(my_perl_script,$fu); Any suggestions or ideas??? Thank you... Regards, Nicolas -- Alex Balashov - Principal Evariste Systems LLC 1170 Peachtree Street 12th Floor, Suite 1200 Atlanta, GA 30309 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/ ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Fwd: perl_exec() using parameter?
Hello, On 10/11/10 2:06 PM, Nicolas Rüger wrote: Hello, any ideas for parameter passing to perl-scripts are appreciated!!! as I understand the documentation, perl_exec() executes a function in Perl script set by filename parameter. I checked the sources and the second parameter to perl exec is considered static string. It won't be lot of work to make it dynamic PV container. For now you can use Alex's suggestion with passing via variables. Cheers, Daniel Regards, Nicolas original Hello, is there any chance to pass parameters (like from_uri or to_uri) from the kamailio routing logic to a perl script? I know that the whole sip message is provided as parameter but I wonder if there's a way to pass just the caller's uri (from tag) or the callee's uri (to tag) as a second parameter to the perl script. By using xlog it's clear that in $fu and $ru one can find the uri's. xlog(from: $fu to: $ru \n) OUTPUT: from: sip:use...@mykamailio.de to:use...@mykamailio.de BUT using these variables as a second parameter in perl_exec() leads to an error on kamailio start-up cause of bad config file. perl_exec(my_perl_script,$fu); Any suggestions or ideas??? Thank you... Regards, Nicolas -- Daniel-Constantin Mierla http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users