You are here

function sms_incoming in SMS Framework 7

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

Handles incoming messages.

Allows gateways modules to pass messages in a standard format for processing. Every implementation of hook_sms_incoming() will be invoked by this method.

Additionally, 'sms_incoming' rules event will be invoked if rules module is enabled.

Parameters

string $number: The sender's mobile number.

string $message: The content of the text message.

array $options: An array of additional options.

5 calls to sms_incoming()
SmsActionWebTest::testSmsActionsActionsIntegration in modules/sms_actions/sms_actions.test
Tests integration with the actions module.
SmsActionWebTest::testSmsActionsTriggersIntegration in modules/sms_actions/sms_actions.test
Tests integration with the trigger module.
sms_devel_receive_form_submit in modules/sms_devel/sms_devel.send_form.inc
Submit handler for Receive Message button on sms_devel test send form.
sms_devel_virtualgw_receiver in modules/sms_devel/sms_devel.virtualgw.inc
Handles incoming messages.
sms_incoming_queue_worker in ./sms.module
Queue worker callback for queued incoming messages.
4 string references to 'sms_incoming'
SmsContainsKeywordConditionTestCase::testSmsContainsKeywordCondition in tests/sms.rules.test
Tests whether the sms rules condition for sms contains keyword works as it is supposed to.
SmsUserRulesWebTestCase::testOptOutViaSmsAction in modules/sms_user/tests/sms_user.rules.test
Tests whether the opt out and opt in via sms rules actions work as they are supposed to.
sms_bootstrap_admin in ./sms.admin.inc
Form callback. Overview of any bootstrap options.
sms_bootstrap_load_queue in bootstrap/sms_incoming.inc
Load and return the appropriate queue.

File

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

Code

function sms_incoming($number, $message, $options = array()) {
  if (module_exists('rules')) {
    $options += array(
      'number' => $number,
      'message' => $message,
    );
    rules_invoke_event('sms_incoming', $options);
  }

  // Execute three phases
  module_invoke_all('sms_incoming', 'pre process', $number, $message, $options);
  module_invoke_all('sms_incoming', 'process', $number, $message, $options);
  module_invoke_all('sms_incoming', 'post process', $number, $message, $options);
}