You are here

function twilio_sms_incoming in Twilio 7

Invokes twilio_sms_incoming hook.

Parameters

string $number: The sender's mobile number.

string $number_twilio: The twilio recipient number.

string $message: The content of the text message.

string $media: The absolute media url for a media file attatched to the message.

1 call to twilio_sms_incoming()
twilio_receive_message in ./twilio.module
Callback for incoming messages.

File

./twilio.module, line 328
Twilio module

Code

function twilio_sms_incoming($number, $number_twilio, $message, $media = array(), $options = array()) {

  // Build our SMS array to be used by our hook and rules event.
  $sms = array(
    'number' => $number,
    'number_twilio' => $number_twilio,
    'message' => $message,
    'media' => $media,
  );

  // Invoke a hook for the incoming message so other modules can do things.
  module_invoke_all('twilio_sms_incoming', $sms, $options);
  if (module_exists('rules')) {
    rules_invoke_event('twilio_sms_incoming', $sms);
  }
}