diff --git a/Dialplan/macroDial.php b/Dialplan/macroDial.php index 165914d8..cb3e0a43 100644 --- a/Dialplan/macroDial.php +++ b/Dialplan/macroDial.php @@ -70,7 +70,7 @@ static function add($ext){ // Mixed ringall: one Dial() shares headers; B-legs need per-leg P/S adjustment (inherits to all legs). $ext->add($c,$s,'', new \ext_execif('$["${IS_PPHONE_ANY}"="1"]', 'Set', '__RG_SHARED_RVOL=1')); $ext->add($c,$s,'', new \ext_macro('dial-ringall-predial-hook')); - $ext->add($c,$s,'', new \ext_execif('$["${DB(AMPUSER/${EXTTOCALL}/cwtone)}" = "enabled" & "${EXTENSION_STATE(${EXTTOCALL})}" = "INUSE"]', 'Set','CWRING=r(callwaiting)','Set','CWRING=')); + $ext->add($c,$s,'', new \ext_execif('$["${DB(AMPUSER/${EXTTOCALL}/cwtone)}" = "enabled" & "${EXTENSION_STATE(${EXTTOCALL})}" =~ "^(RING|HOLD)?INUSE$" ]', 'Set','CWRING=r(callwaiting)','Set','CWRING=')); // Ring groups and follow-me use macro-dial instead of macro-exten-vm, so sub-record-check was // never run per extension when inbound/ring-group recording was dontcare. Apply extension // recording policy before Dial(); use the first member for ringall (one Dial() to all). @@ -119,7 +119,7 @@ static function add($ext){ $ext->add($c,$s,'', new \ext_gosub('1','s','sub-check-pseries','${EXTTOCALL}')); $ext->add($c,$s,'', new \ext_gosub('1','s','sub-set-rvol-headers','single')); $ext->add($c,$s,'', new \ext_macro('dial-hunt-predial-hook')); - $ext->add($c,$s,'', new \ext_execif('$["${DB(AMPUSER/${EXTTOCALL}/cwtone)}" = "enabled" & "${EXTENSION_STATE(${EXTTOCALL})}" = "INUSE"]', 'Set','CWRING=r(callwaiting)','Set','CWRING=')); + $ext->add($c,$s,'', new \ext_execif('$["${DB(AMPUSER/${EXTTOCALL}/cwtone)}" = "enabled" & "${EXTENSION_STATE(${EXTTOCALL})}" =~ "^(RING|HOLD)?INUSE$" ]', 'Set','CWRING=r(callwaiting)','Set','CWRING=')); $ext->add($c,$s,'', new \ext_gosub(1,'s','sub-record-check','exten,${EXTTOCALL},dontcare')); /*********************************************************/ $ext->add($c,$s,'', new \ext_execif('$["${FMFM}" = "TRUE"]','Set','RGFMDIAL=${EXTTOCALL}','Set','RGFMDIAL=${NODEST}')); diff --git a/Dialplan/macroDialone.php b/Dialplan/macroDialone.php index 05774e9d..7ee6ce0b 100644 --- a/Dialplan/macroDialone.php +++ b/Dialplan/macroDialone.php @@ -107,7 +107,7 @@ static function add($ext){ //dont allow inbound callers to transfer around inside the system $ext->add($mcontext,$exten,'', new \ext_execif('$["${DIRECTION}" = "INBOUND"]', 'Set', 'D_OPTIONS=${STRREPLACE(D_OPTIONS,T)}I')); - $ext->add($mcontext,$exten,'', new \ext_execif('$["${DB(AMPUSER/${DEXTEN}/cwtone)}" = "enabled" & "${EXTENSION_STATE(${DEXTEN}@ext-local)}" = "INUSE"]', 'Set','CWRING=r(callwaiting)','Set','CWRING=')); + $ext->add($mcontext,$exten,'', new \ext_execif('$["${DB(AMPUSER/${DEXTEN}/cwtone)}" = "enabled" & "${EXTENSION_STATE(${DEXTEN}@ext-local)}" =~ "^(RING|HOLD)?INUSE$" ]', 'Set','CWRING=r(callwaiting)','Set','CWRING=')); $ext->add($mcontext,$exten,'dialapp', new \ext_noop('')); $ext->add($mcontext,$exten,'', new \ext_execif('$["${FROMQ}" = "true"]', 'Set', 'D_OPTIONS=${STRREPLACE(D_OPTIONS,T)}')); /* dail using different context */