Show
Ignore:
Timestamp:
10/07/10 20:06:13 (3 years ago)
Author:
p_lindheimer
Message:

closes #4580 adds a Diversion Header to outbound calls that resulted in a forwarding situation if they came in with a DID, if the DID is not valid (3,4,7 digit PRI DIDs then the Diversion header will only include that DID

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/core/agi-bin/dialparties.agi

    r10283 r10374  
    302302        } else { 
    303303          $ext[$count] = $cf.'#';   
     304          // This only really needs to be set if we are setting Diversion Headers, but it's not worth the hassle of 
     305          // checking the amportal.conf settings here and there is no harm done in setting it other than minor overhead 
     306          // 
     307          $AGI->set_variable('__DIVERSION_REASON','unconditional'); 
    304308          debug("Extension $k has call forward set to $cf", 1); 
    305309        } 
  • modules/branches/2.9/core/functions.inc.php

    r10367 r10374  
    17641764          $ext->add($context, $exten, '', new ext_noop(sprintf(_('Calling Out Route: %s'),$route['name'])));  
    17651765 
     1766          // Conditionally Add Divesion Header if the call was diverted 
     1767          if ($amp_conf['DIVERSIONHEADER']) { 
     1768            $ext->add($context, $exten, '', new ext_gosubif('$[${LEN(${FROM_DID})}>0 & "${FROM_DID}"!="s"','sub-diversion-header,s,1')); 
     1769          } 
     1770 
    17661771          if ($route['emergency_route'] != '') { 
    17671772            $ext->add($context, $exten, '', new ext_set("EMERGENCYROUTE",$route['emergency_route'])); 
     
    19711976      $ext->add($context, $exten, '', new ext_return('')); 
    19721977 
     1978      // Subroutine to add diversion header with reason code "no-answer" unless provided differently elsewhere in the dialplan to indicate 
     1979      // the reason for the diversion (e.g. CFB could set it to busy) 
     1980      // 
     1981      if ($amp_conf['DIVERSIONHEADER']) { 
     1982          $context = 'sub-diversion-header'; 
     1983          $exten = 's'; 
     1984          $ext->add($context, $exten, '', new ext_set('DIVERSION_REASON', '${IF($[${LEN(${DIVERSION_REASON})}=0]?no-answer:${DIVERSION_REASON})}')); 
     1985          $ext->add($context, $exten, '', new ext_sipaddheader('Diversion', '<tel:+${FROM_DID}>\;reason=${DIVERSION_REASON}\;screen=no\;privacy=off')); 
     1986          $ext->add($context, $exten, '', new ext_return('')); 
     1987      } 
    19731988       
    19741989      /* 
     
    29162931      $exten = 'docfu'; 
    29172932      $ext->add($mcontext,$exten,'docfu', new ext_set("RTCFU", '${IF($["${VMBOX}"!="novm"]?${RINGTIMER}:"")}')); 
     2933      if ($amp_conf['DIVERSIONHEADER']) $ext->add($mcontext,$exten,'', new ext_set('__DIVERSION_REASON', 'unavailable')); 
    29182934      $ext->add($mcontext,$exten,'', new ext_dial('Local/${CFUEXT}@from-internal/n', '${RTCFU},${DIAL_OPTIONS}')); 
     2935      if ($amp_conf['DIVERSIONHEADER']) $ext->add($mcontext,$exten,'', new ext_set('__DIVERSION_REASON', '')); 
    29192936      $ext->add($mcontext,$exten,'', new ext_return('')); 
    29202937 
    29212938      $exten = 'docfb'; 
    29222939      $ext->add($mcontext,$exten,'docfb', new ext_set("RTCFB", '${IF($["${VMBOX}"!="novm"]?${RINGTIMER}:"")}')); 
     2940      if ($amp_conf['DIVERSIONHEADER']) $ext->add($mcontext,$exten,'', new ext_set('__DIVERSION_REASON', 'user-busy')); 
    29232941      $ext->add($mcontext,$exten,'', new ext_dial('Local/${CFBEXT}@from-internal/n', '${RTCFB},${DIAL_OPTIONS}')); 
     2942      if ($amp_conf['DIVERSIONHEADER']) $ext->add($mcontext,$exten,'', new ext_set('__DIVERSION_REASON', '')); 
    29242943      $ext->add($mcontext,$exten,'', new ext_return('')); 
    29252944 
     
    31113130        $ext->add($mcontext,$exten,'', new ext_execif('$["${DB(CF/${DEXTEN})}"="${CFAMPUSER}" | "${DB(CF/${DEXTEN})}"="${REALCALLERIDNUM}" | "${CUT(CUT(BLINDTRANSFER,-,1),/,1)}" = "${DB(CF/${DEXTEN})}" | "${DEXTEN}"="${DB(CF/${DEXTEN})}"]', 'Return')); 
    31123131        $ext->add($mcontext,$exten,'', new ext_set('DEXTEN', '${IF($["${CFIGNORE}"=""]?"${DB(CF/${DEXTEN})}#":"")}')); 
     3132        if ($amp_conf['DIVERSIONHEADER']) $ext->add($mcontext,$exten,'', new ext_set('__DIVERSION_REASON', '${IF($["${DEXTEN}"!=""]?"unconditional":"")}')); 
    31133133        $ext->add($mcontext,$exten,'', new ext_execif('$["${DEXTEN}"!=""]', 'Return')); 
    31143134        $ext->add($mcontext,$exten,'', new ext_set('DIALSTATUS', 'NOANSWER')); 
     
    58975917function core_devices_configpageinit($dispnum) { 
    58985918  global $currentcomponent, $amp_conf; 
    5899   global $amp_conf; 
    59005919 
    59015920  if ( $dispnum == 'devices' || $dispnum == 'extensions' ) { 
  • modules/branches/2.9/core/module.xml

    r10365 r10374  
    1010  <canuninstall>no</canuninstall> 
    1111  <changelog> 
     12    *2.9.0alpha1.3* #4580 
    1213    *2.9.0alpha1.2* #4401, #4525, #4507, #4499, #4574, #4572, #4575, #4527, #4469 
    1314    *2.9.0alpha1.1* #4443, #4444, #4460, #4414