Changeset 6540

Show
Ignore:
Timestamp:
09/03/08 00:42:41 (5 years ago)
Author:
p_lindheimer
Message:

some tweaks to streamline macro-outbound-callerid and macro-dialout-trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/functions.inc.php

    r6536 r6540  
    14091409      // Back to normal processing, whether intracompany or not. 
    14101410      // But add the macro-setmusic if we don't want music on this outbound call 
    1411       $ext->add($context, $exten, '', new ext_gotoif('$[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]', 'gocall'));  // Set to YES if we should pump silence 
    1412       $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', 'M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}'));  // set MoH or off 
     1411      $ext->add($context, $exten, '', new ext_execif('$[$["${MOHCLASS}" != "default"] & $["${MOHCLASS}" != ""]]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
    14131412     
    14141413      // This macro call will always be blank and is provided as a hook for customization required prior to making a call 
     
    14871486      // Back to normal processing, whether intracompany or not. 
    14881487      // But add the macro-setmusic if we don't want music on this outbound call 
    1489       $ext->add($context, $exten, '', new ext_gotoif('$[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]', 'gocall'));  // Set to YES if we should pump silence 
    1490       $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', 'M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}'));  // set MoH or off 
     1488      $ext->add($context, $exten, '', new ext_execif('$[$["${MOHCLASS}" != "default"] & $["${MOHCLASS}" != ""]]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
    14911489     
    14921490      // This macro call will always be blank and is provided as a hook for customization required prior to making a call 
     
    16311629 
    16321630      // Keep the original CallerID number, for failover to the next trunk. 
    1633       $ext->add($context, $exten, '', new ext_gotoif('$["${REALCALLERIDNUM:1:2}" != ""]', 'start')); 
    1634       $ext->add($context, $exten, '', new ext_set('REALCALLERIDNUM', '${CALLERID(number)}')); 
    1635       $ext->add($context, $exten, 'start', new ext_noop('REALCALLERIDNUM is ${REALCALLERIDNUM}')); 
    1636  
     1631 
     1632      $ext->add($context, $exten, '', new ext_execif('$["${REALCALLERIDNUM:1:2}" = ""]', 'Set', 'REALCALLERIDNUM=${CALLERID(number)}')); 
    16371633      // If this came through a ringgroup or CF, then we want to retain original CID unless 
    16381634      // OUTKEEPCID_${trunknum} is set. 
    16391635      // Save then CIDNAME while it is still intact in case we end up sending out this same CID 
    1640       $ext->add($context, $exten, '', new ext_gotoif('$["${KEEPCID}" != "TRUE"]', 'normcid'));  // Set to TRUE if coming from ringgroups, CF, etc. 
    1641       $ext->add($context, $exten, '', new ext_gotoif('$["x${OUTKEEPCID_${ARG1}}" = "xon"]', 'normcid')); 
    1642       $ext->add($context, $exten, '', new ext_gotoif('$["foo${REALCALLERIDNUM}" = "foo"]', 'normcid'));  // if not set to anything, go through normal processing 
     1636      $ext->add($context, $exten, 'start', new ext_gotoif('$[ $["${REALCALLERIDNUM}" = ""] | $["${KEEPCID}" != "TRUE"] | $["${OUTKEEPCID_${ARG1}}" = "on"] ]', 'normcid'));  // Set to TRUE if coming from ringgroups, CF, etc. 
    16431637      $ext->add($context, $exten, '', new ext_set('USEROUTCID', '${REALCALLERIDNUM}')); 
    16441638      //$ext->add($context, $exten, '', new ext_set('REALCALLERIDNAME', '${CALLERID(name)}')); 
     
    16511645      // setting. If this is the case, then we put the orignal name back in to send out. Although the CNAME is not honored by most 
    16521646      // carriers, there are cases where it is so this preserves that information to be used by those carriers who do honor it. 
    1653       $ext->add($context, $exten, '', new ext_gotoif('$["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]', 'bypass', 'normcid')); 
     1647      $ext->add($context, $exten, '', new ext_gotoif('$["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]', 'bypass')); 
    16541648 
    16551649      $ext->add($context, $exten, 'normcid', new ext_set('USEROUTCID', '${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)}')); 
    16561650      $ext->add($context, $exten, 'bypass', new ext_set('EMERGENCYCID', '${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)}')); 
    16571651      $ext->add($context, $exten, '', new ext_set('TRUNKOUTCID', '${OUTCID_${ARG1}}')); 
    1658       $ext->add($context, $exten, '', new ext_gotoif('$["${EMERGENCYROUTE:1:2}" = ""]', 'trunkcid'));  // check EMERGENCY ROUTE 
    1659       $ext->add($context, $exten, '', new ext_gotoif('$["${EMERGENCYCID:1:2}" = ""]', 'trunkcid'));  // empty EMERGENCY CID, so default back to trunk 
     1652      $ext->add($context, $exten, '', new ext_gotoif('$[ $["${EMERGENCYROUTE:1:2}" = ""] | $["${EMERGENCYCID:1:2}" = ""] ]', 'trunkcid'));  // check EMERGENCY ROUTE 
    16601653      $ext->add($context, $exten, '', new ext_set('CALLERID(all)', '${EMERGENCYCID}'));  // emergency cid for device 
    1661       $ext->add($context, $exten, '', new ext_goto('report')); 
    1662       $ext->add($context, $exten, 'trunkcid', new ext_gotoif('$["${TRUNKOUTCID:1:2}" = ""]', 'usercid'));  // check for CID override for trunk (global var) 
    1663       $ext->add($context, $exten, '', new ext_set('CALLERID(all)', '${TRUNKOUTCID}')); 
    1664       $ext->add($context, $exten, 'usercid', new ext_gotoif('$["${USEROUTCID:1:2}" = ""]', 'report'));  // check CID override for extension 
     1654      $ext->add($context, $exten, 'exit', new ext_macroexit()); 
     1655 
     1656 
     1657      $ext->add($context, $exten, 'trunkcid', new ext_execif('$["${TRUNKOUTCID:1:2}" != ""]', 'Set', 'CALLERID(all)=${TRUNKOUTCID}')); 
     1658 
     1659      $ext->add($context, $exten, 'usercid', new ext_gotoif('$["${USEROUTCID:1:2}" = ""]', 'exit'));  // check CID override for extension 
    16651660      $ext->add($context, $exten, '', new ext_set('CALLERID(all)', '${USEROUTCID}')); 
    16661661      //$ext->add($context, $exten, '', new ext_gotoif('$["x${CALLERID(name)}"!="xhidden"]', 'checkname', 'hidecid'));  // check CID blocking for extension 
    1667       $ext->add($context, $exten, '', new ext_gotoif('$["x${CALLERID(name)}"!="xhidden"]', 'report', 'hidecid'));  // check CID blocking for extension 
    1668       $ext->add($context, $exten, 'hidecid', new ext_setcallerpres('prohib_passed_screen'));  // Only works with ISDN (T1/E1/BRI) 
     1662      if (version_compare($version, "1.6", "lt")) {  
     1663        $ext->add($context, $exten, 'hidecid', new ext_execif('$["${CALLERID(name)}"="hidden"]', 'SetCallerPres', 'prohib_passed_screen')); 
     1664      } else { 
     1665        $ext->add($context, $exten, 'hidecid', new ext_execif('$["${CALLERID(name)}"="hidden"]', 'Set', 'CALLERPRES()=prohib_passed_screen')); 
     1666      } 
    16691667      //$ext->add($context, $exten, 'checkname', new ext_execif('$[ $[ "${CALLERID(number)}" = "${REALCALLERIDNUM}" ] & $[ "${CALLERID(name)}" = "" ] ]', 'Set', 'CALLERID(name)=${REALCALLERIDNAME}')); 
    1670       $ext->add($context, $exten, 'report', new ext_noop('CallerID set to ${CALLERID(all)}'));       
    16711668 
    16721669