[asterisk-bugs] [Asterisk 0010870]: AEL & CUT

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Oct 3 12:59:47 CDT 2007


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=10870 
====================================================================== 
Reported By:                non-poster
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   10870
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             10-02-2007 14:16 CDT
Last Modified:              10-03-2007 12:59 CDT
====================================================================== 
Summary:                    AEL & CUT
Description: 
CUT doesn't seem to work like I would expect.

This works:

macro route-enum-2(exten, Timeout, DialOpts, dns) {
    Set(ENLCOUNT=${ENUMLOOKUP(+${exten},ALL,c,,${dns})});
    if (${ENLCOUNT} > 0 )
    {
        for(count=1;${count} <= ${ENLCOUNT};count=${count} + 1) {
            Set(ENL=${ENUMLOOKUP(+${exten},ALL,,${count},${dns})});
            if (${LEN(${ENL})} > 0) {
                if ("${ENL:0:3}" = "sip") {
                    Dial(SIP/${ENL:4},${Timeout},o${DialOpts});
                } else if ("${ENL:0:4}" = "iax2") {
                    Dial(IAX2/${ENL:5},${Timeout},o${DialOpts});
                } else if ("${ENL:0:4}" = "h323") {
                    Dial(H323/${ENL:5},${Timeout},o${DialOpts});
                };
            };
        };
    };
};



This doesn't work:

                switch (${CUT(ENL,:,1)}) {
                    case sip:
                        Dial(SIP/${ENL:4},${Timeout},o${DialOpts});
                        break;
                    case iax2:
                        Dial(IAX2/${ENL:5},${Timeout},o${DialOpts});
                        break;
                    case h323:
                        Dial(H323/${ENL:5},${Timeout},o${DialOpts});
                        break;
                    default:
                        NoOp(blah);
                };



Asterisk 1.4.11, gcc 4.1.2, glibc 2.5, amd64 
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 10-03-07 12:59  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 84544

U   branches/1.4/pbx/pbx_ael.c

------------------------------------------------------------------------
r84544 | murf | 2007-10-03 12:59:46 -0500 (Wed, 03 Oct 2007) | 1 line

closes issue http://bugs.digium.com/view.php?id=10870 ; where a CUT() function
call in a switch expr doesn't
execute correctly, because the commas in the function args are not
converted to vertbars before the func is called. I modified just the switch
code to convert the commas to vertbars if there, but if more of these sort
of probs are found, I may have to resort to something a little more
fundamental. We'll see, I guess.
------------------------------------------------------------------------ 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-03-07 12:59  svnbot         Checkin                                      
10-03-07 12:59  svnbot         Note Added: 0071401                          
10-03-07 12:59  svnbot         Status                   feedback => assigned
======================================================================




More information about the asterisk-bugs mailing list