本文整理匯總了PHP中OpenVBX::addVoiceMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP OpenVBX::addVoiceMessage方法的具體用法?PHP OpenVBX::addVoiceMessage怎麽用?PHP OpenVBX::addVoiceMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenVBX
的用法示例。
在下文中一共展示了OpenVBX::addVoiceMessage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Say
} else {
if ($no_answer_action === 'voicemail') {
$response->append(AudioSpeechPickerWidget::getVerbForValue($voicemail, new Say("Please leave a message.")));
$response->addRecord(array('transcribe' => true, 'transcribeCallback' => site_url('twiml/transcribe')));
$state[DIAL_ACTION] = DIAL_STATE_RECORDING;
} else {
if ($no_answer_action === 'redirect') {
if (empty($no_answer_redirect)) {
$response->addHangup();
}
$response->addRedirect($no_answer_redirect);
} else {
if ($no_answer_action === 'hangup') {
$response->addHangup();
} else {
trigger_error("Unexpected no_answer_action");
}
}
}
}
break;
case DIAL_STATE_RECORDING:
if (isset($_REQUEST['testing'])) {
break;
}
OpenVBX::addVoiceMessage($dial_whom_user_or_group, $_REQUEST['CallGuid'], $_REQUEST['Caller'], $_REQUEST['Called'], $_REQUEST['RecordingUrl'], $_REQUEST['Duration']);
break;
}
}
setcookie(DIAL_COOKIE, json_encode($state), time() + 5 * 60);
$response->Respond();
示例2: add_voice_message
/**
* Handle callback after someone leaves a message
*
* @return void
*/
public function add_voice_message()
{
OpenVBX::addVoiceMessage($this->dial_whom_user_or_group, $_REQUEST['CallSid'], $_REQUEST['From'], $_REQUEST['To'], $_REQUEST['RecordingUrl'], $_REQUEST['RecordingDuration']);
$this->response->say('Your message has been recorded. Goodbye.');
$this->hangup();
}
示例3: add_voice_message
/**
* Handle callback after someone leaves a message
*
* @return void
*/
public function add_voice_message()
{
OpenVBX::addVoiceMessage($this->dial_whom_user_or_group, $_REQUEST['CallSid'], $_REQUEST['From'], $_REQUEST['To'], $_REQUEST['RecordingUrl'], $_REQUEST['RecordingDuration']);
}
示例4: error_log
if (curl_errno($ch)) {
error_log('CURL failed due to ' . curl_error());
return FALSE;
} else {
if ($ch_info['http_code'] >= 200 && $ch_info['http_code'] < 300) {
return TRUE;
}
}
return FALSE;
}
// }}}
$response = new Response();
// start a new Twiml response
if ($status == 'save-call' && @$_REQUEST['RecordingUrl']) {
// add a voice message
OpenVBX::addVoiceMessage(AppletInstance::getUserGroupPickerValue('permissions'), $_REQUEST['CallSid'], $_REQUEST['Caller'], $_REQUEST['Called'], $_REQUEST['RecordingUrl'], $_REQUEST['Duration']);
} else {
if ($status == 'transcribe-call') {
$zendesk_user = $CI->db->get_where('plugin_store', array('key' => 'zendesk_user'))->row();
$zendesk_user = json_decode($zendesk_user->value);
define('ZENDESK_URL', $zendesk_user->url);
define('ZENDESK_EMAIL', $zendesk_user->email);
define('ZENDESK_PASSWORD', $zendesk_user->password);
define('ZENDESK_TIMEZONE', (int) $zendesk_user->timezone);
// create a ticket to zendesk
$xml = '<ticket>' . '<subject>Phone Call from ' . format_phone($_REQUEST['Caller']) . ' on ' . gmdate('M d g:i a', gmmktime() + ZENDESK_TIMEZONE * 60 * 60) . '</subject>' . '<description>' . $_REQUEST['TranscriptionText'] . "\n" . 'Recording: ' . $_REQUEST['RecordingUrl'] . '</description>' . '</ticket>';
$new_ticket = zendesk_client('/tickets.xml', 'POST', $xml);
$params = http_build_query($_REQUEST);
$redirect_url = site_url('twiml/transcribe') . '?' . $params;
header("Location: {$redirect_url}");
} else {
示例5: get_instance
<?php
$CI =& get_instance();
$transcribe = (bool) $CI->vbx_settings->get('transcriptions', $CI->tenant->id);
$response = new TwimlResponse();
// start a new Twiml response
if (!empty($_REQUEST['RecordingUrl'])) {
// add a voice message
OpenVBX::addVoiceMessage(AppletInstance::getUserGroupPickerValue('permissions'), $CI->input->get_post('CallSid'), $CI->input->get_post('From'), $CI->input->get_post('To'), $CI->input->get_post('RecordingUrl'), $CI->input->get_post('RecordingDuration'), $transcribe == false);
} else {
$permissions = AppletInstance::getUserGroupPickerValue('permissions');
// get the prompt that the user configured
$isUser = $permissions instanceof VBX_User ? true : false;
if ($isUser) {
$prompt = $permissions->voicemail;
} else {
$prompt = AppletInstance::getAudioSpeechPickerValue('prompt');
}
if (!AudioSpeechPickerWidget::setVerbForValue($prompt, $response)) {
// fallback to default voicemail message
$response->say('Please leave a message. Press the pound key when you are finished.', array('voice' => $CI->vbx_settings->get('voice', $CI->tenant->id), 'language' => $CI->vbx_settings->get('voice_language', $CI->tenant->id)));
}
// add a <Record>, and use VBX's default transcription handler
$record_params = array('transcribe' => 'false');
if ($transcribe) {
$record_params['transcribe'] = 'true';
$record_params['transcribeCallback'] = site_url('/twiml/transcribe');
}
$response->record($record_params);
}
$response->respond();