You are here

function sms_devel_virtualgw_receiver in SMS Framework 6

Same name and namespace in other branches
  1. 6.2 modules/sms_devel/sms_devel.virtualgw.inc \sms_devel_virtualgw_receiver()
  2. 7 modules/sms_devel/sms_devel.virtualgw.inc \sms_devel_virtualgw_receiver()
2 calls to sms_devel_virtualgw_receiver()
sms_devel_virtualgw_ahah_send in modules/sms_devel/sms_devel.virtualgw.inc
sms_devel_virtualgw_sendlogic in modules/sms_devel/sms_devel.virtualgw.inc

File

modules/sms_devel/sms_devel.virtualgw.inc, line 65
Virtual Gateway for the sms_devel module of the SMS Framework.

Code

function sms_devel_virtualgw_receiver($number = NULL, $message = NULL, $options = array()) {

  // Handle HTTP requests rather than direct function calls
  if ($number == NULL) {
    $number = $_REQUEST['number'];
    $message = array_key_exists('message', $_REQUEST) ? $_REQUEST['message'] : 'NO_MESSAGE';
    $options['gw_number'] = array_key_exists('gw_number', $_REQUEST) ? $_REQUEST['gw_number'] : 'NO_GW_NUMBER';
    $options['reference'] = array_key_exists('reference', $_REQUEST) ? $_REQUEST['reference'] : 'NO_REFERENCE';
  }

  // Write log record for incoming message
  sms_devel_virtualgw_log_insert(SMS_DEVEL_VIRTUALGW_TYPE_IN, $number, $message, $options);

  // Call SMS Framework incoming message handler
  sms_incoming($number, $message, $options);
}