当前位置: 首页>>代码示例>>PHP>>正文


PHP fs::getNumberOptions方法代码示例

本文整理汇总了PHP中fs::getNumberOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::getNumberOptions方法的具体用法?PHP fs::getNumberOptions怎么用?PHP fs::getNumberOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fs的用法示例。


在下文中一共展示了fs::getNumberOptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dialplan

 public static function dialplan($number)
 {
     $xml = Telephony::getDriver()->xml;
     $destination = $number['Destination'];
     if ($destination instanceof ExternalXfer) {
         $numberOptions = fs::getNumberOptions($number);
         switch ($destination['route_type']) {
             case ExternalXfer::TYPE_SIP:
                 if (empty($destination['route_details']['interface']) or empty($destination['route_details']['sipuri'])) {
                 }
                 $dialstring = 'sofia/sipinterface_' . $destination['route_details']['interface'] . '/' . $destination['route_details']['sipuri'];
                 break;
             case ExternalXfer::TYPE_TRUNK:
                 if (empty($destination['route_details']['trunk']) or empty($destination['route_details']['number'])) {
                 }
                 $dialstring = 'sofia/gateway/trunk_' . $destination['route_details']['trunk'] . '/' . $destination['route_details']['number'];
                 break;
         }
         $dialstring = str_replace(array('/', '@'), array('\\/', '\\@'), $dialstring);
         if (empty($dialstring)) {
             return;
         }
         $xml->update('/action[@application="set"][@bluebox="settingTimeout"]{@data="call_timeout=' . $numberOptions['timeout'] . '"}');
         $xml->update('/action[@application="set"][@bluebox="settingRing"]{@data="ringback=' . $numberOptions['ringtype'] . '"}');
         $xml->update('/action[@application="set"][@bluebox="settingRingXfer"]{@data="transfer_ringback=' . $numberOptions['ringtype'] . '"}');
         if (!empty($destination['plugins']['callerid']['internal_name'])) {
             $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['plugins']['callerid']['internal_name'] . '"}');
         } else {
             $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['name'] . '"}');
         }
         $xml->update('/action[@application="export"][@bluebox="sipCalleeIdNumber"]{@data="sip_callee_id_number=' . $number['number'] . '"}');
         $options = array();
         if (arr::get($destination, 'registry', 'ignore_early_media')) {
             $options[] = 'ignore_early_media=true';
         }
         if (arr::get($destination, 'registry', 'require_confirmation')) {
             $options[] = 'group_confirm_file=ivr\\/ivr-accept_reject_voicemail.wav,group_confirm_key=1,leg_timeout=' . arr::get($destination, 'registry', 'require_confirmation_timeout');
         }
         if (count($options) > 0) {
             $options = '{' . implode(',', $options) . '}';
         } else {
             $options = '';
         }
         if (($type = arr::get($destination, 'plugins', 'activefeaturecode', 'type')) && arr::get($destination, 'plugins', 'activefeaturecode', 'type') != '0') {
             switch ($type) {
                 case 'transfer':
                     $fc = arr::get($destination, 'plugins', 'activefeaturecode', 'number');
                     $ext = arr::get($destination, 'plugins', 'activefeaturecode', 'exten');
                     $transfer = fs::getTransferToNumber($ext);
                     $leg = arr::get($destination, 'plugins', 'activefeaturecode', 'leg');
                     $xml->update('/action[@application="set"][@bluebox="afc_app"]{@data="bridge_pre_execute_' . $leg . 'leg_app=bind_digit_action"}');
                     $xml->update('/action[@application="set"][@bluebox="afc_data"]{@data="bridge_pre_execute_' . $leg . 'leg_data=transfer_back,' . $fc . ',exec:transfer,-bleg ' . $transfer . '"}');
                     break;
                 default:
                     break;
             }
         }
         $xml->update('/action[@application="bridge"]{@data="' . $options . $dialstring . '"}');
     }
 }
开发者ID:swk,项目名称:bluebox,代码行数:60,代码来源:externalxfer.php

示例2: dialplan

 public static function dialplan($number)
 {
     $xml = Telephony::getDriver()->xml;
     $destination = $number['Destination'];
     if ($destination instanceof Device) {
         $domain = '$${location_' . $destination['User']['location_id'] . '}';
         $numberOptions = fs::getNumberOptions($number);
         $xml->update('/action[@application="set"][@bluebox="settingTimeout"]{@data="call_timeout=' . $numberOptions['timeout'] . '"}');
         $xml->update('/action[@application="set"][@bluebox="settingRing"]{@data="ringback=' . $numberOptions['ringtype'] . '"}');
         $xml->update('/action[@application="set"][@bluebox="settingRingXfer"]{@data="transfer_ringback=' . $numberOptions['ringtype'] . '"}');
         if (!empty($destination['plugins']['callerid']['internal_name'])) {
             $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['plugins']['callerid']['internal_name'] . '"}');
         } else {
             $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['name'] . '"}');
         }
         $xml->update('/action[@application="export"][@bluebox="sipCalleeIdNumber"]{@data="sip_callee_id_number=' . $number['number'] . '"}');
         $xml->update('/action[@application="bridge"]{@data="user\\/' . $destination['plugins']['sip']['username'] . '@' . $domain . '"}');
     }
 }
开发者ID:swk,项目名称:bluebox,代码行数:19,代码来源:device.php

示例3: dialplan

 public static function dialplan($number)
 {
     $xml = Telephony::getDriver()->xml;
     $destination = $number['Destination'];
     if ($destination instanceof Device) {
         $domain = '$${location_' . $destination['User']['location_id'] . '}';
         $numberOptions = fs::getNumberOptions($number);
         $xml->update('/action[@application="set"][@bluebox="settingTimeout"]{@data="call_timeout=' . $numberOptions['timeout'] . '"}');
         $xml->update('/action[@application="set"][@bluebox="settingRing"]{@data="ringback=' . $numberOptions['ringtype'] . '"}');
         $xml->update('/action[@application="set"][@bluebox="settingRingXfer"]{@data="transfer_ringback=' . $numberOptions['ringtype'] . '"}');
         if (!empty($destination['plugins']['callerid']['internal_name'])) {
             $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['plugins']['callerid']['internal_name'] . '"}');
         } else {
             $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['name'] . '"}');
         }
         $xml->update('/action[@application="export"][@bluebox="sipCalleeIdNumber"]{@data="sip_callee_id_number=' . $number['number'] . '"}');
         if (arr::get($destination, 'plugins', 'sip', 'sip_invite_format') == Sip_Plugin::SIP_FORMAT_DIGITS) {
             $xml->update('/action[@application="export"][@bluebox="settingXmlInviteFormat"]{@data="sip_invite_req_uri=sip:' . $number['number'] . '${regex(${sofia_contact(' . $destination['plugins']['sip']['username'] . '\\@' . $domain . ')}|(\\@.*)|$1)}"}');
         } else {
             $xml->deleteNode('/action[@application="export"][@bluebox="settingXmlInviteFormat"]');
         }
         $condition = '/condition[@field="${privacy_hide_number}"][@expression="false"][@break="never"]';
         $extenRoot = $xml->getExtensionRoot();
         //If allowing multi sip interfaces, then we need to change the @data field with sofia_contact.
         $dataString = 'user\\/' . $destination['plugins']['sip']['username'] . '@' . $domain;
         if (arr::get($destination, 'registry', 'multi_sipinterface')) {
             $dataString = '${sofia_contact(*\\/' . $destination['plugins']['sip']['username'] . '@' . $domain . ')}';
         }
         if (arr::get($destination, 'registry', 'anonymous_reject')) {
             $xml->setXmlRoot($extenRoot . $condition);
             //$xml->update('/action[@application="bridge"]{@data="user\/' .$destination['plugins']['sip']['username'] .'@' .$domain .'"}');
             $xml->update('/action[@application="bridge"]{@data="' . $dataString . '"}');
             $xml->setXmlRoot($extenRoot . '/condition[@bluebox="no_answer"]');
         } else {
             //$xml->update('/action[@application="bridge"]{@data="user\/' .$destination['plugins']['sip']['username'] .'@' .$domain .'"}');
             $xml->update('/action[@application="bridge"]{@data="' . $dataString . '"}');
             $xml->deleteNode($extenRoot . $condition);
             $xml->deleteNode($extenRoot . '/condition[@bluebox="no_answer"]');
         }
     }
 }
开发者ID:swk,项目名称:bluebox,代码行数:41,代码来源:device.php

示例4: dialplan

 public static function dialplan($number)
 {
     $xml = Telephony::getDriver()->xml;
     $destination = $number['Destination'];
     switch ($destination['strategy']) {
         case RingGroup::STRATEGY_SEQUENTIAL:
             $memberSeperator = '|';
             break;
         case RingGroup::STRATEGY_ENTERPRISE:
             $memberSeperator = ':_:';
             break;
         case RingGroup::STRATEGY_PARALLEL:
         default:
             $memberSeperator = ',';
     }
     $numberOptions = fs::getNumberOptions($number);
     $xml->update('/action[@application="set"][@bluebox="settingTimeout"]{@data="call_timeout=' . $numberOptions['timeout'] . '"}');
     $xml->update('/action[@application="set"][@bluebox="settingRing"]{@data="ringback=' . $numberOptions['ringtype'] . '"}');
     $xml->update('/action[@application="set"][@bluebox="settingRingXfer"]{@data="transfer_ringback=' . $numberOptions['ringtype'] . '"}');
     $xml->update('/action[@application="export"][@bluebox="sipCalleeIdName"]{@data="sip_callee_id_name=' . $destination['name'] . '"}');
     $xml->update('/action[@application="export"][@bluebox="sipCalleeIdNumber"]{@data="sip_callee_id_number=' . $number['number'] . '"}');
     $xml->update('/action[@application="export"][@bluebox="settingContinueOnTimeout"]{@data="originate_continue_on_timeout=true"}');
     $dialstring = '';
     foreach ($destination['members'] as $member) {
         if (!empty($member['options']) or !empty($numberOptions['timeout'])) {
             $dialstring .= '[';
             foreach ($member['options'] as $parameter => $value) {
                 $dialstring .= $parameter . '=' . $value . ',';
             }
             if (!empty($numberOptions['timeout'])) {
                 $dialstring .= 'leg_timeout=' . $numberOptions['timeout'];
             }
             $dialstring = rtrim($dialstring, ',') . ']';
         }
         $dialstring .= $member['bridge'] . $memberSeperator;
     }
     $dialstring = substr($dialstring, 0, strlen($memberSeperator) * -1);
     $dialstring = str_replace('/', '\\/', $dialstring);
     $dialstring = str_replace('@', '\\@', $dialstring);
     $xml->update('/action[@application="bridge"]{@data="' . $dialstring . '"}');
 }
开发者ID:swk,项目名称:bluebox,代码行数:41,代码来源:ringgroup.php


注:本文中的fs::getNumberOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。