Changeset 5183

Show
Ignore:
Timestamp:
11/01/07 21:25:19 (1 year ago)
Author:
p_lindheimer
Message:

#1926, #1978 fix deficiencies in intercom, add support for explicit allow and deny, expand phones that can auto-answer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.4/paging/functions.inc.php

    r5171 r5183  
    1717                        // setup for intercom 
    1818                        $fcc = new featurecode('paging', 'intercom-prefix'); 
    19                         $code = $fcc->getCodeActive(); 
     19                        $intercom_code = $fcc->getCodeActive(); 
    2020                        unset($fcc); 
    2121 
     
    2323                        // no point in even setting the headers here they will get lost in channel local 
    2424                        // 
    25                         if (!empty($code)) { 
    26                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('dialnumber', '${EXTEN:'.strlen($code).'}')); 
    27                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_dbget('user-intercom','AMPUSER/${dialnumber}/intercom')); 
    28                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_gotoif('$["${user-intercom}" = "disabled" ]', 'nointercom')); 
    29                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__SIPADDHEADER', 'Call-Info: \;answer-after=0')); 
    30                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__ALERT_INFO', 'Ring Answer')); 
    31                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__SIP_URI_OPTIONS', 'intercom=true')); 
    32                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_macro('user-callerid')); 
    33                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_dial('Local/${dialnumber}@from-internal/n','','')); 
    34                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_busy()); 
    35                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_macro('hangupcall')); 
    36                                 $ext->add('ext-intercom', '_'.$code.'.', 'nointercom', new ext_noop('Intercom disallowed by ${dialnumber}')); 
    37                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_playback('intercom&for&extension')); 
    38                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_saydigits('${dialnumber}')); 
    39                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_playback('is&disabled')); 
    40                                 $ext->add('ext-intercom', '_'.$code.'.', '', new ext_congestion()); 
    41  
     25                        $extpaging = 'ext-paging'; 
     26                        if (!empty($intercom_code)) { 
     27                                $code = '_'.$intercom_code.'.'; 
     28                                $context = 'ext-intercom'; 
     29                                $ext->add($context, $code, '', new ext_setvar('dialnumber', '${EXTEN:'.strlen($intercom_code).'}')); 
     30                                $ext->add($context, $code, '', new ext_macro('user-callerid')); 
     31                                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "allow" ]', 'allow')); 
     32                                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "deny" ]', 'nointercom')); 
     33                                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom)}" = "disabled" ]', 'nointercom')); 
     34                                $ext->add($context, $code, 'allow', new ext_dbget('DEVICES','AMPUSER/${dialnumber}/device')); 
     35                                $ext->add($context, $code, '', new ext_gotoif('$["${DEVICES}" = "" ]', 'end')); 
     36                                $ext->add($context, $code, '', new ext_setvar('LOOPCNT', '${FIELDQTY(DEVICES,&)}')); 
     37                                $ext->add($context, $code, '', new ext_gotoif('$[${LOOPCNT} > 1 ]', 'pagemode')); 
     38                                $ext->add($context, $code, '', new ext_macro('autoanswer','${DEVICES}')); 
     39                                $ext->add($context, $code, 'check', new ext_chanisavail('${DIAL}', 'sj')); 
     40                                $ext->add($context, $code, '', new ext_dial('${DIAL}','5,A(beep)')); 
     41                                $ext->add($context, $code, '', new ext_busy()); 
     42                                $ext->add($context, $code, '', new ext_macro('hangupcall')); 
     43                                $ext->add($context, $code, '', new ext_busy(), 'check',101); 
     44                                $ext->add($context, $code, '', new ext_macro('hangupcall')); 
     45                                $ext->add($context, $code, 'pagemode', new ext_setvar('ITER', '1')); 
     46                                $ext->add($context, $code, '', new ext_setvar('DIALSTR', '')); 
     47                                $ext->add($context, $code, '', new ext_setvar('__SIP_URI_OPTIONS', 'intercom=true')); 
     48                                $ext->add($context, $code, 'begin', new ext_setvar('DIALSTR', '${DIALSTR}&LOCAL/PAGE${CUT(DEVICES,&,${ITER})}@'.$extpaging)); 
     49                                $ext->add($context, $code, '', new ext_setvar('ITER', '$[${ITER} + 1]')); 
     50                                $ext->add($context, $code, '', new ext_gotoif('$[${ITER} <= ${LOOPCNT}]', 'begin')); 
     51                                $ext->add($context, $code, '', new ext_setvar('DIALSTR', '${DIALSTR:1}')); 
     52                                $ext->add($context, $code, '', new ext_setvar('_FORCE_PAGE', '0')); 
     53                                $ext->add($context, $code, '', new ext_setvar('_AMPUSER', '${AMPUSER}')); 
     54                                $ext->add($context, $code, '', new ext_page('${DIALSTR},d')); 
     55                                $ext->add($context, $code, '', new ext_busy()); 
     56                                $ext->add($context, $code, '', new ext_macro('hangupcall')); 
     57                                $ext->add($context, $code, 'nointercom', new ext_noop('Intercom disallowed by ${dialnumber}')); 
     58                                $ext->add($context, $code, '', new ext_playback('intercom&for&extension')); 
     59                                $ext->add($context, $code, '', new ext_saydigits('${dialnumber}')); 
     60                                $ext->add($context, $code, '', new ext_playback('is&disabled')); 
     61                                $ext->add($context, $code, '', new ext_congestion()); 
     62 
     63                                $extintercomusers = 'ext-intercom-users'; 
    4264                                $userlist = core_users_list(); 
    4365                                if (is_array($userlist)) { 
    4466                                        foreach($userlist as $item) { 
    45                                                 $intercom_code = $code.$item[0]; 
    46                                                 $ext->add('ext-intercom-users', '_'.$intercom_code, '', new ext_goto('ext-intercom,${EXTEN},1')); 
     67                                                $ext_intercom_code = $intercom_code.$item[0]; 
     68                                                $ext->add($extintercomusers, $ext_intercom_code, '', new ext_goto($context.',${EXTEN},1')); 
    4769                                        } 
    4870                                } 
    49                                 $ext->addInclude('from-internal-additional', 'ext-intercom-users'); 
     71 
     72                                $context = $extintercomusers; 
     73                                $ext->addInclude('from-internal-additional', $context); 
     74                        } 
    5075                         
    51                                 $fcc = new featurecode('paging', 'intercom-on'); 
    52                                 $oncode = $fcc->getCodeActive(); 
    53                                 unset($fcc); 
    54  
    55                                 if ($oncode) { 
    56                                         $ext->add('ext-intercom-users', $oncode, '', new ext_answer('')); 
    57                                         $ext->add('ext-intercom-users', $oncode, '', new ext_wait('1')); 
    58                                         $ext->add('ext-intercom-users', $oncode, '', new ext_macro('user-callerid')); 
    59                                         $ext->add('ext-intercom-users', $oncode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'enabled')); 
    60                                         $ext->add('ext-intercom-users', $oncode, '', new ext_playback('intercom&enabled')); 
    61                                         $ext->add('ext-intercom-users', $oncode, '', new ext_macro('hangupcall')); 
    62                                 } 
     76                        $fcc = new featurecode('paging', 'intercom-on'); 
     77                        $oncode = $fcc->getCodeActive(); 
     78                        unset($fcc); 
     79 
     80                        if ($oncode) { 
     81                                $ext->add($context, $oncode, '', new ext_answer('')); 
     82                                $ext->add($context, $oncode, '', new ext_wait('1')); 
     83                                $ext->add($context, $oncode, '', new ext_macro('user-callerid')); 
     84                                $ext->add($context, $oncode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'enabled')); 
     85                                $ext->add($context, $oncode, '', new ext_playback('intercom&enabled')); 
     86                                $ext->add($context, $oncode, '', new ext_macro('hangupcall')); 
     87 
     88                                $target = '${EXTEN:'.strlen($oncode).'}'; 
     89                                $oncode = "_".$oncode."."; 
     90                                $ext->add($context, $oncode, '', new ext_answer('')); 
     91                                $ext->add($context, $oncode, '', new ext_wait('1')); 
     92                                $ext->add($context, $oncode, '', new ext_macro('user-callerid')); 
     93                                $ext->add($context, $oncode, '', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/intercom/'.$target.')}" = "allow" ]}','unset')); 
     94                                $ext->add($context, $oncode, '', new ext_gotoif('$[${DB_EXISTS(AMPUSER/${EXTEN:3}/device)} != 1]','invaliduser')); 
     95                                $ext->add($context, $oncode, '', new ext_dbput('AMPUSER/${AMPUSER}/intercom/'.$target, 'allow')); 
     96                                $ext->add($context, $oncode, '', new ext_playback('intercom&enabled&for&extension&number')); 
     97                                $ext->add($context, $oncode, '', new ext_saydigits($target)); 
     98                                $ext->add($context, $oncode, '', new ext_macro('hangupcall')); 
     99                                $ext->add($context, $oncode, 'unset', new ext_dbdeltree('AMPUSER/${AMPUSER}/intercom/'.$target)); 
     100                                $ext->add($context, $oncode, '', new ext_playback('intercom&enabled&cancelled&for&extension&number')); 
     101                                $ext->add($context, $oncode, '', new ext_saydigits($target)); 
     102                                $ext->add($context, $oncode, '', new ext_macro('hangupcall')); 
     103                                $ext->add($context, $oncode, 'invaliduser', new ext_playback('extension&number')); 
     104                                $ext->add($context, $oncode, '', new ext_saydigits($target)); 
     105                                $ext->add($context, $oncode, '', new ext_playback('is&invalid')); 
     106                                $ext->add($context, $oncode, '', new ext_macro('hangupcall')); 
     107                        } 
    63108                         
    64                                 $fcc = new featurecode('paging', 'intercom-off'); 
    65                                 $offcode = $fcc->getCodeActive(); 
    66                                 unset($fcc); 
    67          
    68                                 if ($offcode) { 
    69                                         $ext->add('ext-intercom-users', $offcode, '', new ext_answer('')); 
    70                                         $ext->add('ext-intercom-users', $offcode, '', new ext_wait('1')); 
    71                                         $ext->add('ext-intercom-users', $offcode, '', new ext_macro('user-callerid')); 
    72                                         $ext->add('ext-intercom-users', $offcode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'disabled')); 
    73                                         $ext->add('ext-intercom-users', $offcode, '', new ext_playback('intercom&disabled')); 
    74                                         $ext->add('ext-intercom-users', $offcode, '', new ext_macro('hangupcall')); 
    75                                 } 
     109                        $fcc = new featurecode('paging', 'intercom-off'); 
     110                        $offcode = $fcc->getCodeActive(); 
     111                        unset($fcc); 
     112         
     113                        if ($offcode) { 
     114                                $ext->add($context, $offcode, '', new ext_answer('')); 
     115                                $ext->add($context, $offcode, '', new ext_wait('1')); 
     116                                $ext->add($context, $offcode, '', new ext_macro('user-callerid')); 
     117                                $ext->add($context, $offcode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'disabled')); 
     118                                $ext->add($context, $offcode, '', new ext_playback('intercom&disabled')); 
     119                                $ext->add($context, $offcode, '', new ext_macro('hangupcall')); 
     120 
     121                                $target = '${EXTEN:'.strlen($offcode).'}'; 
     122                                $offcode = "_".$offcode."."; 
     123                                $ext->add($context, $offcode, '', new ext_answer('')); 
     124                                $ext->add($context, $offcode, '', new ext_wait('1')); 
     125                                $ext->add($context, $offcode, '', new ext_macro('user-callerid')); 
     126                                $ext->add($context, $offcode, '', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/intercom/'.$target.')}" = "deny" ]}','unset2')); 
     127                                $ext->add($context, $offcode, '', new ext_gotoif('$[${DB_EXISTS(AMPUSER/${EXTEN:3}/device)} != 1]','invaliduser2')); 
     128                                $ext->add($context, $offcode, '', new ext_dbput('AMPUSER/${AMPUSER}/intercom/'.$target, 'deny')); 
     129                                $ext->add($context, $offcode, '', new ext_playback('intercom&disabled&for&extension&number')); 
     130                                $ext->add($context, $offcode, '', new ext_saydigits($target)); 
     131                                $ext->add($context, $offcode, '', new ext_macro('hangupcall')); 
     132                                $ext->add($context, $offcode, 'unset2', new ext_dbdeltree('AMPUSER/${AMPUSER}/intercom/'.$target)); 
     133                                $ext->add($context, $offcode, '', new ext_playback('intercom&disabled&cancelled&for&extension&number')); 
     134                                $ext->add($context, $offcode, '', new ext_saydigits($target)); 
     135                                $ext->add($context, $offcode, '', new ext_macro('hangupcall')); 
     136                                $ext->add($context, $offcode, 'invaliduser2', new ext_playback('extension&number')); 
     137                                $ext->add($context, $offcode, '', new ext_saydigits($target)); 
     138                                $ext->add($context, $offcode, '', new ext_playback('is&invalid')); 
     139                                $ext->add($context, $offcode, '', new ext_macro('hangupcall')); 
    76140                        } 
    77141 
    78                         // Get a list of all the phones used for paging 
    79                         $sql = "SELECT DISTINCT ext FROM paging_groups"; 
    80                         $results = $db->getAll($sql); 
    81                         if (!isset($results[0][0])) { 
    82                                 // There are no phones here, no paging support, lets give up now. 
    83                                 return 0; 
    84                         } 
    85                         // We have paging support. 
    86                         $ext->addInclude('from-internal-additional','ext-paging'); 
    87                         // Lets give all the phones their PAGExxx lines. 
    88                         // TODO: Support for specific phones configurations 
    89                         foreach ($results as $grouparr) { 
    90                                 $skipheaders = false; 
    91                                 $xtn=trim($grouparr[0]); 
    92                                 if (strtoupper(substr($xtn,-1)) == "X") { 
    93                                         // hack for allowing no SIP headers 
    94                                         //TODO : replace this with DevicesTakeTwo stuff 
    95                                         $xtn = rtrim($xtn,"xX"); 
    96                                         $skipheaders = true; 
    97                                 } 
     142                        /* Create macro-autoanswer that will try to intelligently set the 
     143                        required parameters to handle paging. Eventually it will use 
     144                                known device information. 
     145 
     146                                This macro does the following: 
     147 
     148                                Input:  FreePBX Device number to be called requiring autoanswer 
     149                                Output: ${DIAL} Channel Variable with the dial string to be called 
     150                                        Appropriate SIP headers added 
     151                                                                Other special requirements that may be custom for this device 
     152 
     153                                1. Set ${DIAL} to the device's dial string 
     154                                2. If there is a device specific macro defined in the DEVICE's object 
     155                                   (DEVICE/<devicenum>/autoanswer/macro) then execute that macro and end 
     156                          3. Set prepare defaults for Alert-Info and Call-Info headers and  
     157                                   SIP_URI_OPTIONS 
     158                                4. Try to identify and endpoints by their useragents that may need known 
     159                                   changes and make those changes. 
     160                                5. Set the variables and end 
     161 
     162                                This macro is called for intercoming and paging to try and enable the 
     163                                target device to auto-answer. Devices with special needs can be handled 
     164                                with the device specific macro. For example, if you have a device that 
     165                                can not auto-answer except by specifically configuring a line key on 
     166                                the device that always answers, you could use a device specific macro 
     167                                to change the dialstring. If you had a set of such devices, you could 
     168                                standardize on the device numbers (e.g. nnnn for normal calls and 2nnnn 
     169                                for auto-answer calls). You could then create a general purpose macro 
     170                                to modify the dial string accordingly. Provisioning tools will be able 
     171                                to take advantage of setting and creating such an ability. 
     172                        */ 
     173 
     174                        $macro = 'macro-autoanswer'; 
     175                        $ext->add($macro, "s", '', new ext_setvar('DIAL', '${DB(DEVICE/${ARG1}/dial)}')); 
     176                        $ext->add($macro, "s", '', new ext_gotoif('$["${DB(DEVICE/${ARG1}/autoanswer/macro)}" != "" ]', 'macro')); 
     177                        $ext->add($macro, "s", '', new ext_setvar('phone', '${SIPPEER(${CUT(DIAL,/,2)}:useragent)}')); 
     178                        $ext->add($macro, "s", '', new ext_setvar('ALERTINFO', 'Alert-Info: Ring Answer')); 
     179                        $ext->add($macro, "s", '', new ext_setvar('CALLINFO', 'Call-Info: \;answer-after=0')); 
     180                        $ext->add($macro, "s", '', new ext_setvar('SIPURI', 'intercom=true')); 
     181 
     182                        // Defaults are setup, now make specific adjustments for detected phones 
     183                        // 
     184                        $ext->add($macro, "s", '', new ext_execif('$["${phone:0:5}" = "Mitel"]', 'Set','CALLINFO=Call-Info: <sip:broadworks.net>\;answer-after=0')); 
     185                        $ext->add($macro, "s", '', new ext_execif('$["${phone:0:4}" = "snom"]', 'Set','CALLINFO=Call-Info: <sip:broadworks.net>\;answer-after=0')); 
     186                        $ext->add($macro, "s", '', new ext_execif('$["${phone:0:6}" = "Aastra"]', 'Set','ALERTINFO=Alert-Info: \;info=alert-autoanswer')); 
     187                        $ext->add($macro, "s", '', new ext_execif('$["${phone:0:6}" = "Aastra"]', 'Set','CALLINFO=')); 
     188 
     189                        // Now any adjustments have been made, set the headers and done 
     190                        // 
     191                        $ext->add($macro, "s", '', new ext_execif('$["${ALERTINFO}" != ""]', 'SipAddHeader','${ALERTINFO}')); 
     192                        $ext->add($macro, "s", '', new ext_execif('$["${CALLINFO}" != ""]', 'SipAddHeader','${CALLINFO}')); 
     193                        $ext->add($macro, "s", '', new ext_execif('$["${SIPURI}" != ""]', 'Set','__SIP_URI_OPTIONS=${SIPURI}')); 
     194                        $ext->add($macro, "s", 'macro', new ext_macro('${DB(DEVICE/${ARG1}/autoanswer/macro)}','${ARG1}'), 'n',2); 
     195 
     196 
     197 
     198                        $ext->addInclude('from-internal-additional',$extpaging); 
     199                        // Create the paging context that is used in the paging application for each phone to auto-answer 
    98200                                 
    99                                $ext->add('ext-paging', "PAGE${xtn}", '', new ext_gotoif('$[ ${AMPUSER} = '.$xtn.' ]','skipself')); 
    100                                $ext->add('ext-paging', "PAGE${xtn}", '', new ext_gotoif('$[ ${FORCE_PAGE} != 1 ]','AVAIL')); 
    101                                $ext->add('ext-paging', "PAGE${xtn}", '', new ext_setvar('AVAILSTATUS', 'not checked')); 
    102                                $ext->add('ext-paging', "PAGE${xtn}", '', new ext_goto('SKIPCHECK')); 
    103                                $ext->add('ext-paging', "PAGE${xtn}", 'AVAIL', new ext_chanisavail('${DB(DEVICE/'.$xtn.'/dial)}', 'js')); 
    104                                $ext->add('ext-paging', "PAGE${xtn}", 'SKIPCHECK', new ext_noop('Seems to be available (state = ${AVAILSTATUS}')); 
     201                        $ext->add($extpaging, "_PAGE.", '', new ext_gotoif('$[ ${AMPUSER} = ${EXTEN:4} ]','skipself')); 
     202                        $ext->add($extpaging, "_PAGE.", '', new ext_gotoif('$[ ${FORCE_PAGE} != 1 ]','AVAIL')); 
     203                        $ext->add($extpaging, "_PAGE.", '', new ext_setvar('AVAILSTATUS', 'not checked')); 
     204                        $ext->add($extpaging, "_PAGE.", '', new ext_goto('SKIPCHECK')); 
     205                        $ext->add($extpaging, "_PAGE.", 'AVAIL', new ext_chanisavail('${DB(DEVICE/${EXTEN:4}/dial)}', 'js')); 
     206                        $ext->add($extpaging, "_PAGE.", 'SKIPCHECK', new ext_noop('Seems to be available (state = ${AVAILSTATUS}')); 
    105207                                 
    106                                if (!$skipheaders) { 
    107                                        $ext->add('ext-paging', "PAGE${xtn}", '', new ext_sipaddheader('Call-Info','\;answer-after=0')); 
    108                                        $ext->add('ext-paging', "PAGE${xtn}", '', new ext_alertinfo('Ring Answer')); 
    109                                        $ext->add('ext-paging', "PAGE${xtn}", '', new ext_setvar('__SIP_URI_OPTIONS', 'intercom=true')); 
    110                                } 
     208                        $ext->add($extpaging, "_PAGE.", '', new ext_macro('autoanswer','${EXTEN:4}')); 
     209                 
     210                        $ext->add($extpaging, "_PAGE.", '', new ext_dial('${DIAL}', '5, A(beep)')); 
     211                        $ext->add($extpaging, "_PAGE.", 'skipself', new ext_noop('Not paging originator')); 
     212                        $ext->add($extpaging, "_PAGE.", '', new ext_hangup()); 
    111213                                 
    112                                 $ext->add('ext-paging', "PAGE${xtn}", '', new ext_dial("\${DB(DEVICE/${xtn}/dial)}", '5, A(beep)')); 
    113                                 $ext->add('ext-paging', "PAGE${xtn}", 'skipself', new ext_noop('Not paging originator')); 
    114                                 $ext->add('ext-paging', "PAGE${xtn}", '', new ext_hangup()); 
    115                                  
    116                                 $ext->add('ext-paging', "PAGE${xtn}", '', new ext_noop('Channel ${AVAILCHAN} is not available (state = ${AVAILSTATUS})'), 'AVAIL',101); 
    117                         } 
     214                        $ext->add($extpaging, "_PAGE.", '', new ext_noop('Channel ${AVAILCHAN} is not available (state = ${AVAILSTATUS})'), 'AVAIL',101); 
     215                        // 
    118216                        // Now get a list of all the paging groups... 
    119217                        $sql = "SELECT page_group, force_page, duplex FROM paging_config"; 
     
    129227                                        } 
    130228 
    131                                         $dialstr .= "LOCAL/PAGE".trim($local_dial[0])."@ext-paging&"; 
     229                                        $dialstr .= "LOCAL/PAGE".trim($local_dial[0])."@".$extpaging."&"; 
    132230                                } 
    133231                                // It will always end with an &, so lets take that off. 
     
    137235                                        $dialstr .= ",d"; 
    138236                                } 
    139                                 $ext->add('ext-paging', "Debug", '', new ext_noop("dialstr is $dialstr")); 
    140                                 $ext->add('ext-paging', $grp, '', new ext_setvar("_FORCE_PAGE", ($thisgroup['force_page']?1:0))); 
    141                                 $ext->add('ext-paging', $grp, '', new ext_macro('user-callerid')); 
     237                                $ext->add($extpaging, "Debug", '', new ext_noop("dialstr is $dialstr")); 
     238                                $ext->add($extpaging, $grp, '', new ext_setvar("_FORCE_PAGE", ($thisgroup['force_page']?1:0))); 
     239                                $ext->add($extpaging, $grp, '', new ext_macro('user-callerid')); 
    142240                                // make AMPUSER inherited here, so we can skip the proper 'self' if using cidnum masquerading 
    143                                 $ext->add('ext-paging', $grp, '', new ext_setvar('_AMPUSER', '${AMPUSER}')); 
    144                                 $ext->add('ext-paging', $grp, '', new ext_page($dialstr)); 
     241                                $ext->add($extpaging, $grp, '', new ext_setvar('_AMPUSER', '${AMPUSER}')); 
     242                                $ext->add($extpaging, $grp, '', new ext_page($dialstr)); 
    145243                        } 
    146244                         
  • modules/branches/2.4/paging/module.xml

    r5174 r5183  
    22        <rawname>paging</rawname> 
    33        <name>Paging and Intercom</name> 
    4         <version>1.6.7</version> 
     4        <version>2.0.0</version> 
    55        <type>setup</type> 
    66        <category>Internal Options &amp; Configuration</category> 
    77        <changelog> 
     8                *2.0.0* #1926, #1978 fix deficiencies in intercom, add support for explicit allow and deny, expand phones that can auto-answer 
    89                *1.6.7* Add support for duplex paging 
    910                *1.6.6.1* #2376 enable/disable code broke in 1.6.6 and add user-callerid to get proper cid on intercom 
     
    2526        </requirements> 
    2627        <description>Allows creation of paging groups to make announcements using the speaker built into most SIP phones.  
    27          
    28         Also creates an Intercom feature code that can be used as a prefix to talk directly to one person, as well as optional feature codes to block/allow intercom calls.</description> 
     28        Also creates an Intercom feature code that can be used as a prefix to talk directly to one person, as well as optional feature codes to block/allow intercom calls to all users as well as blocking specific users or only allowing specific users.</description> 
    2929        <menuitems> 
    3030                <paging>Paging and Intercom</paging> 
  • modules/branches/2.4/paging/page.paging.php

    r5171 r5183  
    5454 
    5555function paging_text() { 
     56 
     57        $fcc = new featurecode('paging', 'intercom-prefix'); 
     58        $intercom_code = $fcc->getCodeActive(); 
     59        unset($fcc); 
     60        $fcc = new featurecode('paging', 'intercom-on'); 
     61        $oncode = $fcc->getCodeActive(); 
     62        unset($fcc); 
     63        $fcc = new featurecode('paging', 'intercom-off'); 
     64        $offcode = $fcc->getCodeActive(); 
     65        unset($fcc); 
    5666?> 
    57 <p><?php echo _("This module is for specific phones that are capable of Paging or Intercom. This section is for configuring group paging, intercom is configured through <strong>Feature Codes</strong>.<br /><br />The current list of supported phones is GXP-2000 with firmware 1.0.13 or higher, Snom phones with 'recent' firmware, Polycom phones (provisioned to auto answer), Linksys/Sipura phones, and a few various others. Any phone that is always set to auto-answer should also work (such as the console extension if configured).") ?></p> 
     67<p> 
     68<?php  
     69        echo _("This module is for specific phones that are capable of Paging or Intercom. This section is for configuring group paging, intercom is configured through <strong>Feature Codes</strong>. Intercom must be enabled on a handset before it will allow incoming calls. It is possible to restrict incoming intercom calls to specific extensions only, or to allow intercom calls from all extensions but explicitly deny from specific extensions.<br /><br />This module should work with Aastra, Grandstream, Linksys/Sipura, Mitel, Polycom, SNOM , and possibly other SIP phones (not ATAs). Any phone that is always set to auto-answer should also work (such as the console extension if configured).")  
     70?><br /><br /><?php 
     71        echo sprintf(_("Example usage:<br /><table><tr><td><strong>%snnn</strong>:</td><td>Intercom extension nnn</td></tr><tr><td><strong>%s</strong>:</td><td>Enable all extensions to intercom you (except those explicitly denied)</td></tr><tr><td><strong>%snnn</strong>:</td><td>Explicitly allow extension nnn to intercom you (even if others are disabled)</td></tr><tr><td><strong>%s</strong>:</td><td>Disable all extensions from intercoming you (except those explicitly allowed)</td></tr><tr><td><strong>%snnn</strong>:</td><td>Explicitly deny extension nnn to intercom you (even if generally enabled)</td></tr></table>"),$intercom_code,$oncode,$oncode,$offcode,$offcode); 
     72?> 
     73</p> 
    5874<?php 
    5975} 
     
    88104        <td><input size='5' type='text' name='pagenbr' value='<?php echo $xtn ?>'></td> 
    89105        </tr> 
    90         <tr><td valign='top'><a href='#' class='info'><?php echo _("extension list:")."<span><br>"._("Select extension(s)to page. If using users and devices mode, this will be the device number to page, potentially confusing if extension numbers and device numbers don't match. Use Ctrl key to select multiple..") ?>  
     106        <tr><td valign='top'><a href='#' class='info'><?php echo _("Device List:")."<span><br>"._("Select Device(s)to page. This is the phone that should be paged. In most installations, this is the same as the Extension. If you are configured to use \"Users & Devices\" this is the acutal Device and not the User. Use Ctrl key to select multiple..") ?>  
    91107        <br><br></span></a></td> 
    92108        <td valign="top">  
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads