On Nov 29, 2012, at 3:54 AM, Vieri wrote:
I'm trying to set a CDR userfield to a custom value. This value may contain a
'|' but it's really just part of the value.
However, Asterisk keeps warning me about the application delimiter not being
a pipe.
It's NOT an application delimiter (it's just part of a variable value) so I'm
expecting Asterisk not to warn me about it.
Is it expected behavior?
Well, you certainly didn't expect it. I would not have expected it either :-D
Why?
So, back in the early days, Asterisk inconsistently used different delimiters
depending upon context. Sometimes it used pipes, sometimes commas.
Inconsistency is never good, so we picked a winner (commas) and put in code to
look for the loser (pipes) in the dial plan and warn if they show up. ('We' in
this case would be Asterisk developers of long ago, by the way).
The code that does this checking[1] isn't the smartest code in the world. It
basically looks at the data passed to the application, and if it contains a
pipe, and no comma, and warnings are enabled, it warns you.
So you could disable warnings, but that would turn off other warnings that
might be useful.
Another option would be a small hack in your dial plan: add a comma.
MSet(CDR(userfield)=|usr_r=vieri,PIPE_HACK=true) ; Asterisk warns if it
sees a pipe without a comma.
Since you're not trying to use a pipe as a delimiter, displaying the warning is
a mistake in Asterisk. The whole pipe/comma thing happened so long ago[2], it's
time to just lose the warning altogether.
[1]:
https://code.asterisk.org/code/browse/asterisk/branches/11/main/pbx.c?u=3r=376690#to1583
[2]: https://code.asterisk.org/code/changelog/asterisk?cs=188210
See the following log:
SIP/4053-007bAGI Rx EXEC Set CDR(userfield)=|usr_r=vieri
-- AGI Script Executing Application: (Set) Options:
(CDR(userfield)=|usr_r=vieri)
[Nov 29 10:53:08] WARNING[4815]: pbx.c:1563 pbx_exec: The application
delimiter is now the comma, not the pipe. Did you forget to convert your
dialplan? (Set(CDR(userfield)=|usr_r=vieri))
SIP/4053-007bAGI Tx 200 result=0
SIP/4053-007dAGI Rx EXEC Set CDR(userfield)=\|usr_r=vieri\
-- AGI Script Executing Application: (Set) Options:
(CDR(userfield)=|usr_r=vieri)
[Nov 29 10:54:57] WARNING[4838]: pbx.c:1563 pbx_exec: The application
delimiter is now the comma, not the pipe. Did you forget to convert your
dialplan? (Set(CDR(userfield)=|usr_r=vieri))
SIP/4053-007dAGI Tx 200 result=0
Thanks,
Vieri
--
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com www.asterisk.org
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users