You are here

function sms_handle_result in SMS Framework 6.2

Same name and namespace in other branches
  1. 5 sms.module \sms_handle_result()
  2. 6 sms.module \sms_handle_result()
  3. 7 sms.module \sms_handle_result()

Handle the response back from the sms gateway.

1 call to sms_handle_result()
sms_send in ./sms.module
Sends a message using the active gateway.

File

./sms.module, line 187
The core of the SMS Framework. Provides gateway managment and API for sending and receiving SMS messages.

Code

function sms_handle_result($result, $number, $message) {
  if ($result['status']) {
    return TRUE;
  }
  else {
    $error_message = 'Sending SMS to %number failed.';
    $variables['%number'] = $number;
    if ($result['message']) {
      $error_message .= ' The gateway said ' . $result['message'];
      if (!empty($result['variables'])) {
        $variables = array_merge($variables, $result['variables']);
      }
    }
    watchdog('sms', $error_message, $variables, WATCHDOG_ERROR);
    return FALSE;
  }
}