Support forum

Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
Diafaan Server adaption
sp_NewPost Add Reply sp_NewTopic Add Topic
May 12, 2017
2:05 pm
Henk Helmantel
Admin
Forum Posts: 1488
Member Since:
May 28, 2013
sp_UserOfflineSmall Offline

Hello Adama,

You can use the Web Connector in Diafaan SMS Server to forward a received SMS messages to an HTTP server with your PHP script and send back the response to the sender of the SMS message. For this to work, the PHP script must recognize the HTTP query parameters and it must send back the correct response or an empty response if you do not want to send a reply.

If I look at your PHP script you have to take the following steps to make it work with Diafaan SMS Server:

1. In the 'Receive SMS' page of the Web Connector properties, enable 'Forward received SMS messages to website'

2. Set the 'Web page' field to the URI of your PHP script

3. Select 'HTTP method' 'POST'

4. Enable 'Handle HTTP response' and 'Reply HTTP response to sender'

5. Click 'Edit query string template' and set the template to 'text=[message-text]'

Your script section does not generate a response so you have to make sure that the 'SMS_so.php' and/or '$sms.php' return the correct HTTP content if you want to send a reply back to the user.

You can set the 'LogCommunicationToFile' property in the advanced settings of the Web Connector to 'True' to log the HTTP requests and responses to a file. This file can help you to debug your PHP script if anything goes wrong. Make sure that you set this property to 'False' to stop logging after you are finished with the tests.

Regards, Henk

May 12, 2017
10:02 am
ADAMA DIALLO
Guest
Guests

Dear,
Thank for your last support, I bougth a version Diafaan last week and I'm trying to use. But I'm alway the same probleme.
All thing are Good, but it is not able to recongnise very well my PHP script.
I ask him if message start by : E* , il must be lead to another file call $sms.php. unfortunately, it doesnt recognise the scrip. ( I precise it work very well with other sofware) SO I want to Know

1- It compulsory to put a script in "Edit query string template" ??? If yes what ( copie and paste all my PHP script ?? I did it but it didnt work ).

2 It can be due to message type ( unicode, automatic, data ....;) I try all of these but dont work ??

All are good ( I receive reply to Sent SMS by dont respect the programme instruction sont I dont Know If I have to set something before in order to enable Diafaan to recongnise PHP script.

Sorry Help me It is urgent

finde below a section of my script that Diafaan server doast recongnise:

<?php
$messageText = $_POST['text'];

/* To delate space in message*/
$messageText1 = preg_replace ('/\\s/','',$messageText);

/* to identify the two first caracters*/

$premiercaracter= substr($messageText1, 0, 2);
$Trpremiercaracter= substr($messageText1, 0, 4);
$Trpremiercaracters= substr($messageText1, 0, 5);

/* to conduct message toward a specfic file/*

if ($premiercaracter=="P*") {
INCLUDE('/home1/adama/public_html/ SMS_so.php');

EXIT;

} elseif (preg_match($regexp, $messageText1)&&($premiercaracter="E*")) {

INCLUDE('/home1/adama/public_html/$sms.php');
EXIT;

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 529

Currently Online:
6 Guest(s)

Currently Browsing this Page:
2 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 672

Members: 0

Moderators: 0

Admins: 1

Forum Stats:

Groups: 2

Forums: 3

Topics: 1141

Posts: 3899

Newest Members:

, Henk Helmantel

Administrators: Henk Helmantel: 1488