Summary:ASTERISK-19254: When working in real time with ARA and MySQL the backslashes not works properly
Reporter:Janu (janu1535)Labels:
Date Opened:2012-01-27 07:59:12.000-0600Date Closed:2015-03-13 19:07:51
Versions: Frequency of
Environment:Debian GNU/Linux 6.0.3Attachments:

I found a problem with MySQL Realtime in the dialplan.
I'm trying to set different ring tones in a Snom 3xx, like this:

As you can see we have to add this application:


This example works properly in typical static configurations, like this:

exten => _XXX,1,SIPAddHeader("Alert-Info:<http://nohost>\;info=alert-internal\;x-line-id=0")
exten => _XXX,n,Dial(SIP/${EXTEN})
exten => _XXX,n,Hangup

This is the simple programming dialplan in MySQL database:

mysql> SELECT * FROM dialplan WHERE exten='_XXX' ORDER BY priority;
+ id  | context | exten | priority | app          | appdata                                                      
+ 597 | intern  | _XXX  |        1 | SIPAddHeader | Alert-Info:<http://nohost>\;info=alert-internal\;x-line-id=0
+ 551 | intern  | _XXX  |        2 | Dial         | SIP/${EXTEN},15,Tt                                          
+ 552 | intern  | _XXX  |        3 | Hangup       |                                                            
3 rows in set (0.00 sec)

The result of the execution in the CLI is:

 == Using SIP RTP CoS mark 5
   -- Executing [202@intern:1] SIPAddHeader("SIP/201-00000000", "x-line-id=0")
   -- Executing [202@intern:2] Dial("SIP/201-00000000", "SIP/202,15,Tt")

Note that only displays the text after the last backslash.
I found in the archive from the list of digium a user already reported the error in the past:

Thanks for your time.
Comments:By: Matt Jordan (mjordan) 2013-01-15 09:31:05.596-0600

Please note that {{pbx_realtime}} is an extended support module and development effort for it comes from the open source community. Response times may reflect that.

(Patches are always appreciated for all issues, but especially those in extended support!)

By: Walter Doekes (wdoekes) 2013-01-18 04:42:45.816-0600

exten => _XXX,1,SIPAddHeader("Alert-Info:<http://nohost>\;info=alert-internal\;x-line-id=0")

is NOT equal to

597 | intern | _XXX | 1 | SIPAddHeader | Alert-Info:<http://nohost>\;info=alert-internal\;x-line-id=0

It would be if you added the double-quotes to the appdata column. (Or removed them from the static config.)

By: Walter Doekes (wdoekes) 2013-01-18 04:47:46.821-0600

As for the problem: ";" is the duplicate statement delimiter. It shouldn't be used in this case, but I don't think it can be turned off that easily.

You can try replacing ";" with "^3B" in the column value.

By: Ishfaq Malik (ishmalik) 2014-09-23 10:57:42.188-0500

I can confirm that replacing ";" with "^3B" in the column value worked for me.

By: Matt Jordan (mjordan) 2015-03-13 19:07:39.904-0500

Since [~ishmalik] posted a valid workaround for {{pbx_realtime}} backends, I'm closing this issue out as Workaround Available.