Changeset 8930

Show
Ignore:
Timestamp:
02/25/10 09:45:36 (6 months ago)
Author:
p_lindheimer
Message:

closes #4053 and updated macro-dialout-enum to be consistent with new format of macro-dialout-trunk

Files:

Legend:

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

    r8927 r8930  
    18151815                        $ext->add($context, $exten, '', new ext_playtones('busy')); 
    18161816                        $ext->add($context, $exten, '', new ext_busy(20)); 
     1817 
     1818                        /* 
     1819                        * There are reported bugs in Asterisk Blind Trasfers that result in Dial() returning and continuing 
     1820      * execution with a status of ANSWER. So we hangup at this point 
     1821                        */ 
     1822                        $exten = 's-ANSWER'; 
     1823                        $ext->add($context, $exten, '', new ext_noop('Call successfully answered - Hanging up now')); 
     1824                        $ext->add($context, $exten, '', new ext_macro('hangupcall')); 
    18171825                 
    18181826                        $exten = 's-NOANSWER'; 
     
    19281936                        $ext->add($context, $exten, '', new ext_playtones('busy')); 
    19291937                        $ext->add($context, $exten, '', new ext_busy(20)); 
     1938 
     1939                        /* 
     1940                        * There are reported bugs in Asterisk Blind Trasfers that result in Dial() returning and continuing 
     1941      * execution with a status of ANSWER. So we hangup at this point 
     1942                        */ 
     1943                        $exten = 's-ANSWER'; 
     1944                        $ext->add($context, $exten, '', new ext_noop('Call successfully answered - Hanging up now')); 
     1945                        $ext->add($context, $exten, '', new ext_macro('hangupcall')); 
    19301946                 
    19311947                        $exten = 's-NOANSWER'; 
     
    20672083                        // Now we have the variable DIALARR set to a list of URI's that can be called, in order of priority 
    20682084                        // Loop through them trying them in order. 
    2069                         $ext->add($context, $exten, 'dialloop', new ext_gotoif('$["foo${DIALARR}"="foo"]', 'end')); 
     2085                        $ext->add($context, $exten, 'dialloop', new ext_gotoif('$["foo${DIALARR}"="foo"]', 's-${DIALSTATUS},1')); 
    20702086                        $ext->add($context, $exten, '', new ext_set('TRYDIAL', '${CUT(DIALARR,%,1)}')); 
    20712087                        $ext->add($context, $exten, '', new ext_set('DIALARR', '${CUT(DIALARR,%,2-)}')); 
    20722088                        $ext->add($context, $exten, '', new ext_dial('${TRYDIAL}', '')); 
    2073                         $ext->add($context, $exten, '', new ext_noop('Dial exited in macro-enum-dialout with ${DIALSTATUS}')); 
    20742089                        // Now, if we're still here, that means the Dial failed for some reason.  
    20752090                        // If it's CONGESTION or CHANUNAVAIL we want to try again on a different 
    20762091                        // different channel. If there's no more left, the dialloop tag will exit. 
    2077                         $ext->add($context, $exten, '', new ext_gotoif('$[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]', 'dialloop')); 
    2078                         // If we're here, then it's BUSY or NOANSWER or something and well, deal with it. 
    2079                         $ext->add($context, $exten, 'dialfailed', new ext_goto(1, 's-${DIALSTATUS}')); 
     2092                        $ext->add($context, $exten, '', new ext_gotoif('$[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]', 'dialloop','s-${DIALSTATUS},1')); 
    20802093                        // Here are the exit points for the macro. 
    20812094                        $ext->add($context, $exten, 'nochans', new ext_noop('max channels used up')); 
    2082                         $ext->add($context, $exten, 'end', new ext_noop('Exiting macro-dialout-enum')); 
    2083                         $ext->add($context, 's-BUSY', '', new ext_noop('Trunk is reporting BUSY')); 
    2084                         $ext->add($context, 's-BUSY', '', new ext_busy(20)); 
    2085                         $ext->add($context, '_s-.', '', new ext_noop('Dial failed due to ${DIALSTATUS}'));                       
     2095 
     2096                        $exten = 's-BUSY'; 
     2097                        /* 
     2098                        * HANGUPCAUSE 17 = Busy, or SIP 486 Busy everywhere 
     2099                        */ 
     2100                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting BUSY - giving up')); 
     2101                        $ext->add($context, $exten, '', new ext_playtones('busy')); 
     2102                        $ext->add($context, $exten, '', new ext_busy(20)); 
     2103 
     2104                        /* 
     2105                        * There are reported bugs in Asterisk Blind Trasfers that result in Dial() returning and continuing 
     2106      * execution with a status of ANSWER. So we hangup at this point 
     2107                        */ 
     2108                        $exten = 's-ANSWER'; 
     2109                        $ext->add($context, $exten, '', new ext_noop('Call successfully answered - Hanging up now')); 
     2110                        $ext->add($context, $exten, '', new ext_macro('hangupcall')); 
     2111                 
     2112                        $exten = 's-NOANSWER'; 
     2113                        /* 
     2114                        * HANGUPCAUSE 18 = No User Responding, or SIP 408 Request Timeout 
     2115                        * HANGUPCAUSE 19 = No Answer From The User, or SIP 480 Temporarily unavailable, SIP 483 To many hops 
     2116                        */ 
     2117                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting NOANSWER - giving up')); 
     2118                        $ext->add($context, $exten, '', new ext_progress()); 
     2119                        switch ($trunkreportmsg_ids['no_answer_msg_id']) { 
     2120        case DEFAULT_MSG: 
     2121          $ext->add($context, $exten, '', new ext_playback('number-not-answering,noanswer')); 
     2122        break; 
     2123        case CONGESTION_TONE: 
     2124          $ext->add($context, $exten, '', new ext_playtones('congestion')); 
     2125        break; 
     2126        default: 
     2127          $message = recordings_get_file($trunkreportmsg_ids['no_answer_msg_id']); 
     2128          $message = ($message != "") ? $message : "number-not-answering"; 
     2129          $ext->add($context, $exten, '', new ext_playback("$message, noanswer")); 
     2130      } 
     2131                        $ext->add($context, $exten, '', new ext_congestion(20)); 
     2132 
     2133                        $exten = 's-INVALIDNMBR'; 
     2134                        /* 
     2135                        * HANGUPCAUSE 28 = Address Incomplete, or SIP 484 Address Incomplete 
     2136                        */ 
     2137                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Address Incomplete - giving up')); 
     2138                        $ext->add($context, $exten, '', new ext_progress()); 
     2139                        switch ($trunkreportmsg_ids['invalidnmbr_msg_id']) { 
     2140        case DEFAULT_MSG: 
     2141          $ext->add($context, $exten, '', new ext_playback('ss-noservice,noanswer')); 
     2142        break; 
     2143        case CONGESTION_TONE: 
     2144          $ext->add($context, $exten, '', new ext_playtones('congestion')); 
     2145        break; 
     2146        default: 
     2147          $message = recordings_get_file($trunkreportmsg_ids['invalidnmbr_msg_id']); 
     2148          $message = ($message != "") ? $message : "ss-noservice"; 
     2149          $ext->add($context, $exten, '', new ext_playback("$message, noanswer")); 
     2150      } 
     2151                        $ext->add($context, $exten, '', new ext_busy(20)); 
     2152 
     2153                        $exten = "s-CHANGED"; 
     2154                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Number Changed - giving up')); 
     2155                        $ext->add($context, $exten, '', new ext_playtones('busy')); 
     2156                        $ext->add($context, $exten, '', new ext_busy(20)); 
     2157                         
     2158                        $exten = '_s-.'; 
     2159                        $ext->add($context, $exten, '', new ext_set('RC', '${IF($[${ISNULL(${HANGUPCAUSE})}]?0:${HANGUPCAUSE})}'));  
     2160                        $ext->add($context, $exten, '', new ext_goto('1','${RC}')); 
     2161 
     2162                        $ext->add($context, '17', '', new ext_goto('1','s-BUSY')); 
     2163                        $ext->add($context, '18', '', new ext_goto('1','s-NOANSWER')); 
     2164                        $ext->add($context, '22', '', new ext_goto('1','s-CHANGED')); 
     2165                        $ext->add($context, '23', '', new ext_goto('1','s-CHANGED')); 
     2166                        $ext->add($context, '28', '', new ext_goto('1','s-INVALIDNMBR')); 
     2167                        $ext->add($context, '_X.', '', new ext_goto('1','continue')); 
     2168 
     2169                        $exten = 'continue'; 
     2170                        $ext->add($context, $exten, '', new ext_gotoif('$["${OUTFAIL_${ARG1}}" = ""]', 'noreport')); 
     2171                        $ext->add($context, $exten, '', new ext_agi('${OUTFAIL_${ARG1}}')); 
     2172                        $ext->add($context, $exten, 'noreport', new ext_noop('TRUNK Dial failed due to ${DIALSTATUS} HANGUPCAUSE: ${HANGUPCAUSE} - failing through to other trunks')); 
     2173                         
     2174                        $ext->add($context, 'disabletrunk', '', new ext_noop('TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk')); 
     2175                        $ext->add($context, 'bypass', '', new ext_noop('TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook')); 
     2176                 
     2177                        $ext->add($context, 'h', '', new ext_macro('hangupcall')); 
     2178 
    20862179                         
    20872180                        /* 
  • modules/branches/2.7/core/module.xml

    r8927 r8930  
    1010        <canuninstall>no</canuninstall> 
    1111        <changelog> 
    12                 *2.7.0RC1.5* #4075, #4078, #4080 
     12                *2.7.0RC1.5* #4075, #4078, #4080, #4053 
    1313                *2.7.0RC1.4* #4072 
    1414                *2.7.0RC1.3* #4068, (#4069 available but not used)