Re: question about postgresql dlr storage

2015-07-27 Thread Marcin Matyaszczyk
hello

All fields are urlencoded,  problem is with insert query for dlr result
(we think that the string „source” is not escaped properly before insert
to db).

The sms is submited like this :
http://localhost:13013/cgi-bin/sendsms?username=usernamepassword=passto=%2B485text=SMS+test+40from=Victoria%27ssmsc=smpp1tmobiledlr-mask=31priority=0dlr-url=http%3A%2F%2Fsmsc.host.pl%2Fdlr2.php%3Fid%3D145092731%26source%3Dred%26t%3D%25t%26i%3D%25i%26d%3D%25d%26D%3D%25D%26A%3D%25A%26F%3D%25F


in postgresql error log we see this , look that there is now escape for
field „Victoria’s” (This query is build in  dlr_pgsql.c file)

2015-07-27 12:25:57 CEST ERROR:  syntax error at or near s at
character 157

2015-07-27 12:25:57 CEST STATEMENT:  INSERT INTO dlr (smsc, ts,
source, destination, service, url, mask, boxc, status)
VALUES ('smpp1tmobile', '80B607350021', 'Victoria's',
'+485', ‚red', 'http://s
msc.host.pl/dlr2.php?id=145092731source=redt=%ti=%id=%dD=%DA=%AF=%F',
'31', '', '0');

Pozdrawiam,
  Marcin Matyaszczyk
  Administrator

Ogicom “Spider” Sp. z o.o. S.K.A., (61-131) Poznan, ul. Abpa Baraniaka
88, REGON 634407251, NIP 781-17-20-476, Sad Rejonowy Poznan Nowe Miasto
i Wilda w Poznaniu, VIII Wydzial Gospodarczy Krajowego Rejestru
Sadowego, KRS 410900,  kapital zakladowy: 429 000 PLN.

W dniu 15.07.2015 o 15:30, Alvaro Cornejo pisze:
 Hi
 
 dlr-url should also be urlencoded. In your example the + sign should
 also be urlencode since + is the urlencode value of the space char.
 
 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 Wed, Jul 15, 2015 at 2:39 AM, Marcin Matyaszczyk
 m.matyaszc...@ogicom.pl mailto:m.matyaszc...@ogicom.pl wrote:
 
 Hello
 
 Thanks for answer. We urlencode all fields and sms is submitted ok to
 kannel, problem appears when we get dlr (insert query).
 
 Pozdrawiam,
   Marcin Matyaszczyk
   Administrator
 
 Ogicom “Spider” Sp. z o.o. S.K.A., (61-131) Poznan, ul. Abpa Baraniaka
 88, REGON 634407251, NIP 781-17-20-476, Sad Rejonowy Poznan Nowe Miasto
 i Wilda w Poznaniu, VIII Wydzial Gospodarczy Krajowego Rejestru
 Sadowego, KRS 410900,  kapital zakladowy: 429 000 PLN.
 
 W dniu 10.07.2015 o 16:20, Alvaro Cornejo pisze:
  Hi
 
  You need to urlenconde your field values when submitting to kannel.
   Victoria's should be Victoria%27s
 
  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 http://www.perusms.com
 
  On Thu, Jul 9, 2015 at 8:00 AM, Marcin Matyaszczyk
  m.matyaszc...@ogicom.pl mailto:m.matyaszc...@ogicom.pl
 mailto:m.matyaszc...@ogicom.pl mailto:m.matyaszc...@ogicom.pl
 wrote:
 
  Hello
 
  we have a problem with Postgresql DLR storage, when we try to send 
 sms
  with source field containing ' character we've got an error:
 
  2015-04-02 10:18:51 CEST STATEMENT:  INSERT INTO dlr (smsc, 
 ts,
  source, destination, service, url, mask, boxc, status)
  VALUES ('smpp3', '', 'Victoria's', '+488 
 tel:%2B488
  tel:%2B488', 'xx',

  
 'http://.domain.pl/dlr2.php?id=110725920source=XXXt=%ti=%id=%dD=%DA=%AF=%F',
  '31', '', '0');
 
  2015-04-02 10:21:51 CEST ERROR:  syntax error at or near s at
  character 147
 
  We use kannel 1.5. Can you tell me how we can avoid this problem?
 
  regards
  Marcin Matyaszczyk
 
 
 
 



Re: question about postgresql dlr storage

2015-07-15 Thread Marcin Matyaszczyk
Hello

Thanks for answer. We urlencode all fields and sms is submitted ok to
kannel, problem appears when we get dlr (insert query).

Pozdrawiam,
  Marcin Matyaszczyk
  Administrator

Ogicom “Spider” Sp. z o.o. S.K.A., (61-131) Poznan, ul. Abpa Baraniaka
88, REGON 634407251, NIP 781-17-20-476, Sad Rejonowy Poznan Nowe Miasto
i Wilda w Poznaniu, VIII Wydzial Gospodarczy Krajowego Rejestru
Sadowego, KRS 410900,  kapital zakladowy: 429 000 PLN.

W dniu 10.07.2015 o 16:20, Alvaro Cornejo pisze:
 Hi
 
 You need to urlenconde your field values when submitting to kannel.
  Victoria's should be Victoria%27s
 
 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 Thu, Jul 9, 2015 at 8:00 AM, Marcin Matyaszczyk
 m.matyaszc...@ogicom.pl mailto:m.matyaszc...@ogicom.pl wrote:
 
 Hello
 
 we have a problem with Postgresql DLR storage, when we try to send sms
 with source field containing ' character we've got an error:
 
 2015-04-02 10:18:51 CEST STATEMENT:  INSERT INTO dlr (smsc, ts,
 source, destination, service, url, mask, boxc, status)
 VALUES ('smpp3', '', 'Victoria's', '+488
 tel:%2B488', 'xx',
 
 'http://.domain.pl/dlr2.php?id=110725920source=XXXt=%ti=%id=%dD=%DA=%AF=%F',
 '31', '', '0');
 
 2015-04-02 10:21:51 CEST ERROR:  syntax error at or near s at
 character 147
 
 We use kannel 1.5. Can you tell me how we can avoid this problem?
 
 regards
 Marcin Matyaszczyk
 
 



question about postgresql dlr storage

2015-07-09 Thread Marcin Matyaszczyk
Hello

we have a problem with Postgresql DLR storage, when we try to send sms
with source field containing ' character we've got an error:

2015-04-02 10:18:51 CEST STATEMENT:  INSERT INTO dlr (smsc, ts,
source, destination, service, url, mask, boxc, status)
VALUES ('smpp3', '', 'Victoria's', '+488', 'xx',
'http://.domain.pl/dlr2.php?id=110725920source=XXXt=%ti=%id=%dD=%DA=%AF=%F',
'31', '', '0');

2015-04-02 10:21:51 CEST ERROR:  syntax error at or near s at
character 147

We use kannel 1.5. Can you tell me how we can avoid this problem?

regards
Marcin Matyaszczyk