[asterisk-bugs] [Asterisk 0013051]: SIPPEER isn't working inside REGEX and IF

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jul 10 10:11:22 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13051 
====================================================================== 
Reported By:                pj
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   13051
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.21 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-10-2008 09:45 CDT
Last Modified:              07-10-2008 10:11 CDT
====================================================================== 
Summary:                    SIPPEER isn't working inside REGEX and IF
Description: 
I'm checking if peer is registered OK, before issue Dial() to avoid warning
messages, I'm using expression below and it working as expected in trunk,
but it's not working in 1.4.21.1, this expression is always false:
if (${REGEX("^OK" ${SIPPEER(998,status)})})
as workaround for 1.4, I must first store result of REGEX in variable and
then check this variable using if() 
issue is probably with SIPPEER function, because if I tried replace
SIPPEER with string value, that SIPPEER returns, ie:
if (${REGEX("^OK" OK (57 ms))})
then it returns TRUE.


====================================================================== 

---------------------------------------------------------------------- 
 pj - 07-10-08 10:11  
---------------------------------------------------------------------- 
'998' =>          1. Set(registered=${REGEX("^OK" ${SIPPEER(998|status)})})
[pbx_ael]
                    2. NoOP(STATUS: ${registered})               
[pbx_ael]
                    3. GotoIf($[${REGEX("^OK"
${SIPPEER(998,status)})}]?4:6) [pbx_ael]
                    4. NoOP(registered)                          
[pbx_ael]
                    5. Goto(7)                                   
[pbx_ael]
                    6. NoOP(NOT registered)                      
[pbx_ael]
                    7. NoOp(Finish if-zamestnanci-100)           
[pbx_ael]
                    8. Congestion()                              
[pbx_ael] 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-10-08 10:11  pj             Note Added: 0090015                          
======================================================================




More information about the asterisk-bugs mailing list