DLR Concurrency Problem (got DLR but could not find message or was not interested in it)

2011-02-09 Thread Sayed Hadi Rastgou Haghi
Dear Kannel Developers,

I found a concurrency BUG in DLR Code.


2011-02-09 11:30:26 [29361] [27] DEBUG: DLR[mysql]: Looking for DLR
smsc=mtn1, ts=1613732592, dst=989372474050, type=2
2011-02-09 11:30:26 [29361] [27] DEBUG: sql: SELECT mask, service, url,
source, destination, boxc FROM dlr WHERE smsc='SMSC' AND ts='1613732592';
2011-02-09 11:30:26 [29361] [27] ERROR: SMPP[SMSC]: got DLR but could not
find message or was not interested in it id1613732592 dstDST, type2
2011-02-09 11:30:26 [29361] [26] DEBUG: DLR[mysql]: Adding DLR smsc=SMSC,
ts=1613732592, src=SRC, dst=DST, mask=31, boxc=13013
2011-02-09 11:30:26 [29361] [26] DEBUG: sql: INSERT INTO dlr (smsc, ts,
source, destination, service, url, mask, boxc, status) VALUES (...);

*dlr_find* method got calls before *dlr_add!*

-- 
Sincerely,

Sayed Hadi Rastgou Haghi


Re: DLR Concurrency Problem (got DLR but could not find message or was not interested in it)

2011-02-09 Thread Alejandro Guerrieri
It's not a concurrency bug, your aggregator is probably sending the DLR's
deliver_sm before sending the submit_sm_resp.

I've seen it happening on some aggregators (maybe because of their
load-balancers processing the messages on different nodes? Can't tell for
sure).

I have a simple patch that retries the dlr-find a given number of times, but
it poses a performance penalty and it's not intended to be used under heavy
traffic.

Regards,

Alex

On Wed, Feb 9, 2011 at 9:35 AM, Sayed Hadi Rastgou Haghi 
hadi.rast...@gmail.com wrote:

 Dear Kannel Developers,

 I found a concurrency BUG in DLR Code.


 2011-02-09 11:30:26 [29361] [27] DEBUG: DLR[mysql]: Looking for DLR
 smsc=mtn1, ts=1613732592, dst=989372474050, type=2
 2011-02-09 11:30:26 [29361] [27] DEBUG: sql: SELECT mask, service, url,
 source, destination, boxc FROM dlr WHERE smsc='SMSC' AND ts='1613732592';
 2011-02-09 11:30:26 [29361] [27] ERROR: SMPP[SMSC]: got DLR but could not
 find message or was not interested in it id1613732592 dstDST, type2
 2011-02-09 11:30:26 [29361] [26] DEBUG: DLR[mysql]: Adding DLR smsc=SMSC,
 ts=1613732592, src=SRC, dst=DST, mask=31, boxc=13013
 2011-02-09 11:30:26 [29361] [26] DEBUG: sql: INSERT INTO dlr (smsc, ts,
 source, destination, service, url, mask, boxc, status) VALUES (...);

 *dlr_find* method got calls before *dlr_add!*

 --
 Sincerely,

 Sayed Hadi Rastgou Haghi




Routing failed, re-queued

2011-02-09 Thread Abdul Basit
Hi,

I am trying to connect kannel with Nokia CDMA phone 6016i via ttyUSB0.

Problem is that kannel is not connecting with this smsc and always in
connecting status due to which all messages go into queue.

 Kannel bearerbox version `svn-r4858M'. Build `Feb 7 2011 14:57:40',
compiler `4.4.5'. System Linux, release 2.6.35-25-generic, version
#44-Ubuntu SMP Fri Jan 21 17:40:48 UTC 2011, machine i686. Hostname insite,
IP 192.168.3.6. Libxml version 2.7.7. Compiled with MySQL 5.1.49, using
MySQL 5.1.49. Using native malloc.

Status: running, uptime 0d 0h 2m 43s

WDP: received 0 (0 queued), sent 0 (0 queued)

SMS: received 0 (0 queued), sent 0 (*3 queued*), store size -1
SMS: inbound (0.00,0.00,0.00) msg/sec, outbound (0.00,0.00,0.00) msg/sec

DLR: received 0, sent 0
DLR: inbound (0.00,0.00,0.00) msg/sec, outbound (0.00,0.00,0.00) msg/sec
DLR: 0 queued, using internal storage

Box connections:
smsbox:Nokia-6016i, IP 127.0.0.1 (0 queued), (on-line 0d 0h 0m 49s)
SMSC connections:
ttyUSB0[ttyUSB0]AT2[ttyUSB0] (*connecting*, rcvd: sms 0 / dlr 0,
sent: sms 0 / dlr 0, failed 0, queued 0 msgs)


Following is my kannel configuration:

# CORE
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
status-password = foo
log-file = /var/log/kannel/kannel.log
box-deny-ip = *.*.*.*
box-allow-ip = 127.0.0.1
access-log = /var/log/kannel/access.log

# SMSC CONNECTIONS
group = modems
id = nokiaphone
name = Nokia Phone
detect-string = 6016i
need-sleep = true
init-string = ATZ
init-string = ATQ0 V1 E1 S0=0 C1 D2 +FCLASS=0
#init-string = AT+CNMI=1,2,0,1,0
#init-string = AT+CNMI=2,0,0,2,0
keepalive-cmd = AT+CBC;+CSQ
#enable-hwhs = AT+IFC=2,2
message-storage = ME
reset-string = ATZ

group = smsc
smsc = at
smsc-id = ttyUSB0
modemtype = auto
device = /dev/ttyUSB0
speed = 38400
my-number = 012345678
sim-buffering = true
log-file =/var/log/kannel/smsc.log

#-
# SMSBOX SETUP
group = smsbox
smsbox-id = Nokia-6016i
bearerbox-host = 127.0.0.1
sendsms-port = 13013
global-sender = 13013
#sendsms-chars = 0123456789 +-
log-file = /var/log/kannel/smsbox.log
access-log = /var/log/kannel/smsaccess.log

#-
# SEND-SMS USERS
group = sendsms-user
username = tester
password = foobar

#-
# SERVICES
group = sms-service
keyword = default
text = No service specified

Following is bearerbox startup logs  with debug 0

./bearerbox -v 0 smskannel.conf
2011-02-09 20:32:47 [23725] [0] INFO: Debug_lvl = 0, log_file = none,
log_lvl = 0
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 120 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 19 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 19 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 19 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 15 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 7 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 7 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 121 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 3 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] WARNING: DLR: using default 'internal' for
storage type.
2011-02-09 20:32:47 [23725] [0] INFO: DLR using storage type: internal
2011-02-09 20:32:47 [23725] [0] DEBUG: Kannel bearerbox version
`svn-r4858M'.
Build `Feb  7 2011 14:57:40', compiler `4.4.5'.
System Linux, release 2.6.35-25-generic, version #44-Ubuntu SMP Fri Jan 21
17:40:48 UTC 2011, machine i686.
Hostname insite, IP 192.168.3.6.
Libxml version 2.7.7.
Compiled with MySQL 5.1.49, using MySQL 5.1.49.
Using native malloc.

2011-02-09 20:32:47 [23725] [0] INFO: Added logfile
`/var/log/kannel/kannel.log' with level `0'.
2011-02-09 20:32:47 [23725] [0] INFO: Started access logfile
`/var/log/kannel/access.log'.
2011-02-09 20:32:47 [23725] [0] INFO: SSL not supported, no SSL
initialization done.
2011-02-09 20:32:47 [23725] [0] INFO: HTTP: Opening server at port 13000.
2011-02-09 20:32:47 [23725] [0] DEBUG: Started thread 1
(gwlib/fdset.c:poller)
2011-02-09 20:32:47 [23725] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps
to pid 23725.
2011-02-09 20:32:47 [23725] [0] DEBUG: Started thread 2
(gwlib/http.c:server_thread)
2011-02-09 20:32:47 [23725] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread)
maps to pid 23725.
2011-02-09 20:32:47 [23725] [2] DEBUG: HTTP: Including port 13000, fd 8 for
polling in server thread
2011-02-09 20:32:47 [23725] [0] DEBUG: Started thread 3
(gw/bb_http.c:httpadmin_run)
2011-02-09 20:32:47 [23725] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run)
maps to pid 23725.
2011-02-09 20:32:47 [23725] [0] INFO: Mutex gwlib/list.c:136: 1 locks, 0
collisions.
2011-02-09 20:32:47 [23725] [0] DEBUG: starting smsbox 

Re: OpenSMPPBOX getting crashed.

2011-02-09 Thread Anshu Sah
Hi,
Any Solution for me.

Regards
Anshu Sah



On Sun, Feb 6, 2011 at 7:05 PM, Anshu Sah sah.an...@ymail.com wrote:

 Hi rene,

 Hope you are  doing well. I am getting strange issue. my opensmppbox get
 crashed when someone try to connect with wrong configuration. Especially
 when someone don't enter system-type

 Please find the logs below.

 *2011-02-06 18:56:38 [20760] [12] PANIC: gwlib/octstr.c:2488: 
 seems_valid_real: Assertion `ostr != NULL' failed. (Called from 
 gwlib/octstr.c:875:octstr_compare.)

 2011-02-06 18:56:38 [20760] [12] PANIC: 
 /projects/kannel/gateway-svn/addons/opensmppbox/gw/opensmppbox(gw_panic+0x15a)
  [0x4418da]
 2011-02-06 18:56:38 [20760] [12] PANIC: 
 /projects/kannel/gateway-svn/addons/opensmppbox/gw/opensmppbox() [0x442b42]

 2011-02-06 18:56:38 [20760] [12] PANIC: 
 /projects/kannel/gateway-svn/addons/opensmppbox/gw/opensmppbox(octstr_compare+0x20)
  [0x447ba0]
 2011-02-06 18:56:38 [20760] [12] PANIC: 
 /projects/kannel/gateway-svn/addons/opensmppbox/gw/opensmppbox(check_login+0x2e8)
  [0x40d3e8]

 2011-02-06 18:56:38 [20760] [12] PANIC: 
 /projects/kannel/gateway-svn/addons/opensmppbox/gw/opensmppbox() [0x40d768]
 2011-02-06 18:56:38 [20760] [12] PANIC: 
 /projects/kannel/gateway-svn/addons/opensmppbox/gw/opensmppbox() [0x43889e]

 2011-02-06 18:56:38 [20760] [12] PANIC: /lib/libpthread.so.0(+0x69ca) 
 [0x7f3b5fe849ca]
 2011-02-06 18:56:38 [20760] [12] PANIC: /lib/libc.so.6(clone+0x6d) 
 [0x7f3b5f47c70d]***



 Regards
 Anshu Sah