$var(x) = "abcd"; $(var(x){s.substr,1,0}); Hello all,
I took the example from the documentation, but Kamailio.cfg has errors with this example.
Errors=> 0(14444) CRITICAL: <core> [core/cfg.y:3489]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 1-23: pvar with transformations in assignment left side 0(14444) CRITICAL: <core> [core/cfg.y:3492]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 24: syntax error 0(14444) CRITICAL: <core> [core/cfg.y:3492]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 24: bad command
Thank you,
On Fri, Sep 07, 2018 at 02:20:11PM +0000, Wilkins, Steve wrote:
0(14444) CRITICAL: <core> [core/cfg.y:3489]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 1-23: pvar with transformations in assignment left side
This is the real issue. Are you doing anything with the transformed value, like storing it in another variable? It cannot exist as a free-floating statement.
Yes, I will assign it to $dlg_var(X) = $var(x);
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Friday, September 7, 2018 10:31 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] kamailio.cfg errors with this example from documentation
On Fri, Sep 07, 2018 at 02:20:11PM +0000, Wilkins, Steve wrote:
0(14444) CRITICAL: <core> [core/cfg.y:3489]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 1-23: pvar with transformations in assignment left side
This is the real issue. Are you doing anything with the transformed value, like storing it in another variable? It cannot exist as a free-floating statement.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If I understand you correctly, you're saying ...
$dlg_var(x) = $(var(x){s.substr,1,0});
doesn't work?
Bear in mind you can't just copy and paste the example. This, from the example, will not work:
$(var(x){s.substr,1,0});
... because Kamailio's grammar doesn't allow for it.
-- Alex
On Fri, Sep 07, 2018 at 02:36:50PM +0000, Wilkins, Steve wrote:
Yes, I will assign it to $dlg_var(X) = $var(x);
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Friday, September 7, 2018 10:31 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] kamailio.cfg errors with this example from documentation
On Fri, Sep 07, 2018 at 02:20:11PM +0000, Wilkins, Steve wrote:
0(14444) CRITICAL: <core> [core/cfg.y:3489]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 1-23: pvar with transformations in assignment left side
This is the real issue. Are you doing anything with the transformed value, like storing it in another variable? It cannot exist as a free-floating statement.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Here is what I actually do =>
$var(x) = $ct; $(var(x){s.substr,1,0}); $dlg_var(callercontact) = $var(x);
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Friday, September 7, 2018 10:41 AM To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] kamailio.cfg errors with this example from documentation
If I understand you correctly, you're saying ...
$dlg_var(x) = $(var(x){s.substr,1,0});
doesn't work?
Bear in mind you can't just copy and paste the example. This, from the example, will not work:
$(var(x){s.substr,1,0});
... because Kamailio's grammar doesn't allow for it.
-- Alex
On Fri, Sep 07, 2018 at 02:36:50PM +0000, Wilkins, Steve wrote:
Yes, I will assign it to $dlg_var(X) = $var(x);
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Friday, September 7, 2018 10:31 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] kamailio.cfg errors with this example from documentation
On Fri, Sep 07, 2018 at 02:20:11PM +0000, Wilkins, Steve wrote:
0(14444) CRITICAL: <core> [core/cfg.y:3489]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 827, column 1-23: pvar with transformations in assignment left side
This is the real issue. Are you doing anything with the transformed value, like storing it in another variable? It cannot exist as a free-floating statement.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Fri, Sep 07, 2018 at 02:47:22PM +0000, Wilkins, Steve wrote:
Here is what I actually do =>
$var(x) = $ct; $(var(x){s.substr,1,0}); $dlg_var(callercontact) = $var(x);
Well, you can't do that. You have to do it my way. ;-)