You are here

function sms_clickatell_map_response_code in SMS Framework 6

Map a Clickatell gateway response status code to an SMS Framework gateway status code

Return value

SMS Framework gateway status code. See sms constants.

1 call to sms_clickatell_map_response_code()
sms_clickatell_command in modules/sms_clickatell/sms_clickatell.module
Executes a command using the Clickatell API

File

modules/sms_clickatell/sms_clickatell.module, line 514
Clickatell gateway module for Drupal SMS Framework. Outbound+Inbound+Receipts

Code

function sms_clickatell_map_response_code($code) {
  switch ($code) {
    case '001':
    case '002':
    case '003':
    case '004':
    case '005':
    case '007':
      return SMS_GW_ERR_AUTH;
    case '101':
    case '102':
    case '105':
    case '106':
    case '107':
    case '108':
    case '109':
    case '111':
    case '112':
    case '116':
    case '120':
    case '123':
    case '201':
    case '202':
      return SMS_GW_ERR_INVALID_CALL;
    case '103':
    case '104':
      return SMS_GW_ERR_NOT_FOUND;
    case '113':
      return SMS_GW_ERR_MSG_LIMITS;
    case '114':
      return SMS_GW_ERR_MSG_ROUTING;
    case '110':
      return SMS_GW_ERR_MSG_OTHER;
    case '115':
      return SMS_GW_ERR_MSG_QUEUING;
    case '121':
    case '122':
    case '128':
      return SMS_GW_ERR_DEST_NUMBER;
    case '301':
    case '302':
      return SMS_GW_ERR_CREDIT;
    default:
      return SMS_GW_ERR_OTHER;
  }
}