Thanks to all involved for their recent hard work on this module - it's coming together really well!
I am, however, having a hard time tracing problems with incoming messages.
I have notifications/messaging versions 6.x-2.3 and sms framework working well together on the outbound and can correctly trigger inbound messages using 6.x-2.3 using something like: sms_incoming('1234567890', 'test test 32'); from devel php block.
When I use the devel block I can see entries in the watchdog depending upon whether or not the SMS user is authorised (I've added the line below into sms_user.module to ease tracing:
function sms_user_authenticate($number) {
global $user;
$uid = sms_user_get_uid($number);
if ($account = user_load(array('uid' => $uid, 'status' => 1))) {
$user = $account;
watchdog('sms', t('%name was authenticated using SMS.', array('%name' => $user->name)),WATCHDOG_WARNING);
return $user;
} else {
watchdog('sms', t('@number was NOT authenticated using SMS.', array('@number' => $number)),WATCHDOG_WARNING);
}
}
I'm using the txtlocal gateway and problems occur when I send SMSs in via the gateway as I receive no reaction at all that anything has happened on the site - using my code above I would expect a watchdog entry triggered by sms_user whether or not the number was recognised. I have checked the apache logs and am getting the following entry when txtlocal forwards an SMS into the site via HTTP:
"POST /sms/txtlocal/receiver HTTP/1.1" 302 - "-" "-"
Any help on how to track this one further would be really appreciated.
Cheers for now,
Crom
Comments
Comment #1
Crom commentedthe 302 code seems strange...isn't that for redirections?
Comment #2
Crom commentedHmmm, this gets weirder. I've traced the POST entries for the incoming sms messages and they are definitely being received.
Using the .htaccess file, I added this line to the top (changing the dir names as required): php_value auto_prepend_file /home/user/postlog/postlog.php
And I successfully logged a message being received and a receipt, as follows:
Thu, 16 Dec 2010 12:42:48 +0000 /sms/txtlocal/receiver
a:14:{s:6:"sender";s:12:"---mob num hidden---";s:7:"content";s:34:"---msg hidden---";s:8:"inNumber";s:12:"---mob num hidden--";s:6:"submit";s:6:"Submit";s:7:"network";s:7:"UNKNOWN";s:5:"email";s:4:"none";s:7:"keyword";s:11:"--hidden--";s:8:"comments";s:22:"---hidden---";s:7:"credits";s:3:"502";s:9:"firstname";s:0:"";s:8:"lastname";s:0:"";s:7:"custom1";s:0:"";s:7:"custom2";s:0:"";s:7:"custom3";s:0:"";}
Thu, 16 Dec 2010 12:43:02 +0000 /sms/txtlocal/receipt
a:4:{s:6:"number";s:12:"---mob num hidden---";s:6:"status";s:1:"D";s:6:"submit";s:6:"Submit";s:8:"customID";s:32:"--hidden--";}
However, the site does not appear to be responding in any way that I'd expect (ie either accept or reject the username via the mob number - and this would show up within the watchdog).
I'll continue to work through this but if anyone's got any ideas as to what I can try...it'd be great.
Cheers,
Crom
Comment #3
Crom commentedOK, I have tracked this back as far as the txtlocal module.
If I trigger the txtlocal module by typing the address directly into the browser
/sms/txtlocal/receiver
then I can trigger a watchdog entry to correctly create an entry. I also get logged out, which is the correct response as the site does not receive a validated number.
However, when I send a txt to the site there is no watchdog entry. This indicates to me that sms_txtlocal_receive_message() is not being called for some reason.
...I'm completely stuck with this and could really do with some help.
Thanks,
Crom
Comment #4
univate commentedI have moved the sms_txtlocal module out to its own project.
Comment #5
Crom commentedAfter another week of trying on and off to solve this I have given up. I'd be interested to hear if anyone has similar problems or suggested routes for further testing/bugfixing.
I have applied to clickatell for a test account (their free account allows a number of free outgoing messages but not for incoming). If anyone is interested in testing incoming messages then contact them by email and they will set up a 2 week test account with incoming messages. Having said that, I have completed the application form but heard nothing from them over Xmas so can only assume that they're on hols. I'll report back in case others are interested).
If I can solve the Txt local problem then I will probably know enough about the module to apply to lend a hand as a co-maintainer ;-)
Happy New Year all,
Crom