Send SMS to https

I have been trying to configure my PLAYSMS installation with another gateway of playsms with both generic gateway as well as uplink gateway and in both instances I am not able to send to https URL whereas to http URL SMS is going fine.
What do I need to do to turn on HTTPS in my destination URL to send my SMSes thru the gateway and SMSC

is the destination URL configured with valid ssl cert ?

anton

Yes. When I use Postman or even a browser, I am able to send the SMS. But from PlaySMS, it give me an error “sendsms_process # fail no hook for sendsms”. When I change to another gateway with no https, the same SMSC works fine.

ok, set logstate to 3 in config.php (read about this all over the forum), to get more debug info

try again, see the log, if you still havent found why it happened then post here, but please redact important informations before pasting here (such as real name, phone numbers, IP addresses, hostnames…)

Thankyou for prompt response @anton. I have changed all identifiable information to generic names here>

I am breaking up the log file into two posts:


xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms # start uid:2 sender_id:[Usersender] smsc:[]

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L3 sendsms # maxlen:459 footerlen:0 footer:[] msglen:8 message:[SMS TEST]

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms_queue_create # saving queue_code:9856d5dbf673ed2848d312e70e98b5f0 src:Usersender scheduled:2020-07-08 07:39:54

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms_queue_create # saved queue_code:9856d5dbf673ed2848d312e70e98b5f0 id:35951

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L3 sendsms_manipulate_prefix # before prefix manipulation:[9800000001]

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L3 sendsms_manipulate_prefix # after prefix manipulation:[+9779800000001]

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L3 simplerate_hook_rate_getbyprefix # rate not found to:+9779800000001 default_rate:1.5

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L3 simplerate_hook_rate_getcharges # uid:2 u:USER len:8 unicode:0 to:+9779800000001 enable_credit_unicode:1 count:1 rate:1.5 charge:1.5

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms # dst_count:1 sms_count:1 total_charges:1.5

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms_queue_push # saving queue_code:9856d5dbf673ed2848d312e70e98b5f0 dst:+9779800000001

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms_queue_push # saved queue_code:9856d5dbf673ed2848d312e70e98b5f0 smslog_id:33582

xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 2020-07-08 07:39:54 PID5f05276e92de1 USER L2 sendsms # end queue_code:9856d5dbf673ed2848d312e70e98b5f0 queue_count:1 sms_count:1 failed_queue:0 failed_sms:0

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsmsd # start processing queue_code:9856d5dbf673ed2848d312e70e98b5f0 chunk:0 queue_count:1 sms_count:1 scheduled:2020-07-08 07:39:54 uid:2 gpid:0 sender_id:Usersender

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsmsd # sending queue_code:9856d5dbf673ed2848d312e70e98b5f0 smslog_id:33582 to:+9779800000001 sms_count:1 counter:1

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 sendsms_intercept # msgtemplate modified sms_sender:[Usersender] sms_footer:[] sms_to:[+9779800000001] sms_msg:[SMS TEST] uid:[2] gpid:[0] sms_type:[text] unicode:[0] queue_code:[9856d5dbf673ed2848d312e70e98b5f0] smsc:[]


- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 outgoing_hook_sendsms_intercept # no SMSC found uid:2 parent_uid:0 from:Usersender to:+9779800000001

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 recvsms_process # using default SMSC smsc:[uplink]

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsms_process # start

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 simplerate_hook_rate_getbyprefix # rate not found to:+9779800000001 default_rate:1.5

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 simplerate_hook_rate_getcharges # uid:2 u:USER len:8 unicode:0 to:+9779800000001 enable_credit_unicode:1 count:1 rate:1.5 charge:1.5

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 simplerate_hook_rate_cansend # allowed user uid:2 sms_to:+9779800000001 adhoc_credit:26215 count:1 rate:1.5 charge:1.5 adhoc_balance:26213.5

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsms # saving smslog_id:33582 u:2 parent_uid:0 g:0 gw:uplink smsc:uplink s:Usersender d:+9779800000001 type:text unicode:0 status:0

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsms_process # saved smslog_id:33582 id:33582

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 sendsms # final smslog_id:33582 gw:uplink smsc:uplink message:SMS TEST len:8

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 uplink_hook_sendsms # enter smsc:uplink smslog_id:33582 uid:2 to:+9779800000001

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 uplink_hook_sendsms # sendsms url:[https://PLaysmsserver.com/index.php?app=ws&format=json&h=1c038a284fe30e23e2aad97d10c95d74&u=Usersender&op=pv&from=Usersender&to=%2B9779800000001&nofooter=1&msg=SMS+TEST] smsc:[uplink]

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 uplink_hook_sendsms # sendsms failed. error:0 error_string:

- - 2020-07-08 07:39:55 PID5f05276f264cd - L3 dlr # isdlrd:1 smslog_id:33582 p_status:2 uid:2

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsms_process # fail no hook for sendsms

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsms_process # end

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsmsd # result queue_code:9856d5dbf673ed2848d312e70e98b5f0 to:+9779800000001 flag:2 smslog_id:33582

- - 2020-07-08 07:39:55 PID5f05276f264cd - L2 sendsmsd # finish processing queue_code:9856d5dbf673ed2848d312e70e98b5f0 uid:2 sender_id:Usersender queue_count:1 sms_count:1

- - 2020-07-08 07:39:56 PID5f049bf664862 - L3 dlrd # id:33667 smslog_id:33582 p_status:2 uid:2

that means sms submitted to uplink properly, but could be something happened on uplink

can you get logs on uplink side ?

anton

1 Like

The gateway is with a telco carrier and we do not have access to it. When I use the same syntax from a browser or from postman, I am able to send the SMS thru.

hmm… perhaps the file_get_contents() command used to submit to uplink, im not sure since i have no issue submitting https.

pls confirm, you have tested submitting this url (real domain real token ofcourse) in postman and browser, and you got proper response and sms sent

anton

When I send the same syntax thru browser, the SMS goes thru I get the following message back:

{"data":[{"status":"OK","error":"0","smslog_id":"5689736","queue":"ad986c217b99ec41a4ffe7000b2a38d2","to":"+9779800000001"}],"error_string":null,"timestamp":1594177169}

oops sorry I was wrong, the error message means that the submission was failed, so nothing was submitted to uplink

then the problem is I think on PHP side, the use of file_get_contents() command to submit to https, or related to it

uplink uses playSMS\Webservices:

and playSMS\Webservices uses file_get_contents() to access playSMS webservices API on uplink server:

what OS do you use, which PHP version and can you check if you have openssl loaded in your PHP:

php -m | grep ssl

anton