Re: Re[4]: MO messages from SMPP stored in database multiple times

2017-01-24 Thread Seystec Soler
Hello

I'm running only bearerbox and sqlbox. Messages are being passed from
bearerbox to sqlbox directly. smsbox is no initiated, this could be a
problem here?
In simple scenario that I want for MO messages: SMPP --> bearerbox -->
sqlbox. Also I need to start a smsbox instance? What is its functionality?

Regards


2017-01-22 12:51 GMT-04:00 Rene Kluwen :

> Ah, you are using the Oracle backend. Sorry, I automatically assumed mysql.
> So this is an interesting use case. I've never came across somebody using
> it, after creating it many years ago.
> The sqlbox insert code for MT messages and MO messages looks the same in
> the oracle driver.
>
> Do you get the MO also 50 times relayed to your smsbox? Or do you leave it
> just in sqlbox without doing anything with it?
> In the latter case, it might be an acknowlegde to bearerbox that is
> missing. Just brainstorming here.
>
> == Rene
>
> -- Origineel bericht --
> Van: "Seystec Soler" 
> Aan: "Rene Kluwen" 
> Cc: "info.ubichip" ; users@kannel.org
> Verzonden: 19-1-2017 18:56:32
> Onderwerp: Re: Re[2]: MO messages from SMPP stored in database multiple
> times
>
> Hello Rene.
> Thanks for your assistance
>
> In my understanding for Oracle DB (in absence of auto increment fields)
> sqlbox uses triggers and sequences to generate ids.
>
> In source code (sqlbox_oracle.c):
> /*
>  * Oracle implementation using a sequence and a trigger for
> auto_increment fields.
>  */
> sql = octstr_format(SQLBOX_ORACLE_CREATE_LOG_SEQUENCE,
> sqlbox_logtable);
> ...
> sql = octstr_format(SQLBOX_ORACLE_CREATE_LOG_TRIGGER,
> sqlbox_logtable, sqlbox_logtable, sqlbox_logtable);
>
>
> Also sqlbox log shows trigger creation attempts on each initialization:
> 2017-01-17 20:51:20 [5746] [0] ERROR: Error - ORA-04081: trigger
> 'sms_sent_trg' already exists
> 2017-01-17 20:51:22 [5746] [0] ERROR: Error - ORA-04081: trigger
> 'sms_send_trg' already exists
>
> Regards
>
>
> 2017-01-19 7:03 GMT-04:00 Rene Kluwen :
>
>> sqlbox doesn't create triggers out of the box.
>> You may want to look into that direction.
>>
>> == Rene
>>
>> -- Origineel bericht --
>> Van: "Seystec Soler" 
>> Aan: "info.ubichip" 
>> Cc: users@kannel.org
>> Verzonden: 19-1-2017 8:58:32
>> Onderwerp: RE: MO messages from SMPP stored in database multiple times
>>
>> Hello.
>>
>> Messages have same timestamp but different id since ids are created by
>> triggers with a sequence.
>> Tables have only two triggers created by sqlbox without changes.
>>
>> Regards
>>
>> El 17/1/2017 12:07, "info.ubichip"  escribió:
>>
>>> Hello,
>>>
>>>
>>>
>>> Do you have the same sms Id/timestamp in all the MO message ?
>>>
>>> any trigger setup in your database ?
>>>
>>>
>>>
>>> Regards
>>>
>>>
>>>
>>> *De :* Seystec Soler [mailto:seys...@gmail.com]
>>> *Envoyé :* mardi 17 janvier 2017 15:23
>>> *À :* info.ubichip
>>> *Cc :* users@kannel.org
>>> *Objet :* Re: MO messages from SMPP stored in database multiple times
>>>
>>>
>>>
>>> Hello
>>>
>>>
>>>
>>> Thanks for your response,
>>>
>>> I have only one service in my config file, default service:
>>>
>>>
>>>
>>> group = sms-service
>>>
>>> keyword = default
>>>
>>> text = ""
>>>
>>> max-messages = 0
>>>
>>>
>>>
>>> Any other suggestion?
>>>
>>>
>>>
>>> Regards
>>>
>>>
>>>
>>>
>>>
>>> 2017-01-17 6:54 GMT-04:00 info.ubichip :
>>>
>>> Hello,
>>>
>>>
>>>
>>> Do you have any sms services acting as a loop and reinjecting the MO ?
>>>
>>>
>>>
>>> Regards
>>>
>>>
>>>
>>> *De :* users [mailto:users-boun...@kannel.org] *De la part de* Seystec
>>> Soler
>>> *Envoyé :* vendredi 13 janvier 2017 07:22
>>> *À :* users@kannel.org
>>> *Objet :* Re: MO messages from SMPP stored in database multiple times
>>>
>>>
>>>
>>> Hello.
>>> Anyone can help me with this?
>>>
>>> Thanks
>>>
>>>
>>>
>>> 2017-01-10 22:06 GMT-04:00 Seystec Soler :
>>>
>>> Hello fellows.
>>>
>>>
>>>
>>> I have a strange case, I'm trying to store in database (Oracle) messages
>>> received from an SMPP connection. Connection it's fine and I can receive it
>>> but MO messages are being stored in table 50 times each. In Kannel logs and
>>> web interface shows one message is received but sqlbox (presumibly) is
>>> multiplying each MO message. My setup is:
>>>
>>> SMPP --> bearerbox --> sqlbox.
>>>
>>> I'm running only bearerbox and sqlbox.
>>>
>>> I have been testing with versions 1.4.4 and SVN on Debian Wheezy and
>>> CentOS 7. Can you help me to see what I am missing on my config to avoid
>>> this behavior?
>>>
>>>
>>>
>>> Thanks for you time.
>>>
>>>
>>>
>>> Below is my minimal config:
>>>
>>>
>>>
>>> ### Begin Config file 
>>>
>>>
>>>
>>> group = core
>>>
>>> admin-port = 13000
>>>
>>> admin-password = mySecretPass
>>>
>>> box-allow-ip = "*.*.*.*"
>>>
>>> 

Re[4]: MO messages from SMPP stored in database multiple times

2017-01-22 Thread Rene Kluwen
Ah, you are using the Oracle backend. Sorry, I automatically assumed 
mysql.
So this is an interesting use case. I've never came across somebody 
using it, after creating it many years ago.
The sqlbox insert code for MT messages and MO messages looks the same in 
the oracle driver.


Do you get the MO also 50 times relayed to your smsbox? Or do you leave 
it just in sqlbox without doing anything with it?
In the latter case, it might be an acknowlegde to bearerbox that is 
missing. Just brainstorming here.


== Rene

-- Origineel bericht --
Van: "Seystec Soler" 
Aan: "Rene Kluwen" 
Cc: "info.ubichip" ; users@kannel.org
Verzonden: 19-1-2017 18:56:32
Onderwerp: Re: Re[2]: MO messages from SMPP stored in database multiple 
times



Hello Rene.
Thanks for your assistance

In my understanding for Oracle DB (in absence of auto increment fields) 
sqlbox uses triggers and sequences to generate ids.


In source code (sqlbox_oracle.c):
/*
 * Oracle implementation using a sequence and a trigger for 
auto_increment fields.

 */
sql = octstr_format(SQLBOX_ORACLE_CREATE_LOG_SEQUENCE, 
sqlbox_logtable);

...
sql = octstr_format(SQLBOX_ORACLE_CREATE_LOG_TRIGGER, 
sqlbox_logtable, sqlbox_logtable, sqlbox_logtable);



Also sqlbox log shows trigger creation attempts on each initialization:
2017-01-17 20:51:20 [5746] [0] ERROR: Error - ORA-04081: trigger 
'sms_sent_trg' already exists
2017-01-17 20:51:22 [5746] [0] ERROR: Error - ORA-04081: trigger 
'sms_send_trg' already exists


Regards


2017-01-19 7:03 GMT-04:00 Rene Kluwen :

sqlbox doesn't create triggers out of the box.
You may want to look into that direction.

== Rene

-- Origineel bericht --
Van: "Seystec Soler" 
Aan: "info.ubichip" 
Cc: users@kannel.org
Verzonden: 19-1-2017 8:58:32
Onderwerp: RE: MO messages from SMPP stored in database multiple times


Hello.

Messages have same timestamp but different id since ids are created 
by triggers with a sequence.

Tables have only two triggers created by sqlbox without changes.

Regards

El 17/1/2017 12:07, "info.ubichip"  escribió:

Hello,



Do you have the same sms Id/timestamp in all the MO message ?

any trigger setup in your database ?



Regards



De : Seystec Soler [mailto:seys...@gmail.com]
Envoyé : mardi 17 janvier 2017 15:23
À : info.ubichip
Cc :users@kannel.org
Objet : Re: MO messages from SMPP stored in database multiple times



Hello



Thanks for your response,

I have only one service in my config file, default service:



group = sms-service

keyword = default

text = ""

max-messages = 0



Any other suggestion?



Regards





2017-01-17 6:54 GMT-04:00 info.ubichip :

Hello,



Do you have any sms services acting as a loop and reinjecting the MO 
?




Regards



De : users [mailto:users-boun...@kannel.org 
] De la part de Seystec Soler

Envoyé : vendredi 13 janvier 2017 07:22
À :users@kannel.org
Objet : Re: MO messages from SMPP stored in database multiple times



Hello.
Anyone can help me with this?

Thanks



2017-01-10 22:06 GMT-04:00 Seystec Soler :

Hello fellows.



I have a strange case, I'm trying to store in database (Oracle) 
messages received from an SMPP connection. Connection it's fine and 
I can receive it but MO messages are being stored in table 50 times 
each. In Kannel logs and web interface shows one message is received 
but sqlbox (presumibly) is multiplying each MO message. My setup is:


SMPP --> bearerbox --> sqlbox.

I'm running only bearerbox and sqlbox.

I have been testing with versions 1.4.4 and SVN on Debian Wheezy and 
CentOS 7. Can you help me to see what I am missing on my config to 
avoid this behavior?




Thanks for you time.



Below is my minimal config:



### Begin Config file 



group = core

admin-port = 13000

admin-password = mySecretPass

box-allow-ip = "*.*.*.*"

admin-allow-ip = "127.0.0.1"

smsbox-port = 13001

log-file = "/var/log/kannel/kannel.log"

access-log = "/var/log/kannel/access.log"



group = smsbox

smsbox-id = smsbox

bearerbox-host = 127.0.0.1

sendsms-port = 13013

global-sender = 13013



group = sqlbox

id = sqlbox-db

smsbox-id = sqlbox

bearerbox-host = localhost

bearerbox-port = 13001

smsbox-port = 13005

sql-log-table = sms_sent

sql-insert-table = sms_send

log-file = "/var/log/kannel/sqlbox.log"



group = oracle-connection

id = sqlbox-db

username = scott

password = tiger

tnsname = //127.0.0.1:1521/kanneldb

max-connections = 1



group = smsc

smsc = smpp

smsc-id = SMPP-RX

host = x.x.x.x

receive-port = 8324

#port = 8324

#transceiver-mode = true

smsc-username = smppUser

smsc-password = smppPasswd

system-type = default

interface-version = 34

enquire-link-interval = 30

dest-addr-ton = 1

dest-addr-npi = 1