[asterisk-bugs] [Asterisk-GUI 0013528]: Asterisk-gui Error: You cannot strip more digits than in the pattern. ALWAYS occurs for fail-over trunk

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Oct 5 13:55:46 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13528 
====================================================================== 
Reported By:                dkerr
Assigned To:                bkruse
====================================================================== 
Project:                    Asterisk-GUI
Issue ID:                   13528
Category:                   Service Providers/Trunks
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-21 19:11 CDT
Last Modified:              2008-10-05 13:55 CDT
====================================================================== 
Summary:                    Asterisk-gui Error: You cannot strip more digits
than in the pattern. ALWAYS occurs for fail-over trunk
Description: 
Create a new calling rule in asterisk-gui using a VoIP trunk. Enter a
fail-over trunk and attempt to strip digits from the front of the pattern
and you will always get an error "you cannot strip more digits than in the
pattern" message.
====================================================================== 

---------------------------------------------------------------------- 
 (0093184) dkerr (reporter) - 2008-10-05 13:55
 http://bugs.digium.com/view.php?id=13528#c93184 
---------------------------------------------------------------------- 
I added the alert statement you requested and tested with a dial pattern of
_011XXXXXX.  (international calls).  For backup route I asked to strip 3
digits from the front and prepend "00" to the front.  The popup alert that
appears says that tmp_checkThis is now 1. Which is exactly what I would
have expected...

DOM_new_crl_fotr_stripx is set to "3" and the assignment for tmp_checkThis
looks to see if it begins with "_" which of course it doesn't (the PATTERN
begins with an underscore, the number of digits to strip never should) so
tmp_checkThis is set to the length of DOM_new_crl_fotr_stripx which is 1.

The line... 
var tmp_checkThis = ( DOM_new_crl_fotr_stripx.value.beginsWith('_') ) ?
DOM_new_crl_fotr_stripx.value.length -1 :
DOM_new_crl_fotr_stripx.value.length ;

is the bug, it should not be there. You need to test "3" against the
length of the pattern (in my example, 10) which was alreadt correctly
calculated and previously stored in tmp_checkThis.

Thanks
David 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-05 13:55 dkerr          Note Added: 0093184                          
======================================================================




More information about the asterisk-bugs mailing list