Hi all,
i try to re-arrange my config and i try to use a variable declared in modparam pv such like: modparam("pv", "varset", "externalip=s:1.2.3.4")
and use it as: force_send_socket($var(externalip));
unfortunately the kamailio does not start with this configuration and telling me bad config file like: line 109, column 36: bad argument, [proto:]host[:port] expected
it seems the force_send_socket is not able to get variable. Is there any other way to have static content defined and put across the config?
Reason for the question is the possibility to use ansible as deployment tool. I set all the variables i need in a separate file and include it. This file contains the entire modconfig and global vars section to adapt this part to every single machine individually. This does not work if i need to put "constant" variables on different places in my config.
If anybody has ever made this, could you please help me, or give any suggestions?
Many thanks! BR Jöran
Hi Jöran,
have you tried it using the $fs PV (http://kamailio.org/wiki/cookbooks/devel/pseudovariables#fs_-_forced_socket)... Probably, that one works better for use-cases like yours....
Thanks, Carsten
2017-04-04 17:14 GMT+02:00 Jöran Vinzens vinzens@sipgate.de:
Hi all,
i try to re-arrange my config and i try to use a variable declared in modparam pv such like: modparam("pv", "varset", "externalip=s:1.2.3.4")
and use it as: force_send_socket($var(externalip));
unfortunately the kamailio does not start with this configuration and telling me bad config file like: line 109, column 36: bad argument, [proto:]host[:port] expected
it seems the force_send_socket is not able to get variable. Is there any other way to have static content defined and put across the config?
Reason for the question is the possibility to use ansible as deployment tool. I set all the variables i need in a separate file and include it. This file contains the entire modconfig and global vars section to adapt this part to every single machine individually. This does not work if i need to put "constant" variables on different places in my config.
If anybody has ever made this, could you please help me, or give any suggestions?
Many thanks! BR Jöran
--
Jöran Vinzens - vinzens@sipgate.de
sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391
www.sipgate.de - www.sipgate.co.uk
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
Hello,
see $fs variable.
I also plan to move force_send_socket() (or make a new function set_send_socket()) in corex module to allow vars as parameter.
Cheers, Daniel
On 04.04.17 17:14, Jöran Vinzens wrote:
Hi all,
i try to re-arrange my config and i try to use a variable declared in modparam pv such like: modparam("pv", "varset", "externalip=s:1.2.3.4")
and use it as: force_send_socket($var(externalip));
unfortunately the kamailio does not start with this configuration and telling me bad config file like: line 109, column 36: bad argument, [proto:]host[:port] expected
it seems the force_send_socket is not able to get variable. Is there any other way to have static content defined and put across the config?
Reason for the question is the possibility to use ansible as deployment tool. I set all the variables i need in a separate file and include it. This file contains the entire modconfig and global vars section to adapt this part to every single machine individually. This does not work if i need to put "constant" variables on different places in my config.
If anybody has ever made this, could you please help me, or give any suggestions?
Many thanks! BR Jöran
-- Jöran Vinzens - vinzens@sipgate.de mailto:vinzens@sipgate.de
sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391
www.sipgate.de http://www.sipgate.de - www.sipgate.co.uk http://www.sipgate.co.uk
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
Just a guess, have you tried:
modparam("pv", "varset", "externalip=s:udp:1.2.3.4:5060") or modparam("pv", "varset", "externalip=s:tcp:1.2.3.4:5060")
etc...
Also maybe instead of force_send_socket method, a direct assignment?
$fs = $var(externalip);
On Tue, Apr 4, 2017 at 8:14 AM, Jöran Vinzens vinzens@sipgate.de wrote:
Hi all,
i try to re-arrange my config and i try to use a variable declared in modparam pv such like: modparam("pv", "varset", "externalip=s:1.2.3.4")
and use it as: force_send_socket($var(externalip));
unfortunately the kamailio does not start with this configuration and telling me bad config file like: line 109, column 36: bad argument, [proto:]host[:port] expected
it seems the force_send_socket is not able to get variable. Is there any other way to have static content defined and put across the config?
Reason for the question is the possibility to use ansible as deployment tool. I set all the variables i need in a separate file and include it. This file contains the entire modconfig and global vars section to adapt this part to every single machine individually. This does not work if i need to put "constant" variables on different places in my config.
If anybody has ever made this, could you please help me, or give any suggestions?
Many thanks! BR Jöran
--
Jöran Vinzens - vinzens@sipgate.de
sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391
www.sipgate.de - www.sipgate.co.uk
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
Hi All,
thanks for the help. The trick using $fs is working fine!
BR Jöran
On Tue, Apr 4, 2017 at 7:34 PM, Brandon Armstead brandon@cryy.com wrote:
Just a guess, have you tried:
modparam("pv", "varset", "externalip=s:udp:1.2.3.4:5060") or modparam("pv", "varset", "externalip=s:tcp:1.2.3.4:5060")
etc...
Also maybe instead of force_send_socket method, a direct assignment?
$fs = $var(externalip);
On Tue, Apr 4, 2017 at 8:14 AM, Jöran Vinzens vinzens@sipgate.de wrote:
Hi all,
i try to re-arrange my config and i try to use a variable declared in modparam pv such like: modparam("pv", "varset", "externalip=s:1.2.3.4")
and use it as: force_send_socket($var(externalip));
unfortunately the kamailio does not start with this configuration and telling me bad config file like: line 109, column 36: bad argument, [proto:]host[:port] expected
it seems the force_send_socket is not able to get variable. Is there any other way to have static content defined and put across the config?
Reason for the question is the possibility to use ansible as deployment tool. I set all the variables i need in a separate file and include it. This file contains the entire modconfig and global vars section to adapt this part to every single machine individually. This does not work if i need to put "constant" variables on different places in my config.
If anybody has ever made this, could you please help me, or give any suggestions?
Many thanks! BR Jöran
--
Jöran Vinzens - vinzens@sipgate.de
sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391
www.sipgate.de - www.sipgate.co.uk
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
-- Sincerely, Brandon Armstead CTO / CRYY.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