예제 #1
0
             if ($_POST['IM_CALL'] == 'Y') {
                 $errorMessage = "";
                 if ($_POST['COMMAND'] == 'invite') {
                     CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], array('video' => $_POST['VIDEO'] == 'Y'));
                 } else {
                     if ($_POST['COMMAND'] == 'signaling') {
                         CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], array('peer' => $_POST['PEER']));
                     } else {
                         CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND']);
                     }
                 }
                 echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage));
             } else {
                 if ($_POST['IM_START_WRITING'] == 'Y') {
                     $errorMessage = "";
                     CIMMessenger::StartWriting($_POST['RECIPIENT_ID']);
                     echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage));
                 } else {
                     if ($_POST['IM_DESKTOP_LOGOUT'] == 'Y') {
                         $errorMessage = "";
                         CIMMessenger::RemoveDesktopStatusOnline();
                         CIMContactList::SetOffline();
                         echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage));
                     } else {
                         echo CUtil::PhpToJsObject(array('ERROR' => 'UNKNOWN_ERROR'));
                     }
                 }
             }
         }
     }
 }
예제 #2
0
	{
		require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/voximplant/ajax_hit.php");
	}
	else if ($_POST['IM_IDLE'] == 'Y')
	{
		$errorMessage = "";
		CIMStatus::SetIdle($USER->GetId(), $_POST['IDLE'] == 'Y');

		echo CUtil::PhpToJsObject(Array(
			'ERROR' => $errorMessage
		));
	}
	else if ($_POST['IM_START_WRITING'] == 'Y')
	{
		$errorMessage = "";
		CIMMessenger::StartWriting($_POST['DIALOG_ID']);

		echo CUtil::PhpToJsObject(Array(
			'ERROR' => $errorMessage
		));
	}
	else if ($_POST['IM_DESKTOP_LOGOUT'] == 'Y')
	{
		$errorMessage = "";

		CIMMessenger::SetDesktopStatusOffline();
		CIMContactList::SetOffline();

		echo CUtil::PhpToJsObject(Array(
			'ERROR' => $errorMessage
		));