<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi!</p>
<p><br>
</p>
<p>I suggest moving the script out of the "/root"-folder into a folder that you know Kamailio is able to access (unless you run Kamailio as root), and then make sure the file is executable by Kamailio, i.e. "mv /root/test.pl /var/tmp && chmod 755 /var/tmp/test.pl".</p>
<p><br>
</p>
<p>For example I'm running this in my config, which works fine to get the parameters:</p>
<p><span>exec_msg("/usr/src/script.sh '$tU' '$ci'");</span><br>
</p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>/Tobias</span></p>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.sip-router.org> on behalf of Venkatesh Macha <linuxvenkey@gmail.com><br>
<b>Sent:</b> Wednesday, January 25, 2017 11:41 AM<br>
<b>To:</b> sr-users@lists.sip-router.org<br>
<b>Subject:</b> [SR-Users] Executing perl script with command line parameters.</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi all, <br>
<br>
   I am trying to execute external Perl script from the Kamailio config<br>
file. My script accepts few command line parameters but if I try to pass<br>
command line parameters like below, It is not working.<br>
<br>
exec_msg("/root/test.pl 10000 '$var(env)' '$fU'");  # i tried with exec_avp<br>
also<br>
<br>
How to execute the external Perl scripts with few arguments.<br>
<br>
Thank you in Advance.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://sip-router.1086192.n5.nabble.com/Executing-perl-script-with-command-line-parameters-tp155359.html" id="LPlnk280257" previewremoved="true">
http://sip-router.1086192.n5.nabble.com/Executing-perl-script-with-command-line-parameters-tp155359.html</a>
<div id="LPBorder_GT_14853437427570.905774782978044" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14853437427550.32015788746128604" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14853437427560.6811944986000846" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14853437427560.3223384659728876"></div>
<div id="LPTitle_14853437427560.47499166960279116" style="top: 0px; color: rgb(0, 114, 57); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14853437427560.42685351178550013" href="http://sip-router.1086192.n5.nabble.com/Executing-perl-script-with-command-line-parameters-tp155359.html" target="_blank" style="text-decoration: none;">Users - Executing perl script with command line
 parameters.</a></div>
<div id="LPMetadata_14853437427560.7684094063286582" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
sip-router.1086192.n5.nabble.com</div>
<div id="LPDescription_14853437427570.2449651996282749" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Executing perl script with command line parameters. Hi all, I am trying to execute external Perl script from the Kamailio config file. My script accepts few command line parameters but if I try...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
Sent from the Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
sr-users@lists.sip-router.org<br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" id="LPlnk155012" previewremoved="true">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
<div id="LPBorder_GT_14853438005560.4676696930291915" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14853438005530.9600351741270396" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14853438005530.031180466869229928" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14853438005540.5169853464148955"></div>
<div id="LPTitle_14853438005540.2685780791386774" style="top: 0px; color: rgb(0, 114, 57); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14853438005550.9345952679571872" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" style="text-decoration: none;">sr-users mailing list - SIP-Router</a></div>
<div id="LPMetadata_14853438005560.3195314858002989" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.sip-router.org</div>
<div id="LPDescription_14853438005560.04155483241137392" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
SIP Router Users Mailing list - online email forum for communities of SIP Express Router (SER) and Kamailio (OpenSER) projects. Subscription is open to anyone that ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>