Hi,

Add in your php script a exec command whoami, or call a shell script with this 
command.
You redirect in a logfile.

Of course your script, logfile should be in chmod  777.
You will know which user launch your script, then just add right to the user.

De : users [mailto:users-boun...@kannel.org] De la part de Nasir Javaid
Envoyé : mercredi 27 mai 2015 20:18
À : Rene Kluwen
Cc : users
Objet : Re: SMS Reply failure in Khmer language with echo and with sendsms

Thank you rene, I don't think I am running php in safe mode as it is running as 
standard. Anyways I will try your method to check.

Isn;t there any was I can send reply in Khmer language using php "echo" command 
by setting some variables in kannel.conf file?



On Wed, May 27, 2015 at 10:28 PM, Rene Kluwen 
<rene.klu...@chimit.nl<mailto:rene.klu...@chimit.nl>> wrote:
This isn’t really a Kannel issue.
But maybe you run php in safe mode or something like that.

But maybe you can try instead of the system call:

$dummy = 
file_get_contents("http://10.10.1.35:13013/cgi-bin/sendsms?username=user&password=pass&from=xxxx&smsc=smpp-1&charset=UTF-8&coding=2&to=$receiver&text=$msgreply";);



From: users [mailto:users-boun...@kannel.org<mailto:users-boun...@kannel.org>] 
On Behalf Of Nasir Javaid
Sent: woensdag 27 mei 2015 11:51
To: Alvaro Cornejo
Cc: users
Subject: Re: SMS Reply failure in Khmer language with echo and with sendsms

Yup... I know about linux users but confused how to give permissions to kannel 
user? as chmod is used for the users that are already on linux system.

now kannel can run new_smsreceiver.php via get-url without and issue... and the 
code inside new_smsreceiver.php works fine as it explodes the smstext and 
stores in db which means its being executed fine.. Issue is the other php file 
or any linux command executed using "system" doesn't seem to get working.

Thanks!

On Tue, May 26, 2015 at 6:46 PM, Alvaro Cornejo 
<cornejo.alv...@gmail.com<mailto:cornejo.alv...@gmail.com>> wrote:
Hi

I'm referring to Linux user.

Kannel boxes are usually ran by kannel user. Therefore kannel user should have 
permission to execute your new_smsreceiver.php. When you run it from command 
line, you are running it with the user you have logged in.

You can use chmod command in a console to change permissions accordingly.

Google about linux user permissions to get more info about how it works.

Regards

Alvaro

|-----------------------------------------------------------------------------------------------------------------|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular 
y Nextel
en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y 
GPRS online
              Visitenos en www.perusms.com<http://www.perusms.com>

On Tue, May 26, 2015 at 5:59 AM, Nasir Javaid 
<nasirjav...@gmail.com<mailto:nasirjav...@gmail.com>> wrote:
Thank you so much for replying, but as get-url is calling new_smsreceiver.php 
and that php is working so how could I know which user is being used? which 
kannel user you mean... there is only the sendsms user in kannel and it does 
not exist in system.

I am newbie in this stuff so please a little more explanation would be great 
help..

On Mon, May 25, 2015 at 11:44 PM, Alvaro Cornejo 
<cornejo.alv...@gmail.com<mailto:cornejo.alv...@gmail.com>> wrote:
Hi

Check permissions. Kannel user might not have permit to execute lynx.

Regards

Alvaro

|-----------------------------------------------------------------------------------------------------------------|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular 
y Nextel
en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y 
GPRS online
              Visitenos en www.perusms.com<http://www.perusms.com>

On Mon, May 25, 2015 at 8:24 AM, Nasir Javaid 
<nasirjav...@gmail.com<mailto:nasirjav...@gmail.com>> wrote:
Dear All,

I am having a strange issue. We have a service in which we receive sender's 
nickame in khmer language and reply him back via kannel. For example user sends 
r#វីរបុរសសួយថាង

Now by setting mo-recode=true in smsbox config, we can receive and store the 
khmer font properly in db. But the issue is reply. Echo command shows ???? on 
mobile phone. Even tried urldecode but still mobile handset shows garbage or 
?????? signs.

I have read many lists where they say to use separate sendsms command to send 
sms using charset=utf-8 and coding=2..... Yes this works from command line or 
running php script ,which has this command, from command line, but issue is how 
to make it work from php script which is called by sms-service get-url...

I have set max-messages=0 and omit-empty=true and in my php script i separately 
call the sendsms via system command but it seems that this line is totally 
ignored and when I test this script from commandline it works fine but when 
being called by sms-service, it logs data in db properly via script but somehow 
misses to run the system command.

Here is my kannel.conf
group = core
admin-port = 13000
smsbox-port = 13001
wapbox-port = 13002
#PPG
wdp-interface-name = "*"
#PPG
log-level = 0
log-file = "/var/log/kannel/kannel.log"
access-log = "/var/log/kannel/access.log"
admin-password = iccard2
status-password = iccard2
#dlr-storage = mysql

# SMSBOX SETUP
group = smsbox
bearerbox-host = 10.1.10.22
sendsms-port = 13013
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
mo-recode = true
immediate-sendsms-reply = true

# SEND-SMS USERS
group = sendsms-user
username = user
password = pass
user-deny-ip = "*.*.*.*"
user-allow-ip = "10.1.10.22"
name = service_kannel
max-messages = 3
concatenation = 1
omit-empty= true

group = mysql-connection
id = mydlr
host = localhost
username = root
password = pass
database = sms
max-connections = 5

group = dlr-db
id = mydlr
table = smsdlr
field-smsc = smsc
field-timestamp = ts
field-destination = destination
field-source = source
field-service = service
field-url = url
field-mask = mask
field-status = status
field-boxc-id = boxc

# SMSC SMPP
group = smsc
smsc = smpp
smsc-id = smpp-1
host = xxx.xxx.xxx
port = 2222
receive-port = 2222
smsc-username = user
smsc-password = pass
source-addr-ton = 0
dest-addr-ton = 0
bind-addr-ton = 0
source-addr-npi=0
dest-addr-npi=0
allowed-smsc-id = smpp-1
system-type = VMCWI

group = smsc
smsc = fake
port = 10000
connect-allow-ip = 127.0.0.1

group = sms-service
keyword = default
get-url = 
"http://localhost/new_smsreceiver.php?receiver=%p&smstext=%a&shortcode=%P&stime=%t&smsc=%i&kword=%k<http://localhost/new_smsreceiver.php?receiver=%25p&smstext=%25a&shortcode=%25P&stime=%25t&smsc=%25i&kword=%25k>"
omit-empty = true
max-messages = 0


in my new_smsreceiver.php


<?php

error_reporting(0);
//$receiver=str_replace("+855","0",$_REQUEST[receiver]);

$receiver=$_REQUEST[receiver];
$smstext = $_REQUEST[smstext];
$shortcode=$_REQUEST[shortcode];
$smsc=$_REQUEST[smsc];
$tm=$_REQUEST[stime];
$kw=$_REQUEST[kword];

        $pieces = explode("#", $smstext);
        $rstr=$pieces[0];
        $nick=$pieces[1];
$msgreply="Hi $nick, You are now registered for. You can now send you comments 
by typing contestant Id and your comment, Ex. 1 is good.";
system("lynx -dump 
'http://10.10.1.35:13013/cgi-bin/sendsms?username=user&password=pass&from=xxxx&smsc=smpp-1&charset=UTF-8&coding=2&to=$receiver&text=$msgreply'");


Now this system command executes fine when I run it from cli of linux but it 
seems not running when script is called from get-url.

Please help.

--
Regards,

Nasir Javaid




--
Regards,

Nasir Javaid




--
Regards,

Nasir Javaid



--
Regards,

Nasir Javaid

Reply via email to