This commit is contained in:
Daniel Camargo 2013-04-03 13:52:54 -03:00
parent 92daa4b126
commit 3bebc294c1
5 changed files with 17 additions and 17 deletions

View File

@ -44,7 +44,7 @@ class Controller_api_order extends Crunchbutton_Controller_Rest {
Log::debug([
'order' => $order->id_order,
'action' => '/sayorder (accepted)',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
@ -95,7 +95,7 @@ class Controller_api_order extends Crunchbutton_Controller_Rest {
Log::debug([
'order' => $order->id_order,
'action' => '/sayorderonly: 2: CONFIRMED',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
echo '<Gather action="/api/order/'.$order->id_order.'/sayorderonly?id_notification='.$_REQUEST['id_notification'].'" numDigits="1" timeout="10" finishOnKey="#" method="get">';
@ -139,7 +139,7 @@ class Controller_api_order extends Crunchbutton_Controller_Rest {
Log::debug([
'order' => $order->id_order,
'action' => '/doconfirm: 1: CONFIRMED',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
echo '<Gather action="/api/order/'.$order->id_order.'/sayorderonly?id_notification='.$_REQUEST['id_notification'].'" numDigits="1" timeout="10" finishOnKey="#" method="get">';
@ -158,7 +158,7 @@ class Controller_api_order extends Crunchbutton_Controller_Rest {
Log::debug([
'order' => $order->id_order,
'action' => 'RESEND',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);

View File

@ -82,7 +82,7 @@ class Crunchbutton_Notification extends Cana_Table
'order' => $order->id_order,
'action' => 'send order call',
'num' => $num,
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'callback' => $callback,
'type' => 'notification'
]);
@ -98,9 +98,9 @@ class Crunchbutton_Notification extends Cana_Table
$call = $twilio->account->calls->create(
c::config()->twilio->{$env}->outgoingRestaurant,
'+1'.$num,
'http://'.$_SERVER['HTTP_HOST'].'/api/order/'.$order->id_order.'/say?id_notification='.$this->id_notification,
'http://'.$_SERVER['__HTTP_HOST'].'/api/order/'.$order->id_order.'/say?id_notification='.$this->id_notification,
[
'StatusCallback' => 'http://'.$_SERVER['HTTP_HOST'].'/api/notification/'.$log->id_notification_log.'/callback'
'StatusCallback' => 'http://'.$_SERVER['__HTTP_HOST'].'/api/notification/'.$log->id_notification_log.'/callback'
// 'IfMachine' => 'Hangup'
]
);

View File

@ -34,7 +34,7 @@ class Crunchbutton_Notification_Log extends Cana_Table {
'customer_phone' => $this->order()->phone,
'customer_name' => $this->order()->name,
'action' => '#'.$this->id_order.' MAX CB for '.$this->order()->restaurant()->name."\nR# ".$this->order()->restaurant()->phone()."\n C# ".$this->order()->phone(),
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
@ -74,7 +74,7 @@ class Crunchbutton_Notification_Log extends Cana_Table {
'customer_phone' => $this->order()->phone,
'customer_name' => $this->order()->name,
'action' => '#'.$this->id_order.' MAX CONFIRM CB for '.$this->order()->restaurant()->name."\nR# ".$this->order()->restaurant()->phone()."\nC# ".$this->order()->phone(),
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
} else {

View File

@ -508,7 +508,7 @@ class Crunchbutton_Order extends Cana_Table {
'order' => $this->id_order,
'confirmed' =>$this->confirmed,
'action' => 'check confirmed',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
@ -518,7 +518,7 @@ class Crunchbutton_Order extends Cana_Table {
'order' => $this->id_order,
'count' => $nl->count(),
'action' => 'confirmation call already in process',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
return;
@ -527,7 +527,7 @@ class Crunchbutton_Order extends Cana_Table {
'order' => $this->id_order,
'count' => $nl->count(),
'action' => 'starting new confirmation call',
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'type' => 'notification'
]);
}
@ -544,16 +544,16 @@ class Crunchbutton_Order extends Cana_Table {
/*
$num = '_PHONE_';
$_SERVER['__HTTP_HOST'] = 'dev.crunchr.co';
$_SERVER['____HTTP_HOST'] = 'dev.crunchr.co';
*/
$callback = 'http://'.$_SERVER['HTTP_HOST'].'/api/notification/'.$log->id_notification_log.'/confirm';
$callback = 'http://'.$_SERVER['__HTTP_HOST'].'/api/notification/'.$log->id_notification_log.'/confirm';
Log::debug([
'order' => $this->id_order,
'action' => 'dial confirm call',
'num' => $num,
'host' => $_SERVER['HTTP_HOST'],
'host' => $_SERVER['__HTTP_HOST'],
'callback' => $callback,
'type' => 'notification'
]);
@ -562,7 +562,7 @@ class Crunchbutton_Order extends Cana_Table {
$call = $twilio->account->calls->create(
c::config()->twilio->{$env}->outgoingRestaurant,
'+1'.$num,
'http://'.$_SERVER['HTTP_HOST'].'/api/order/'.$this->id_order.'/doconfirm',
'http://'.$_SERVER['__HTTP_HOST'].'/api/order/'.$this->id_order.'/doconfirm',
[
'StatusCallback' => $callback
// 'IfMachine' => 'Hangup'

View File

@ -8,7 +8,7 @@ class Crunchbutton_Phaxio {
.'-F "to='.$params['to'].'" '
.'-F "filename=@'.$params['file'].'" ';
if ($params['id_notification_log']) {
$cmd .= '-F "callback_url=http://'.$_SERVER['HTTP_HOST'].'/api/notification/'.$params['id_notification_log'].'/callback" ';
$cmd .= '-F "callback_url=http://'.$_SERVER['__HTTP_HOST'].'/api/notification/'.$params['id_notification_log'].'/callback" ';
}
$cmd .= '-F "api_key='.c::config()->phaxio->{$env}->key.'" '
.'-F "api_secret='.c::config()->phaxio->{$env}->secret.'"';