Closed (fixed)
Project:
SMS simple gateway
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
14 Aug 2017 at 19:09 UTC
Updated:
20 Nov 2017 at 05:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alansaviolobo commentedYour suggestion would make sense if this module catered to a specific gateway.
In that case, fields such as "Sender (from) field name", "Username field name" etc would not be required as those strings would be fixed.
But this is a generic module that caters to many gateways and hence those fields need to be configurable.
one gateway may prefer to use the term "username" while another might prefer "user" or even "authkey".
The other fields like "Username field value" & "Sender (from) field value" are provided by the gateway when you signup for an account.
Comment #3
joncup commentedWell, the way it is now, you are forced to fill out all of those fields, even an optional one in order to submit the form. You cant save it with out filling out the "extra parameters" field. Isn't that optional?
Comment #4
alansaviolobo commentedYou are correct. the extra parameters field should be optional. I have created a patch for the same.
I believe the other fields are ok.
Comment #5
joncup commentedCool, also thank you. I understand why the field names are required now. That's a big help.
Comment #6
alansaviolobo commentedSorry, I didn't understand 'inbound implemented'. are you referring to the ability to accept incoming sms ?
If so, yes, the capability is present, However, I don't have a gateway handy to test it.
Comment #7
joncup commentedAlso, just past line 242, it's still sending an extra & and the empty extra veriable when doing the request I think.
I will try to test incoming.
Comment #8
joncup commentedSo, over here around line 244, its this last bit of code "
. '&' . $this->configuration['extra_params']". I had to remove it to get it to work, because of the undefined exta_params. I'm not sure how, but I think that last bit needs a check to see if it needs to get sent.Also, in testing now I get a 401 error from my provider (flowroute, here's their API documentation http://developer.flowroute.com/api/messaging/overview/ ). The gateway uses HTTP Basic Auth. I have a feeling we're looking for the username field, but that isnt part of the string, its HTTP Basic Auth.
Comment #9
alansaviolobo commentedI have verified your issue on my own gateway. for a GET request, the extra & doesn't make a difference.
Apart from the issue that you have mentioned, I see that the gateway accepts a POST request and that the contents are json encoded.
I am now checking the structure of the POST request.
Comment #10
joncup commentedany idea about the http auth? I'ts working better now, but now my error is from my gateway. also, even if your gateway doesnt throw an error, maybe you shouldnt be sending extra parameters. i was getting undefined variable errors until I removed that last part.
Comment #11
joncup commentedAlso, I don't think the & is the problem, I think its the undefined variable error as the module expecting a value and not having one.
Comment #12
alansaviolobo commentedI have put in two more options for "authorization" and "content types" for POST request.
as per the api for FlowRoute, you would have to pick the options - basic & json respectively.
wrt the notices, they appear the first time you are configuring a form since there are no default values. editing the form subsequently does not throw any errors. will work on them.
Comment #13
joncup commentedHooray! It is working. I got my first text messages from my website!
Comment #14
alansaviolobo commentedwoot!
Comment #15
alansaviolobo commenteddid you get an opportunity to test out the incoming message feature ?
Comment #16
joncup commentedOhh, I had a question. How does incoming work. I have my callback url set on flowroute but i don't understand how to test incoming and where it goes.
Comment #17
alansaviolobo commentedas per http://developer.flowroute.com/docs/receive-an-inbound-message/, the configuration here would be "from", "body" & "to"

as per https://www.drupal.org/docs/7/modules/sms-framework/processing-incoming-messages, you would then have to implement a hook_sms_incoming($op, $number, $message, $options).
in this hook, you can take an appropriate action depending on the text of the message. the simplest action would be to send an outgoing sms acknowledging to the user that their message has been received and acted upon.
Comment #18
alansaviolobo commentedI have attached a test module to that logs every incoming sms.
you should be able to use it along with the configurations mentioned here - http://developer.flowroute.com/docs/receive-an-inbound-message/
Comment #20
johnhuang0808 commented@alansaviolobo, my SMS service provider doesn't have any sender(from) field. Could we make this as an optional field?
For example, adding a checkbox to let user decides the gateway should have sender(from) field or not. If the checkbox is not checked, the form doesn't validate it and the send action also doen't include the parameter.
Comment #21
alansaviolobo commentedThat is strange. If this is not passed as a parameter, then maybe you are configuring it in your account settings.
can you point me to your gateway documentation please ?
Comment #22
johnhuang0808 commentedOf course! Here is the gateway documentation in English.
Thanks a lot.
Comment #23
alansaviolobo commenteddone. check the dev version.
Comment #24
johnhuang0808 commentedThanks @alansaviolobo, it works for me.