[Home]

Summary:ASTERISK-22478: [patch]Can't use pound(hash) symbol for custom DTMF menus in ConfBridge (processed as directive)
Reporter:Nicolas Tanski (nicolastanski)Labels:
Date Opened:2013-09-06 09:23:18Date Closed:2013-11-01 20:18:23
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_confbridge
Versions:11.5.0 Frequency of
Occurrence
Related
Issues:
is duplicated byASTERISK-23590 confbridge menu doesn't accept # as definable menu option
Environment:Attachments:( 0) jira_asterisk_22478_v11.patch
( 1) patch_config
Description:The # is not recognized within the file confbridge.conf the other values

{noformat}
[fancymenu]
type=menu
#=dialplan_exec(test,1,1) ; ERROR

*=playback_and_continue(conf-togglemute)
*1=toggle_mute
1=toggle_mute
*2=leave_conference
2=leave_conference
*3=dialplan_exec(addcallers,1,1)
3=dialplan_exec(addcallers,1,1)
*4=decrease_listening_volume
4=decrease_listening_volume
*5=reset_listening_volume
5=reset_listening_volume
*6=increase_listening_volume
6=increase_listening_volume
*7=decrease_talking_volume
7=decrease_talking_volume
*8=reset_talking_volume
8=reset_talking_volume
*9=increase_talking_volume
9=increase_talking_volume
*0=no_op
0=no_op
{noformat}

[Edit by Rusty Newton - added below questions]

Additional questions:

* Do we have the available DTMF digits for confbridge menus documented anywhere?
* The examples in confbridge.conf show *1234567890, what about #ABCD? Should we be able to use those?
Comments:By: Nicolas Tanski (nicolastanski) 2013-09-09 09:26:22.546-0500

[interno]
exten => 80,1,Answer
exten => 80,n,Goto(sala01,s,1)

[sala01]
exten => s,1,ConfBridge(01,default_bridge,default_user,default_menu)

[teste]
exten => s,1,Playback(tt-monkeys)

-----------------------------------------

confbridge.conf

[default_bridge]
type=bridge
max_members=4
leave_conference

[default_user]
type=user
announce_only_user=yes
dtmf_passthrough=no

[default_menu]
1=leave_conference
#=dialplan_exec(teste,s,1) <<<<<<<<<<<<<<<<<< Undetected

By: Rusty Newton (rnewton) 2013-09-10 19:12:44.687-0500

Yup, when attempting to configure a menu with that character I see the following in debug during Asterisk startup.

{noformat}
........................[Sep 10 18:58:17] WARNING[12830]: config.c:1362 process_text_line: Unknown directive '#=dialplan_exec(teste,s,1)' at line 12 of /etc/asterisk/confbridge.conf
{noformat}

The pound symbol Doesn't appear to be a valid character for use in menus. This could be due to it's use in other ConfBridge features. Or else this may be somewhat of a bug as an oversight. I can't find any discussion of it in the usual places.

If anything the expected behavior should be identified and documented in confbridge.conf and on the wiki. I couldn't find anything that mentioned the # digit as an exception to the allowed DTMF digits, but I could have overlooked it.

By: Joshua C. Colp (jcolp) 2013-09-10 19:19:39.496-0500

Try adding a \ in front. The # symbol is used to indicate a directive (such as include or exec) in configuration files.

By: Rusty Newton (rnewton) 2013-09-10 19:33:26.638-0500

1. I answered my own question about digits 'ABCD', they all work fine as far as defining menu options with them.

2. re: Josh - Good idea! I forgot about that.  I tried adding the '\' in front and got the following on parsing

{noformat}
[Sep 10 19:29:28] VERBOSE[13593] config.c:   == Parsing '/etc/asterisk/confbridge.conf': Found
[Sep 10 19:29:28] DEBUG[13593] config.c: extract int from [0] in [-2147483648, 2147483647] gives [0](0)
[Sep 10 19:29:28] DEBUG[13593] config.c: extract int from [0] in [-2147483648, 2147483647] gives [0](0)
[Sep 10 19:29:28] DEBUG[13593] config.c: extract int from [0] in [-2147483648, 2147483647] gives [0](0)
[Sep 10 19:29:28] DEBUG[13593] config.c: extract int from [4] in [-2147483648, 2147483647] gives [4](0)
[Sep 10 19:29:28] DEBUG[13593] config.c: extract int from [2500] in [-2147483648, 2147483647] gives [2500](0)
[Sep 10 19:29:28] DEBUG[13593] config.c: extract int from [160] in [-2147483648, 2147483647] gives [160](0)
[Sep 10 19:29:28] ERROR[13593] config_options.c: Could not find option suitable for category 'default_menu' named '\#2' at line 14 of
[Sep 10 19:29:28] ERROR[13593] config_options.c: In confbridge.conf: Processing options for default_menu failed
[Sep 10 19:29:28] ERROR[13593] app_confbridge.c: Unable to load config. Not loading module.
{noformat}

Adding two '\' characters got the same result.


Config used:

{noformat}
[default_bridge]
type=bridge
max_members=4

[default_user]
type=user
announce_only_user=yes
dtmf_passthrough=no

[default_menu]
type=menu
1=leave_conference
\#2=dialplan_exec(teste,s,1)
{noformat}


By: Nicolas Tanski (nicolastanski) 2013-09-19 14:33:58.244-0500

It is important to be able to use #ABCD for customization.

By: Rusty Newton (rnewton) 2013-09-23 09:15:19.939-0500

Right now, only # does not work. You should be able to use all other digits.

I'm not sure what the eventual solution for # will be. We thought you may be able to escape it with a backslash, but that doesn't appear to work either.

By: Eldad Ran (eldadran) 2013-10-06 01:46:27.576-0500

I had the same problem, I've fixed it with this patch.
The problem is with the config parser, it catches all lines start with # as a directive, so I've changed the catch rule to be: start with # and doesn't have '=' sign in it, and all works.

By: Rusty Newton (rnewton) 2013-10-22 16:32:22.642-0500

Thanks for the patch, that will be helpful!

By: Nicolas Tanski (nicolastanski) 2013-10-28 16:58:53.343-0500

Thanks for the patch. Problem solved.

By: Richard Mudgett (rmudgett) 2013-10-28 19:14:44.898-0500

The [^patch_config] patch is a bit too simplistic because it prevents a valid #exec line from having a '=' character in it.
{noformat}
#exec "foo --param=bar"
{noformat}

[^jira_asterisk_22478_v11.patch] - Adds support to escape the first character on a line so the '#' character will not be recognized as starting a directive.