Changeset 5364

Show
Ignore:
Timestamp:
12/06/07 13:02:19 (5 years ago)
Author:
p_lindheimer
Message:

#2299 provide support to Asterisk trunk (1.6) in dialparties.agi - thx pnlarsson

Files:

Legend:

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

    r5341 r5364  
    4949$ampmgrpass  = get_var( $AGI, "AMPMGRPASS" ); 
    5050$cwinusebusy = get_var( $AGI, "CWINUSEBUSY" ); 
     51$ast_version = get_var( $AGI, "ASTVERSION" ); 
    5152 
    5253$cwignore    = get_var( $AGI, "CWIGNORE" ); 
     
    582583  $AGI->noop(''); 
    583584} else { 
     585  // Asterisk 1.6 uses , instead of | and 1.4 can't recieve a , in the ds. 
     586  // 
     587  if (version_compare($ast_version, "1.6", "ge")) {  
     588    $ds_seperator = ','; 
     589  } else { 
     590    $ds_seperator = '|'; 
     591  } 
     592   
    584593  if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone")) { 
    585     $ds = '|'
     594    $ds = $ds_seperator
    586595    if ($timer) { 
    587596      $ds .= $timer; 
    588597    } 
    589     $ds .= '|' . $dialopts; // pound to transfer, provide ringing 
     598    $ds .= $ds_seperator . $dialopts; // pound to transfer, provide ringing 
    590599    $AGI->set_variable('ds',$ds); 
    591600    $AGI->set_variable("HuntMembers",$loops); 
    592601    $AGI->set_priority("huntdial"); // dial command was at priority 20 where dialplan handles calling a ringgroup with strategy of "hunt" or "MemoryHunt" 
    593602  } else { 
    594     $ds .= '|'
     603    $ds .= $ds_seperator
    595604    if ($timer) { 
    596605      $ds .= $timer; 
     
    599608      } 
    600609    } 
    601     $ds .= '|' . $dialopts; // pound to transfer, provide ringing 
     610    $ds .= $ds_seperator . $dialopts; // pound to transfer, provide ringing 
    602611    if (trim($use_confirmation) != "FALSE") { 
    603612      $AGI->set_variable('__RG_IDX',$ringgroup_index); 
  • modules/branches/2.4/core/functions.inc.php

    r5352 r5364  
    813813        } 
    814814      } 
    815        
     815      // Put the asterisk version in a global for agi etc. 
     816      $ext->addGlobal('ASTVERSION', $version); 
     817 
    816818      /* outbound routes */ 
    817819      // modules should use their own table for storage (and module_get_config() to add dialplan)