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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Jul 30 16:54:02 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:             2008-07-10 09:45 CDT
Last Modified:              2008-07-30 16:54 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.


======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0013197 STAT() inside IF() doesn't work
====================================================================== 

---------------------------------------------------------------------- 
 (0090875) svnbot (reporter) - 2008-07-30 16:54
 http://bugs.digium.com/view.php?id=13051#c90875 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 134652

U   branches/1.4/pbx/pbx_ael.c

------------------------------------------------------------------------
r134652 | murf | 2008-07-30 16:53:58 -0500 (Wed, 30 Jul 2008) | 19 lines

(closes issue http://bugs.digium.com/view.php?id=13197)
Reported by: pj

(closes issue http://bugs.digium.com/view.php?id=13051)
Reported by: pj

This patch substitutes commas in the expr 
supplied to the if () statement, as in
if ( expr ) ...

This solves both the bugs above, and makes
the source symmetric with switch statements,
which were earlier reported to need this sort
of treatment.

I tested this using the examples, both for
the compiler and at run time. Looks good.


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=134652 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-07-30 16:54 svnbot         Checkin                                      
2008-07-30 16:54 svnbot         Note Added: 0090875                          
======================================================================




More information about the asterisk-bugs mailing list