playSMS Forum

[solved] Change the status sms


(Douglas Fabiano Specht) #1

hello
I created a new generic gateway that is working properly when there is no error in sending the sms.
but let’s say the phone number is invalid, I have a return on json, and within it something like “errors”: [“Not a valid phone number”].
currently the playsms says the status that this message has been sent correctly, of course he does not know of this message.
In this case as I do for him to understand that to find “errors”: [“Not a valid phone number”] should not count as a message sent correctly?


Java api for playsms generic smsc
(Anton Raharja) #2

hav you tried gateway Generic (from recent release 1.3.1) ?

with gateway generic your gateway need to return plain text: [message id] [error message]

for example:

181 OK
7182693193 Message sent

and example for failed sent message:

0 Fail
0 User not found
0 Invalid number

anton


(Douglas Fabiano Specht) #3

Thank you for your answer.
this gateway returns a json and I can not change the return.
I have to see another way to control it.
which the table and field that is recorded what went right or wrong status?


(Anton Raharja) #4

its in the file, the gateway plugin you use
you set the status using dlr()

anton


(Douglas Fabiano Specht) #5

sorry but dlr() is a file where I change the status?
I am new to playsms, so sorry again the question


(Anton Raharja) #6

no, dlr() is a function that is used to set the status

visit here:

see how I examine the returns and decide the status using dlr()

hint: line 83 to 113

anton


(Douglas Fabiano Specht) #7

thanks again Anton,
I changed the line
of $ resp = explode (’ ', $response, 2);
for $ resp = explode (‘success’, $response, 2);
and managed to control.

Thank you very much.


(Edson França) #8

anton, how can I send the message id in the URL?

This is for me to respond with
Message_ID OK