Show
Ignore:
Timestamp:
12/18/10 14:39:47 (2 years ago)
Author:
p_lindheimer
Message:

- adds logic so FORCE_CONFRIM calls will force any outbound call to user confirmation

in this mode there is some reduced functionality. There is no detection for a call
answered by someone else. As always the first will win, others will get dead air
instead of a friendly (you got beat) message. (Same if they hangup). Modifying to not
get dead air will probably come when we switch form DB variables to SHARED() where
channels can share variables and we don't have the cleanup issues of DB(), re #4701

- fixes a couple of instances of deprecated SetMusicOnHold? re #4697
- fixes an instance of deprecated DbDel?
- untested fixes #4702 macro-dialout-enum missing logic

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/core/etc/extensions.conf

    r10179 r10711  
    485485[macro-setmusic] 
    486486exten => s,1,NoOp(Setting Outbound Route MoH To: ${ARG1}) 
    487 exten => s,2,SetMusicOnHold(${ARG1}) 
     487exten => s,2,Set(CHANNEL(musicclass)=${ARG1}) ; this won't work in 1.2 anymore, could fix in auto-generate if we wanted... 
    488488;------------------------------------------------------------------------ 
    489489 
     
    528528exten => s,n,Set(USE_CONFIRMATION=TRUE) 
    529529exten => s,n,Set(RINGGROUP_INDEX=${ARG4}) 
     530exten => s,n,Set(FORCE_CONFIRM=) ; remove option if set so it is not duplicated in outbound route 
    530531exten => s,n,Set(ARG4=) ; otherwise it gets passed to dialparties.agi which processes it (prob bug)  
    531532 
     
    534535; delete the variable, if we are here, we are done trying to dial and it may have been left around 
    535536; 
    536 exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL}) 
     537exten => s,n,Noop(DELETE KEY: RG/${RINGGROUP_INDEX}/${CHANNEL}: ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})}) 
    537538exten => s,n,Set(USE_CONFIRMATION=) 
    538539exten => s,n,Set(RINGGROUP_INDEX=) 
  • modules/branches/2.9/core/functions.inc.php

    r10710 r10711  
    19021902 
    19031903      $exten = '1'; 
     1904      $ext->add($context, $exten, '', new ext_gotoif('$["${FORCE_CONFIRM}" = "ENABLED"]', 'skip')); 
    19041905      $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}" = "0"]', 'toolate,1')); 
    19051906      $ext->add($context, $exten, '', new ext_dbdel('RG/${ARG3}/${UNIQCHAN}')); 
    19061907      $ext->add($context, $exten, '', new ext_dbdel('${BLKVM_OVERRIDE}')); 
    1907       $ext->add($context, $exten, '', new ext_setvar('__MACRO_RESULT','')); 
     1908      $ext->add($context, $exten, 'skip', new ext_setvar('__MACRO_RESULT','')); 
     1909      $ext->add($context, $exten, '', new ext_execif('$[("${MOHCLASS}"!="default") & ("${MOHCLASS}"!="")]', 'Set', 'CHANNEL(musicclass)=${MOHCLASS}')); 
    19081910      $ext->add($context, $exten, 'exitopt1', new ext_macroexit()); 
    19091911 
     
    19131915      $exten = '3'; 
    19141916      $ext->add($context, $exten, '', new ext_saydigits('${CALLCONFIRMCID}')); 
    1915       $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}" = "0"]', 'toolate,1','s,start')); 
     1917      $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" & "${FORCE_CONFIRM}"!="ENABLED"]', 'toolate,1','s,start')); 
    19161918 
    19171919      $exten = 't'; 
    1918       $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}" = "0"]', 'toolate,1')); 
     1920      $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" & "${FORCE_CONFIRM}"!="ENABLED"]', 'toolate,1')); 
    19191921      $ext->add($context, $exten, '', new ext_setvar('LOOPCOUNT','$[ ${LOOPCOUNT} + 1 ]')); 
    19201922      $ext->add($context, $exten, '', new ext_gotoif('$[ ${LOOPCOUNT} < 5 ]', 's,start','noanswer,1')); 
     
    19261928        $ext->add($context, $exten, '', new ext_background('invalid,m,${LANGUAGE},macro-confirm')); 
    19271929      } 
    1928       $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}" = "0"]', 'toolate,1')); 
     1930      $ext->add($context, $exten, '', new ext_gotoif('$["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"="0" & "${FORCE_CONFIRM}"!="ENABLED"]', 'toolate,1')); 
    19291931      $ext->add($context, $exten, '', new ext_setvar('LOOPCOUNT','$[ ${LOOPCOUNT} + 1 ]')); 
    19301932      $ext->add($context, $exten, '', new ext_gotoif('$[ ${LOOPCOUNT} < 5 ]', 's,start','noanswer,1')); 
     
    20402042      // Back to normal processing, whether intracompany or not. 
    20412043      // But add the macro-setmusic if we don't want music on this outbound call 
    2042       $ext->add($context, $exten, '', new ext_execif('$[$["${MOHCLASS}" != "default"] & $["${MOHCLASS}" != ""]]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
     2044      // if FORCE_CONFIRM then that macro will set any necessary MOHCLASS, and we will also call the confirm macro 
     2045      $ext->add($context, $exten, '', new ext_execif('$["${MOHCLASS}"!="default" & "${MOHCLASS}"!="" & "${FORCE_CONFIRM}"!="ENABLED" ]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
     2046      $ext->add($context, $exten, '', new ext_execif('$["${FORCE_CONFIRM}"="ENABLED" ]', 'Set', 'DIAL_TRUNK_OPTIONS=M(confirm)${DIAL_TRUNK_OPTIONS}')); 
    20432047     
    20442048      // This macro call will always be blank and is provided as a hook for customization required prior to making a call 
     
    21722176      // Back to normal processing, whether intracompany or not. 
    21732177      // But add the macro-setmusic if we don't want music on this outbound call 
    2174       $ext->add($context, $exten, '', new ext_execif('$[$["${MOHCLASS}" != "default"] & $["${MOHCLASS}" != ""]]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
     2178      $ext->add($context, $exten, '', new ext_execif('$["${MOHCLASS}"!="default" & "${MOHCLASS}"!="" & "${FORCE_CONFIRM}"!="ENABLED" ]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
     2179      $ext->add($context, $exten, '', new ext_execif('$["${FORCE_CONFIRM}"="ENABLED" ]', 'Set', 'DIAL_TRUNK_OPTIONS=M(confirm)${DIAL_TRUNK_OPTIONS}')); 
    21752180     
    21762181      // This macro call will always be blank and is provided as a hook for customization required prior to making a call 
     
    23302335   
    23312336      $ext->add($context, $exten, '', new ext_gosubif('$[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]','sub-pincheck,s,1')); 
    2332       $ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${ARG1}')); 
     2337      $ext->add($context, $exten, '', new ext_gotoif('$["x${OUTDISABLE_${DIAL_TRUNK}}" = "xon"]', 'disabletrunk,1')); 
     2338      $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${DIAL_OPTIONS}')); // will be reset to TRUNK_OPTIONS if not intra-company 
    23332339      $ext->add($context, $exten, '', new ext_set('OUTBOUND_GROUP', 'OUT_${ARG1}')); 
    23342340      $ext->add($context, $exten, '', new ext_gotoif('$["${OUTMAXCHANS_${ARG1}}foo" = "foo"]', 'nomax')); 
     
    23362342      $ext->add($context, $exten, 'nomax', new ext_set('DIAL_NUMBER', '${ARG2}')); 
    23372343      $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK', '${ARG1}')); 
    2338       $ext->add($context, $exten, '', new ext_gosubif('$["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]','sub-flp-${DIAL_TRUNK},s,1'));  // manimpulate DIAL_NUMBER 
     2344      $ext->add($context, $exten, '', new ext_gotoif('$["${INTRACOMPANYROUTE}" = "YES"]', 'skipoutcid'));  // Set to YES if treated like internal 
     2345      $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${TRUNK_OPTIONS}')); 
     2346      $ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${DIAL_TRUNK}')); 
     2347      $ext->add($context, $exten, 'skipoutcid', new ext_gosubif('$["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]','sub-flp-${DIAL_TRUNK},s,1'));  // manimpulate DIAL_NUMBER 
    23392348      //  Replacement for asterisk's ENUMLOOKUP function 
    23402349      $ext->add($context, $exten, '', new ext_agi('enumlookup.agi')); 
     
    23422351      // Loop through them trying them in order. 
    23432352      $ext->add($context, $exten, 'dialloop', new ext_gotoif('$["foo${DIALARR}"="foo"]', 's-${DIALSTATUS},1')); 
     2353      $ext->add($context, $exten, '', new ext_execif('$["${MOHCLASS}"!="default" & "${MOHCLASS}"!="" & "${FORCE_CONFIRM}"!="ENABLED" ]', 'Set', 'DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}')); 
     2354      $ext->add($context, $exten, '', new ext_execif('$["${FORCE_CONFIRM}"="ENABLED" ]', 'Set', 'DIAL_TRUNK_OPTIONS=M(confirm)${DIAL_TRUNK_OPTIONS}')); 
    23442355      $ext->add($context, $exten, '', new ext_set('TRYDIAL', '${CUT(DIALARR,%,1)}')); 
    23452356      $ext->add($context, $exten, '', new ext_set('DIALARR', '${CUT(DIALARR,%,2-)}')); 
    2346       $ext->add($context, $exten, '', new ext_dial('${TRYDIAL}', '')); 
     2357      $ext->add($context, $exten, '', new ext_dial('${TRYDIAL}', '${DIAL_TRUNK_OPTIONS}')); 
    23472358      // Now, if we're still here, that means the Dial failed for some reason.  
    23482359      // If it's CONGESTION or CHANUNAVAIL we want to try again on a different