'smsgateway_newmessage' hook
| Project: | SMS Gateway |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi and thanks for this great module. I would like to create an add on module using your smsgateway system.
What I would like it to do is, lets say you sms the words “node123” to your Drupal site, your site will respond with a reply message to the sender with the body text in node123.
In the 'smsgateway_newmessage' hook for the incoming message.
following fields:
'account_id' the ID of the account that the message was received on
'sender_number' the telephone number of the message sender
'destination_number' this must be the same number as the 'sender_number' so that the sender can receive a reply
'timestamp' the timestamp placed on the message
'charset' optional character set information for the message body
'header' any additional header information
'body' the body of the message - the message text from the sender here will contain the text “node123”
Now this module must get 123 [nid] from the message 'body'
Run the following query
$result = mysql_query("SELECT body FROM node_revisions WHERE nid = $nid");
call the 'smsgateway_sendmessage' function, with the
destination telephone number and the message body text of node123.
The node body text can be limited to 160 characters using the maximumlength.module
This module will fit in perfect with the eCommerce module. Here is a practical use. Let say you create a product node. The node ID is 123 (node/123) The body field is limited to 130 characters (MaximumLenth.module)
Now if I send an SMS message to 12345678 containing the words "pc123" I will get a response message e.g. "HP1356-Laptop. Price $100 to add this product to your cart follow the wap link http://www.example.mobi/pc123"
This wap link can contain pictures and more info and the user can go to the shopping cart to add the product and make payment.
I am not a PHP expert and don’t know much about writing or using hook functions. Please help me setup this feature. I have more ideas to add on to this module, but just the basic would be great.

#1
I would also make a donation or sponsor this module to get it started, not to much though, our currency exchange is very bad against the dollar, so $100 is like 2 weeks salary in South Africa. I can also contribute in some more simple ideas to add to this module. Thanks Paul