Hi,
I had a simple question to which I could not find a clear answer in the documentation.
How can I pass a command line argument to Kamailio config script?
For example, assume that I run my kamailio daemon using script myconf.cfg:
kamailio -f myconf.cfg
Now I want to pass a value, say an IP address and use it inside the script. Sth like
kamailio -f myconf.cfg --ip __MY_IP__
and then have an assignment of "$var=__MY_IP__" inside myconf.cfg
Is there an easy way to do this?
Hello,
you can use pre-processor defines, passing it via -A command line parameter:
kamailio -A xyz='"abc"' ...
in config:
$var(x) = xyz
Cheers, Daniel
On 25/06/14 02:31, AliReza Khoshgoftar Monfared wrote:
Hi,
I had a simple question to which I could not find a clear answer in the documentation.
How can I pass a command line argument to Kamailio config script?
For example, assume that I run my kamailio daemon using script myconf.cfg:
kamailio -f myconf.cfg
Now I want to pass a value, say an IP address and use it inside the script. Sth like
kamailio -f myconf.cfg --ip __MY_IP__
and then have an assignment of "$var=__MY_IP__" inside myconf.cfg
Is there an easy way to do this?
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
Thanks very much Daniel.
Did you mean:
kamailio -A xyz='"abc"' ...
in equivalent to
$var(xyz) = "abc"
in config?
Also is there a scope restriction on the use of $var() or -A option? I seem to be able to use it inside the route {} block but not in the global scope...
On Wed, Jun 25, 2014 at 3:31 AM, Daniel-Constantin Mierla <miconda@gmail.com
wrote:
$var(x) = xyz