RE: Http relay issue with kannel

2008-06-16 Thread info.ubichip
Thanks, it was helpfull.
 
it is working now,despite the dlr but it is for cdma and my other gw does
not support it.
 
 

  _  

From: Alvaro Cornejo [mailto:[EMAIL PROTECTED] 
Sent: vendredi 13 juin 2008 16:26
To: info.ubichip
Cc: users@kannel.org
Subject: Re: Http relay issue with kannel


define your php smsc as generic. there you can define regex for the
accepted/rejected/etc status.

Note that in order to use generic smsc you must use CVS. 


I use this setup:


group = smsc
smsc = http
smsc-id = kan2mail
log-level = 0
log-file = /var/log/kannel/kan2mail.log
system-type = generic
port = 13017
send-url = http://localhost/sms/kannel/kan2mail.php?u=usr
http://localhost/sms/kannel/kan2mail.php?u=usrp p
=passto=%pfrom=%Pmsg=%a
connect-allow-ip = localhost
denied-smsc-id = modem, smsc1
allowed-smsc-id = kan2mail
preferred-smsc-id-regex = kan2mail
status-success-regex = OK
status-permfail-regex = failure
status-tempfail-regex = retry later

hope helps

Alvaro

On 6/13/08, info.ubichip [EMAIL PROTECTED] wrote: 

Hello,

I would like to achieve the following schema to send sms:

app --- kannel gw 1--- php code

I would like the php code is seen as another kannel gw by the kannel gw #1.

In the php code, I wrote some code answering 0: Accepted for delivery or
Sent. but the GW1 saw it as NACK and so make it as failed in the kannel
database.

I take a look in the kannel source and I found that in the
/gw/smsc/smsc_http.c :


static void kannel_parse_reply(SMSCConn *conn, Msg *msg, int status,
   List *headers, Octstr *body)
{
/* Test on three cases:
 * 1. an smsbox reply of an remote kannel instance
 * 2. an smsc_http response (if used for MT to MO looping)
 * 3. an smsbox reply of partly successful sendings */
if ((status == HTTP_OK || status == HTTP_ACCEPTED)
 (octstr_case_compare(body, octstr_imm(Sent.)) == 0 ||
octstr_case_compare(body, octstr_imm(Ok.)) == 0 ||
octstr_ncompare(body, octstr_imm(Result: OK),10) == 0)) {
bb_smscconn_sent(conn, msg, NULL);
} else {
bb_smscconn_send_failed(conn, msg,
SMSCCONN_FAILED_MALFORMED, octstr_duplicate(body));
}
}

So I assume kannel saw a good transmission when it receive a HTTP OK and a
message like Sent. or Ok.

Does I forget something ?

Does someone got similar issue ?

Regards







-- 
|---
--|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
celular y
Nextel en México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y
GPRS online
  Visitenos en www.smsglobal.com.mx y www.pravcom.com 


RE: Http relay issue with kannel

2008-06-16 Thread info.ubichip
Hello,
 
I set up a small other application which deal with cdma, and I setup a
generic http sms that handle the link from this application to kannel.
 
regards
 

  _  

From: Alvaro Cornejo [mailto:[EMAIL PROTECTED] 
Sent: lundi 16 juin 2008 07:00
To: info.ubichip; users@kannel.org
Subject: Re: Http relay issue with kannel


How do you handle cdma with kannel??


On Mon, Jun 16, 2008 at 3:35 AM, info.ubichip [EMAIL PROTECTED] wrote:


Thanks, it was helpfull.
 
it is working now,despite the dlr but it is for cdma and my other gw does
not support it.
 
 

  _  

From: Alvaro Cornejo [mailto:[EMAIL PROTECTED] 
Sent: vendredi 13 juin 2008 16:26
To: info.ubichip
Cc: users@kannel.org
Subject: Re: Http relay issue with kannel


define your php smsc as generic. there you can define regex for the
accepted/rejected/etc status.

Note that in order to use generic smsc you must use CVS. 


I use this setup:


group = smsc
smsc = http
smsc-id = kan2mail
log-level = 0
log-file = /var/log/kannel/kan2mail.log
system-type = generic
port = 13017
send-url = http://localhost/sms/kannel/kan2mail.php?u=usr
http://localhost/sms/kannel/kan2mail.php?u=usrp p
=passto=%pfrom=%Pmsg=%a
connect-allow-ip = localhost
denied-smsc-id = modem, smsc1
allowed-smsc-id = kan2mail
preferred-smsc-id-regex = kan2mail
status-success-regex = OK
status-permfail-regex = failure
status-tempfail-regex = retry later

hope helps

Alvaro

On 6/13/08, info.ubichip [EMAIL PROTECTED] wrote: 

Hello,

I would like to achieve the following schema to send sms:

app --- kannel gw 1--- php code

I would like the php code is seen as another kannel gw by the kannel gw #1.

In the php code, I wrote some code answering 0: Accepted for delivery or
Sent. but the GW1 saw it as NACK and so make it as failed in the kannel
database.

I take a look in the kannel source and I found that in the
/gw/smsc/smsc_http.c :


static void kannel_parse_reply(SMSCConn *conn, Msg *msg, int status,
   List *headers, Octstr *body)
{
/* Test on three cases:
 * 1. an smsbox reply of an remote kannel instance
 * 2. an smsc_http response (if used for MT to MO looping)
 * 3. an smsbox reply of partly successful sendings */
if ((status == HTTP_OK || status == HTTP_ACCEPTED)
 (octstr_case_compare(body, octstr_imm(Sent.)) == 0 ||
octstr_case_compare(body, octstr_imm(Ok.)) == 0 ||
octstr_ncompare(body, octstr_imm(Result: OK),10) == 0)) {
bb_smscconn_sent(conn, msg, NULL);
} else {
bb_smscconn_send_failed(conn, msg,
SMSCCONN_FAILED_MALFORMED, octstr_duplicate(body));
}
}

So I assume kannel saw a good transmission when it receive a HTTP OK and a
message like Sent. or Ok.

Does I forget something ?

Does someone got similar issue ?

Regards







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





-- 
|---
--|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
celular y
Nextel en México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y
GPRS online
Visitenos en www.smsglobal.com.mx y www.pravcom.com 


Re: Http relay issue with kannel

2008-06-14 Thread PoPo

Hi,

I wrote this function to call Kannel and process messages back:

private function call_kannel($url, $data){
$url = $url . ? . $data;

$st = @file($url);
list($version, $status_code, $msg) = explode(' ', 
$http_response_header[0], 3);


switch((int) $status_code){
case 202:
// Accepted for delivery / Queued for later delivery
return 1;
break;
case 503:
// Temporal failure, try again later
throw new Exception(Serveur temporal failure.);
break;
default:
$deb = substr($status_code, 0, 1);
if($deb == 4){
// Requete invalide
return 2;
}else{
// Erreur inconnue
return 3;
}
}
}

I do not know if it can help you.

See you dear friend french ;)

Cyril

PS : can you contact me to say what carier you use to send SMS?


info.ubichip a écrit :

Hello,

I would like to achieve the following schema to send sms:

app --- kannel gw 1--- php code

I would like the php code is seen as another kannel gw by the kannel gw #1. 


In the php code, I wrote some code answering 0: Accepted for delivery or
Sent. but the GW1 saw it as NACK and so make it as failed in the kannel
database.

I take a look in the kannel source and I found that in the
/gw/smsc/smsc_http.c :


static void kannel_parse_reply(SMSCConn *conn, Msg *msg, int status,
   List *headers, Octstr *body)
{
/* Test on three cases:
 * 1. an smsbox reply of an remote kannel instance
 * 2. an smsc_http response (if used for MT to MO looping)
 * 3. an smsbox reply of partly successful sendings */
if ((status == HTTP_OK || status == HTTP_ACCEPTED)
 (octstr_case_compare(body, octstr_imm(Sent.)) == 0 ||
octstr_case_compare(body, octstr_imm(Ok.)) == 0 ||
octstr_ncompare(body, octstr_imm(Result: OK),10) == 0)) {
bb_smscconn_sent(conn, msg, NULL);
} else {
bb_smscconn_send_failed(conn, msg,
SMSCCONN_FAILED_MALFORMED, octstr_duplicate(body));
}
}

So I assume kannel saw a good transmission when it receive a HTTP OK and a
message like Sent. or Ok.

Does I forget something ?

Does someone got similar issue ?

Regards


  




Http relay issue with kannel

2008-06-13 Thread info.ubichip
Hello,

I would like to achieve the following schema to send sms:

app --- kannel gw 1--- php code

I would like the php code is seen as another kannel gw by the kannel gw #1. 

In the php code, I wrote some code answering 0: Accepted for delivery or
Sent. but the GW1 saw it as NACK and so make it as failed in the kannel
database.

I take a look in the kannel source and I found that in the
/gw/smsc/smsc_http.c :


static void kannel_parse_reply(SMSCConn *conn, Msg *msg, int status,
   List *headers, Octstr *body)
{
/* Test on three cases:
 * 1. an smsbox reply of an remote kannel instance
 * 2. an smsc_http response (if used for MT to MO looping)
 * 3. an smsbox reply of partly successful sendings */
if ((status == HTTP_OK || status == HTTP_ACCEPTED)
 (octstr_case_compare(body, octstr_imm(Sent.)) == 0 ||
octstr_case_compare(body, octstr_imm(Ok.)) == 0 ||
octstr_ncompare(body, octstr_imm(Result: OK),10) == 0)) {
bb_smscconn_sent(conn, msg, NULL);
} else {
bb_smscconn_send_failed(conn, msg,
SMSCCONN_FAILED_MALFORMED, octstr_duplicate(body));
}
}

So I assume kannel saw a good transmission when it receive a HTTP OK and a
message like Sent. or Ok.

Does I forget something ?

Does someone got similar issue ?

Regards