Hi again,

I seem to have found the issue. Its probably pretty difficult to reproduce 
using out-of-the-box Kannel, unless you have many http smsc perhaps....
Perhaps I should post this directly to the dev thread, but since I started it 
here.... ill continue it here.


I added some custom HTTP smsc subtypes, that do a fair bit more reading from 
the config, as well and building lookup tables etc...
Due to this extra processing, it slows down the creation of SMSC, which results 
in a racing condition.

Basically in the code there is a selector function that listens for the MO 
traffic from all the ports. (specifically http.c, function server_thread()) 
This is a blocking call that will wait for incoming data on those ports. The 
problem is that when the config is slow to load, and you have, say 4 SMSC, it 
will only have added 1-2 of the SMSC before it issues the blocking call. Then 
the subsequent ports only get picked up 1 port at a time each time the blocking 
call unblocks.

In other words, the flow ends up being something like:


read smsc1 config with port A
add smsc1 config to selector
read smsc2 config wiht port B
add smsc2 to selector
select starts and blocks waiting on ports A and B
read smsc3 config with port C
read smsc4 config with port D

send request to C  --> ignored (not listening)
send request to A -> selector unblocks, handles request
next selector iteration adds smsc3 to theselector then it blocks again (so 
smsc4 still not wokring)
send request to A -> selector unblocks, handles request
next selector iteration adds smsc4 to theselector then it blocks again

So finally at this point all ports can be used, but basically if you never send 
to the first 1-2 smsc in the config file, its possible to be stuck with blocked 
port forever. 



If anyone has questions, let me know.
== Brian





________________________________
 From: Brian McCavour <[email protected]>
To: Alvaro Cornejo <[email protected]> 
Cc: "[email protected]" <[email protected]> 
Sent: Tuesday, July 16, 2013 1:27:51 PM
Subject: Re: Multiple HTTP smsc MO bug?
 




Hi,

The traffic through the smsbox is working correctly, but it shouldn't be 
relevant to this issue I don't think. Temporarily to debug the issue I've been 
sending invalid credentials, so it shouldn't make it past the bearerbox to the 
smsbox anyway.

The processing of the MO request DOES show up in the logs correctly
starting with: DEBUG: HTTP[smsc_B]: Got request `/cgi-bin/sendsms'


But it doesn't show up until I send the request to A. Its like the request to B 
gets stuck on entry into Kannel. Once I send A, i pushed B through, and then A 
continues after it.

The same thing if I send C, B, A.
C and B will stall, then A triggers all 3 at once.

Also if I switch the order in the config file to C B A. Then C will always work 
in this case, and B and A will sotp working until I send through C.


I have done some custom work on Kannel, so showing you the logs and config 
would be a bit confusing probably, but I never modified any of the network 
layers or http smsc stuff should it should be the cause.
I''ll re-do the config on an out-of-the-box 1.4.3 and re-post the details more 
specifically.

Unless anyone has seen this issue before...?

Thanks
Brian




________________________________
 From: Alvaro Cornejo <[email protected]>
To: Brian McCavour <[email protected]> 
Cc: "[email protected]" <[email protected]> 
Sent: Tuesday, July 16, 2013 12:17:18 PM
Subject: Re: Multiple HTTP smsc MO bug?
 

Hi

Can you post some logs and your send-sms box? The reply is an
autoreply from kannel or by your own app?

Regards

Alvaro

On 7/16/13, Brian McCavour <[email protected]> wrote:
> Hi,
>
> I have multiple generic http smsc configured, and I just noticed that only
> the first smsc in the BB configuration seems to work correctly for MO.
> For instance if I have
>
> group = smsc
> smsc = http
> system-type = generic
> smsc-id = A
>
> port = 3007
>
> ...
> group = smsc
> smsc = http
> system-type = generic
> smsc-id = B
>
> port = 3008
> ...
> group = smsc
> smsc = http
> system-type = generic
> smsc-id = C
>
> port = 3009
>
> ...
>
> If I send a request to A it works fine.
>
> If I send a request to B, I get no response.
>
> If I then send another request to A, I get the response to both A and B.
> If I don't send another message to A, I never get a
 response.
>
> According to me tcpdump, the port seems to be listening correctly... just
> not sure why Kannel is not replying. Wondering it maybe there is a bug or a
> deadlock or something in Kannel for multiple http smsc for MO?
>
> I'm using Kannel 1.4.3.
>
> Thanks,
> Brian


-- 
|-----------------------------------------------------------------------------------------------------------------|
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.NET www.smsglobal.com.mx y
www.pravcom.com

Reply via email to