[asterisk-bugs] [JIRA] (ASTERISK-18271) Pattern matching with res_config_mysql extensions does not behave as expected

Matt Jordan (JIRA) noreply at issues.asterisk.org
Tue Sep 22 10:44:32 CDT 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-18271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=181864#comment-181864 ] 

Matt Jordan edited comment on ASTERISK-18271 at 9/22/15 10:43 AM:
------------------------------------------------------------------

I am currently using the following very blunt hack to work around this:

\[Edit:\] [~mjordan]

Removed inline patch. Patches have to be attached and/or put up for code review after signing a contributor license agreement.


was (Author: catphish):
I am currently using the following very blunt hack to work around this:

diff -r a/addons/res_config_mysql.c b/addons/res_config_mysql.c
498c498
< 		ast_str_append(&sql, 0, " ORDER BY %s", initfield);
---
> 		ast_str_append(&sql, 0, " ORDER BY BIT_LENGTH(%s) DESC", initfield);

> Pattern matching with res_config_mysql extensions does not behave as expected
> -----------------------------------------------------------------------------
>
>                 Key: ASTERISK-18271
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-18271
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Addons/res_config_mysql
>    Affects Versions: 1.8.5.0
>            Reporter: Charlie Smurthwaite
>
> When using RealTime extensions from MySQL with res_config_mysql and overlapping pattern extensions, selection of an extension does not work as expected. Test case:
> Extensions in mysql with appropriate context:
> _800.
> _80.
> Dialed number: 8001
> Expected behaviour:
> _800. matches number because it is the most explicit match
> Actual behaviour:
> _80. matches number because it is the first matching extension in the mysql resultset (query is ordered by extension)



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list