first section of page
http://sip-router.org/wiki/cookbooks/selects/devel
had example
@msg.["P-anyheader-youwant"])
that, however, produced syntax error. i removed the dot and got rid of the error. i then went and fixed the wiki page too.
however, later on the page there still is
@msg.%s
and many more like that. are they generated automatically? if so, then fixing them on the wiki page would not help.
also, is there somewhere a summary of pv syntax of s and k flavors?
-- juha
On Mar 28, 2010 at 11:57, Juha Heinanen jh@tutpro.com wrote:
first section of page
http://sip-router.org/wiki/cookbooks/selects/devel
had example
@msg.["P-anyheader-youwant"])
that, however, produced syntax error. i removed the dot and got rid of the error. i then went and fixed the wiki page too.
however, later on the page there still is
@msg.%s
This is equivalent to @msg[%s] (so there is no error in this case). E.g. @msg["P-Foo"] is equivalent with @msg.P-Foo.
and many more like that. are they generated automatically? if so, then fixing them on the wiki page would not help.
No, that page is not generated automatically.
You can find the list with all the selects, auto-generated from the code here: http://sip-router.org/docbook/sip-router/branch/master/select_list/select_li...
also, is there somewhere a summary of pv syntax of s and k flavors?
If you mean differences between selects & pv, then no. The selects are documented in 3 places: http://sip-router.org/wiki/ref_manual/selects http://sip-router.org/docbook/sip-router/branch/master/select_list/select_li... http://sip-router.org/wiki/cookbooks/selects/devel (contains the above 2 links)
Andrei
Andrei Pelinescu-Onciul writes:
This is equivalent to @msg[%s] (so there is no error in this case). E.g. @msg["P-Foo"] is equivalent with @msg.P-Foo.
i tried
$var(calling_uri) = @msg.Referred-By.nameaddr.uri;
and got syntax errors:
0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: syntax error 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: '('')' expected (function call) 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 40-43: bad expression: type mismatch: str instead of int at (961,40) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: bad command 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: '('')' expected (function call) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: bad command: missing ';'? 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 53-55: bad command
-- juha
Juha Heinanen writes:
This is equivalent to @msg[%s] (so there is no error in this case). E.g. @msg["P-Foo"] is equivalent with @msg.P-Foo.
i tried
$var(calling_uri) = @msg.Referred-By.nameaddr.uri;
and got syntax errors:
0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: syntax error 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: '('')' expected (function call) 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 40-43: bad expression: type mismatch: str instead of int at (961,40) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: bad command 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: '('')' expected (function call) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: bad command: missing ';'? 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 53-55: bad command
just to add,
$var(calling_uri) = @msg["Referred-By"].nameaddr.uri;
does not produce syntax errors, but generates this kind of error message at proxy restart:
Mar 29 14:47:59 localhost /usr/sbin/sip-proxy[2681]: ERROR: <core> [select.c:315]: Unable to resolve select 'Referred-By' at level 1 Mar 29 14:47:59 localhost /usr/sbin/sip-proxy[2681]: BUG: <core> [rvalue.c:2771]: Unable to resolve select
-- juha
On Mar 29, 2010 at 14:49, Juha Heinanen jh@tutpro.com wrote:
Juha Heinanen writes:
This is equivalent to @msg[%s] (so there is no error in this case). E.g. @msg["P-Foo"] is equivalent with @msg.P-Foo.
i tried
$var(calling_uri) = @msg.Referred-By.nameaddr.uri;
and got syntax errors:
0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: syntax error 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: '('')' expected (function call) 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 40-43: bad expression: type mismatch: str instead of int at (961,40) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: bad command 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: '('')' expected (function call) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: bad command: missing ';'? 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 53-55: bad command
just to add,
$var(calling_uri) = @msg["Referred-By"].nameaddr.uri;
does not produce syntax errors, but generates this kind of error message at proxy restart:
Mar 29 14:47:59 localhost /usr/sbin/sip-proxy[2681]: ERROR: <core> [select.c:315]: Unable to resolve select 'Referred-By' at level 1 Mar 29 14:47:59 localhost /usr/sbin/sip-proxy[2681]: BUG: <core> [rvalue.c:2771]: Unable to resolve select
Looks like a doc error and a logging error (BUG instead of ERROR).
It should be: @msg.header["h_name"] or @msg.header["h_name"][number] (selects the "number" h_name)
You could also use the @msg.h["..."] shortcut (IIRC is equiv to @msg.header).
See http://sip-router.org/docbook/sip-router/branch/master/select_list/select_li... (they should be up-to-date and correct and the name is mostly self-explaining)
Andrei
On Mar 29, 2010 at 13:26, Juha Heinanen jh@tutpro.com wrote:
Andrei Pelinescu-Onciul writes:
This is equivalent to @msg[%s] (so there is no error in this case). E.g. @msg["P-Foo"] is equivalent with @msg.P-Foo.
i tried
$var(calling_uri) = @msg.Referred-By.nameaddr.uri;
and got syntax errors: 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: syntax error 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: '('')' expected (function call)
This particular header name won't work this way because it has a '-' and the parser intterprets it as as: @msg.Referred - By.nameaddr.uri
(that's why you get the error about missing (), the parser thinks you wanted to call a function named By.nameaddr.uri())
So if a select parameter contains a special characted (or better anything besides [a-zA-Z0-9_]), use ["..."] (we should document it somewhere).
0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 40-43: bad expression: type mismatch: str instead of int at (961,40) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 43: bad command 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: '('')' expected (function call) 0(22068) : <core> [cfg.y:3382]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 52: bad command: missing ';'? 0(22068) : <core> [cfg.y:3379]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 961, column 53-55: bad command
Andrei