SMS app adding new carrier

Status
Not open for further replies.

Mikeme

Member
Apr 26, 2021
186
4
18
39
Looks like you're missing a single quote in your lua curl command, however it is not missing in your cli curl command, as illustrated in following screenshot;
View attachment 3124

Try adding a single quote before the "application/xml" part, as follows;
Bash:
cmd = " curl  " .. api_url .. " -H \"Content-Type: 'application/xml; charset=utf-8'\"  <?xml version=\"1.0\" encoding=\"UTF-8\"?> <sms><user><username>".. username .."</username><password>".. secret_key .. "</password></user><source>test</source><destinations><phone>".. to .."</phone></destinations><message>".. body .."</message><response>0</response></sms> ";
Thank's Dest, i have try to add the command you post to index.lua and still nothing happen...
no CURL Return and no sms send :(
what we are missing here?
are you sure there is no way to see outgoing command sent to carrier?
some lan output log?
 

Dast

Member
Nov 11, 2019
57
10
8
afaik, the only log output for SMS stuff is by using fs_cli.

Try the following revised lua, I added a few missing quotes, and also have the curl command append it's result into the /tmp/sms.send.log file.

Code:
cmd = "curl '" .. api_url .. "' -H \"Content-Type: 'application/xml; charset=utf-8'\" '<?xml version=\"1.0\" encoding=\"UTF-8\"?> <sms><user><username>".. username .."</username><password>".. secret_key .. "</password></user><source>test</source><destinations><phone>".. to .."</phone></destinations><message>".. body .."</message><response>0</response></sms>' | tee -a /tmp/sms.send.log";
 

Mikeme

Member
Apr 26, 2021
186
4
18
39
afaik, the only log output for SMS stuff is by using fs_cli.

Try the following revised lua, I added a few missing quotes, and also have the curl command append it's result into the /tmp/sms.send.log file.

Code:
cmd = "curl '" .. api_url .. "' -H \"Content-Type: 'application/xml; charset=utf-8'\" '<?xml version=\"1.0\" encoding=\"UTF-8\"?> <sms><user><username>".. username .."</username><password>".. secret_key .. "</password></user><source>test</source><destinations><phone>".. to .."</phone></destinations><message>".. body .."</message><response>0</response></sms>' | tee -a /tmp/sms.send.log";
Thank you Dest.
i have run this command in lua and check /tmp/sms.send.log but the file is empty.. and sms does not sent.
does it mean anything if the sms log is empty?
 

Dast

Member
Nov 11, 2019
57
10
8
Thank you Dest.
i have run this command in lua and check /tmp/sms.send.log but the file is empty.. and sms does not sent.
does it mean anything if the sms log is empty?

This would indicate the cmd is failing to execute.
Have you tried running the "fs_cli" cli app, and seeing what it outputs when you send an sms?
 

Mikeme

Member
Apr 26, 2021
186
4
18
39
This would indicate the cmd is failing to execute.
Have you tried running the "fs_cli" cli app, and seeing what it outputs when you send an sms?
I have try to run curl post from fs_cli and it's working.
What do you mean by cli app?
 

Mikeme

Member
Apr 26, 2021
186
4
18
39
Dest, so i guess the issue is - request are not going out from server..
what can be the reason for that?
 

Dast

Member
Nov 11, 2019
57
10
8
Dest, so i guess the issue is - request are not going out from server..
what can be the reason for that?

I'm not sure that is the case, as you said it worked when manually running the curl command.
At this stage I am unsure what the issue could be.

What is the output of the following command?
Bash:
file $(which curl)
 
Status
Not open for further replies.