| | 802 | } else { |
|---|
| | 803 | // if privacymanager is used, this is not necessary as it will not let blocked/anonymous calls through |
|---|
| | 804 | // otherwise, we need to save the caller presence to set it properly if we forward the call back out the pbx |
|---|
| | 805 | // note - the indirect table could go away as of 1.4.20 where it is fixed so that SetCallerPres can take |
|---|
| | 806 | // the raw format. |
|---|
| | 807 | // |
|---|
| | 808 | if (version_compare($version, "1.6", "lt")) { |
|---|
| | 809 | $ext->add($context, $exten, '', new ext_setvar('__CALLINGPRES_SV','${CALLINGPRES_${CALLINGPRES}}')); |
|---|
| | 810 | } else { |
|---|
| | 811 | $ext->add($context, $exten, '', new ext_setvar('__CALLINGPRES_SV','${CALLERPRES()}')); |
|---|
| | 812 | } |
|---|
| | 813 | $ext->add($context, $exten, '', new ext_setcallerpres('allowed_not_screened')); |
|---|
| | 1071 | // Create CallingPresTable to deal with difference that ${CALINGPRES} returns vs. what |
|---|
| | 1072 | // SetCallingPres() accepts. This is a workaround that gets resolved in 1.6 where |
|---|
| | 1073 | // function CALLINGPRES() is consistent. |
|---|
| | 1074 | // This should be fixed in 1.4.20 but for now we keep it in until 1.6 |
|---|
| | 1075 | // |
|---|
| | 1076 | if (version_compare($version, "1.6", "lt")) { |
|---|
| | 1077 | $ext->addGlobal('CALLINGPRES_0', 'allowed_not_screened'); |
|---|
| | 1078 | $ext->addGlobal('CALLINGPRES_1', 'allowed_passed_screen'); |
|---|
| | 1079 | $ext->addGlobal('CALLINGPRES_2', 'allowed_failed_screen'); |
|---|
| | 1080 | $ext->addGlobal('CALLINGPRES_3', 'allowed'); |
|---|
| | 1081 | $ext->addGlobal('CALLINGPRES_32', 'prohib_not_screened'); |
|---|
| | 1082 | $ext->addGlobal('CALLINGPRES_33', 'prohib_passed_screen'); |
|---|
| | 1083 | $ext->addGlobal('CALLINGPRES_34', 'prohib_failed_screen'); |
|---|
| | 1084 | $ext->addGlobal('CALLINGPRES_35', 'prohib'); |
|---|
| | 1085 | $ext->addGlobal('CALLINGPRES_67', 'unavailable'); |
|---|
| | 1086 | } |
|---|
| | 1087 | |
|---|
| | 1424 | // If we modified the caller presence, set it back. This allows anonymous calls to be internally prepended but keep |
|---|
| | 1425 | // their status if forwarded back out. Not doing this can result in the trunk CID being displayed vs. 'blocked call' |
|---|
| | 1426 | // |
|---|
| | 1427 | if (version_compare($version, "1.6", "lt")) { |
|---|
| | 1428 | $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != ""]', 'SetCallingPres', '${CALLINGPRES_SV}')); |
|---|
| | 1429 | } else { |
|---|
| | 1430 | $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != ""]', 'Set', 'CALLERPRES()=${CALLINGPRES_SV}')); |
|---|
| | 1431 | } |
|---|
| | 1432 | |
|---|