public static function urlGet() { if (!CVoxImplantMain::CheckAccess()) { throw new \Bitrix\Rest\AccessException(); } return array('detail_statistics' => CVoxImplantHttp::GetServerAddress() . '/settings/telephony/detail.php', 'buy_connector' => CVoxImplantHttp::GetServerAddress() . '/settings/license_phone_sip.php', 'edit_config' => CVoxImplantHttp::GetServerAddress() . '/settings/telephony/edit.php?ID=#CONFIG_ID#'); }
public static function GetLinkConfig() { $portalUrl = ''; if (CVoxImplantHttp::GetPortalType() == CVoxImplantHttp::TYPE_BITRIX24) { $portalUrl = CVoxImplantHttp::GetServerAddress() . '/settings/info_receiver.php?b24_action=phone&b24_direct=y'; } else { $portalUrl = CVoxImplantHttp::GetServerAddress() . '/services/telephony/info_receiver.php?b24_direct=y'; } return array('PORTAL_MODE' => 'LINK', 'PORTAL_URL' => $portalUrl, 'PORTAL_SIGN' => CVoxImplantHttp::GetPortalSign(), 'SEARCH_ID' => CVoxImplantPhone::GetLinkNumber(), 'PHONE_NAME' => CVoxImplantPhone::GetLinkNumber(), 'RECORDING' => CVoxImplantConfig::GetLinkCallRecord() ? 'Y' : 'N', 'CRM' => CVoxImplantConfig::GetLinkCheckCrm() ? 'Y' : 'N', 'MELODY_HOLD' => CVoxImplantConfig::GetMelody('MELODY_HOLD')); }
public static function GetConfigBySearchId($searchId) { if (strlen($searchId) <= 0) { return array('ERROR' => 'Config is`t found for undefined number'); } $orm = VI\ConfigTable::getList(array('filter' => array('=SEARCH_ID' => (string) $searchId))); $config = $orm->fetch(); if (!$config) { $result = array('ERROR' => 'Config is`t found for number: ' . $searchId); } else { $result = $config; $result['PHONE_TITLE'] = $result['PHONE_NAME']; if ($result['PORTAL_MODE'] == self::MODE_SIP) { $viSip = new CVoxImplantSip(); $sipResult = $viSip->Get($config["ID"]); $result['PHONE_NAME'] = preg_replace("/[^0-9\\#\\*]/i", "", $result['PHONE_NAME']); $result['PHONE_NAME'] = strlen($result['PHONE_NAME']) >= 4 ? $result['PHONE_NAME'] : ''; $result['SIP_SERVER'] = $sipResult ? $sipResult['SERVER'] : ''; $result['SIP_LOGIN'] = $sipResult ? $sipResult['LOGIN'] : ''; $result['SIP_PASSWORD'] = $sipResult ? $sipResult['PASSWORD'] : ''; } if (strlen($result['FORWARD_NUMBER']) > 0) { $result["FORWARD_NUMBER"] = NormalizePhone($result['FORWARD_NUMBER'], 1); } if (strlen($result['WORKTIME_DAYOFF_NUMBER']) > 0) { $result["WORKTIME_DAYOFF_NUMBER"] = NormalizePhone($result['WORKTIME_DAYOFF_NUMBER'], 1); } // check work time $result['WORKTIME_SKIP_CALL'] = 'N'; if ($config['WORKTIME_ENABLE'] == 'Y') { $timezone = !empty($config["WORKTIME_TIMEZONE"]) ? new DateTimeZone($config["WORKTIME_TIMEZONE"]) : null; $numberDate = new Bitrix\Main\Type\DateTime(null, null, $timezone); if (!empty($config['WORKTIME_DAYOFF'])) { $daysOff = explode(",", $config['WORKTIME_DAYOFF']); $allWeekDays = array('MO' => 1, 'TU' => 2, 'WE' => 3, 'TH' => 4, 'FR' => 5, 'SA' => 6, 'SU' => 7); $currentWeekDay = $numberDate->format('N'); foreach ($daysOff as $day) { if ($currentWeekDay == $allWeekDays[$day]) { $result['WORKTIME_SKIP_CALL'] = "Y"; } } } if ($result['WORKTIME_SKIP_CALL'] !== "Y" && !empty($config['WORKTIME_HOLIDAYS'])) { $holidays = explode(",", $config['WORKTIME_HOLIDAYS']); $currentDay = $numberDate->format('d.m'); foreach ($holidays as $holiday) { if ($currentDay == $holiday) { $result['WORKTIME_SKIP_CALL'] = "Y"; } } } if ($result['WORKTIME_SKIP_CALL'] !== "Y" && !empty($config['WORKTIME_FROM']) && !empty($config['WORKTIME_TO'])) { $currentTime = $numberDate->format('G.i'); if (!($currentTime >= $config['WORKTIME_FROM'] && $currentTime <= $config['WORKTIME_TO'])) { $result['WORKTIME_SKIP_CALL'] = "Y"; } } if ($result['WORKTIME_SKIP_CALL'] === "Y") { $result['WORKTIME_DAYOFF_MELODY'] = CVoxImplantConfig::GetMelody('WORKTIME_DAYOFF_MELODY', $config['MELODY_LANG'], $config['WORKTIME_DAYOFF_MELODY']); } } if (CVoxImplantHttp::GetPortalType() == CVoxImplantHttp::TYPE_BITRIX24) { $result['PORTAL_URL'] = CVoxImplantHttp::GetServerAddress() . '/settings/info_receiver.php?b24_action=phone&b24_direct=y'; } else { $result['PORTAL_URL'] = CVoxImplantHttp::GetServerAddress() . '/services/telephony/info_receiver.php?b24_direct=y'; } $result['PORTAL_SIGN'] = CVoxImplantHttp::GetPortalSign(); $result['MELODY_WELCOME'] = CVoxImplantConfig::GetMelody('MELODY_WELCOME', $config['MELODY_LANG'], $config['MELODY_WELCOME']); $result['MELODY_VOICEMAIL'] = CVoxImplantConfig::GetMelody('MELODY_VOICEMAIL', $config['MELODY_LANG'], $config['MELODY_VOICEMAIL']); $result['MELODY_HOLD'] = CVoxImplantConfig::GetMelody('MELODY_HOLD', $config['MELODY_LANG'], $config['MELODY_HOLD']); $result['MELODY_WAIT'] = CVoxImplantConfig::GetMelody('MELODY_WAIT', $config['MELODY_LANG'], $config['MELODY_WAIT']); } return $result; }
<td width="40%"><?php echo GetMessage("VI_ACCOUNT_BALANCE"); ?> :</td> <td width="60%"><b><?php echo $accountBalance; ?> </b></td> </tr> <tr> <td width="40%"><?php echo GetMessage("VI_ACCOUNT_URL"); ?> :</td> <td width="60%"><input type="text" name="PUBLIC_URL" value="<?php echo htmlspecialcharsbx(CVoxImplantHttp::GetServerAddress()); ?> " /></td> </tr> <tr> <td width="40%"><?php echo GetMessage("VI_ACCOUNT_DEBUG"); ?> :</td> <td width="60%"><input type="checkbox" name="DEBUG_MODE" value="Y" <?php echo COption::GetOptionInt("voximplant", "debug") ? 'checked' : ''; ?> /></td> </tr> <?php if (!IsModuleInstalled('bitrix24')) {