Changeset 14280

Show
Ignore:
Timestamp:
08/10/12 08:16:15 (9 months ago)
Author:
escape2mtns
Message:

Asterisk 1.8 quotes around value in db comparison caused match failure

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/smartroutes/functions.inc.php

    r14273 r14280  
    912912              $ext->add($context, $extension, '', new ext_gotoif('$["${'.$smartroute_queries[$main_query]['adv_varname1'].'}" '.$matchtype.' "'.$dest['matchkey'].'"]',"destination".$index)); 
    913913              } 
    914               else if($matchtype == "=" && version_compare($version, "1.6", "gt")) {   
    915               // values as strings 
    916               // asterisk 1.8 doesn't like the null values when no db match found so set var as "(nullstring)" before comparison 
    917               $ext->add($context, $extension, '', new ext_execif('$["${'.$smartroute_queries[$main_query]['adv_varname1'].'}foo"="foo"]','Set',$smartroute_queries[$main_query]['adv_varname1'].'="NULL"'));               
    918               $ext->add($context, $extension, '', new ext_gotoif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'} '.$matchtype.' "'.$dest['matchkey'].'"]',"destination".$index));                 
    919                 } 
    920914            else { 
    921915              // values as integers OR in version 1.8 never double quote values 
    922916              // asterisk 1.8 doesn't like the null values when no db match found so set var as "(nullstring)" before comparison 
    923917              $ext->add($context, $extension, '', new ext_execif('$["${'.$smartroute_queries[$main_query]['adv_varname1'].'}foo"="foo"]','Set',$smartroute_queries[$main_query]['adv_varname1'].'="NULL"'));               
    924               $ext->add($context, $extension, '', new ext_gotoif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'} '.$matchtype.' '.$dest['matchkey'].']',"destination".$index)); 
     918              $ext->add($context, $extension, '', new ext_gotoif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'}'.$matchtype.$dest['matchkey'].']',"destination".$index)); 
    925919              } 
    926920            }