Index: /contributed_modules/modules/smartroutes/functions.inc.php =================================================================== --- /contributed_modules/modules/smartroutes/functions.inc.php (revision 14272) +++ /contributed_modules/modules/smartroutes/functions.inc.php (revision 14273) @@ -633,7 +633,7 @@ // if FROM_DID isn't set (OR IS SET AS 's') then set it as the EXTEN passed into this context, or the CATCHALL_DID, or the CALLERID(dnid) - $ext->add($context, $extension, '', new ext_execif('$[ "${FROM_DID}" = "" | "${FROM_DID}" = "s"] ','Set','__FROM_DID=${EXTEN}')); - $ext->add($context, $extension, '', new ext_execif('$[ "${FROM_DID}" = "" | "${FROM_DID}" = "s"] ','Set','__FROM_DID=${CATCHALL_DID}')); - $ext->add($context, $extension, '', new ext_execif('$[ "${FROM_DID}" = "" | "${FROM_DID}" = "s"] ','Set','__FROM_DID=${FILTER(0-9,${CALLERID(dnid)})}')); + $ext->add($context, $extension, '', new ext_execif('$[ "${FROM_DID}" = "" | "${FROM_DID}" = "s"]','Set','__FROM_DID=${EXTEN}')); + $ext->add($context, $extension, '', new ext_execif('$[ "${FROM_DID}" = "" | "${FROM_DID}" = "s"]','Set','__FROM_DID=${CATCHALL_DID}')); + $ext->add($context, $extension, '', new ext_execif('$[ "${FROM_DID}" = "" | "${FROM_DID}" = "s"]','Set','__FROM_DID=${FILTER(0-9,${CALLERID(dnid)})}')); if($smartroute['limitdiddigits'] != "" && $smartroute['limitdiddigits'] > '0') { @@ -915,5 +915,5 @@ // values as strings // asterisk 1.8 doesn't like the null values when no db match found so set var as "(nullstring)" before comparison - $ext->add($context, $extension, '', new ext_execif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'}=""]','Set',$smartroute_queries[$main_query]['adv_varname1'].'="NULL"')); + $ext->add($context, $extension, '', new ext_execif('$["${'.$smartroute_queries[$main_query]['adv_varname1'].'}foo"="foo"]','Set',$smartroute_queries[$main_query]['adv_varname1'].'="NULL"')); $ext->add($context, $extension, '', new ext_gotoif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'} '.$matchtype.' "'.$dest['matchkey'].'"]',"destination".$index)); } @@ -921,5 +921,5 @@ // values as integers OR in version 1.8 never double quote values // asterisk 1.8 doesn't like the null values when no db match found so set var as "(nullstring)" before comparison - $ext->add($context, $extension, '', new ext_execif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'}=""]','Set',$smartroute_queries[$main_query]['adv_varname1'].'="NULL"')); + $ext->add($context, $extension, '', new ext_execif('$["${'.$smartroute_queries[$main_query]['adv_varname1'].'}foo"="foo"]','Set',$smartroute_queries[$main_query]['adv_varname1'].'="NULL"')); $ext->add($context, $extension, '', new ext_gotoif('$[${'.$smartroute_queries[$main_query]['adv_varname1'].'} '.$matchtype.' '.$dest['matchkey'].']',"destination".$index)); }