Re: Submitting a patch to Kannel: best practices?

David McCann <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi Nikos--

Yikes, I think I'm even more confused.  I should probably again explain that
I've been a kannel *user* for years, and have found it a wonderful tool for
managing SMPP links out-of-the-box, with no stress whatsoever.  I should
explain my current understanding of Kannel's (1.4.3) architecture, and a
little bit of background about what my current deployment entails.  I'm
eager to submit a patch that's actually useful to the community, but I'm a
complete newcomer when it comes to being a *contributor* to the kannel
codebase.

I've taken a good look at bb_http and found the appropriate place to add new
administration commands.  Indeed, this is where I initially saw my new
functionality being added.  However, I quickly realized that the
translations table (line 111 of smsbox.c, v1.4.3
http://doxygen.kannel.org/de/ddc/smsbox_8c-source.html) resides within the
smsbox process.  I think we're probably talking about the same thing, which
is an "smsbox admin" feature.  My new command was an attempt at including
some admin functionality to the smsbox.

Anyway, let me explain my situation; I'm hoping you can advise on the best
approach:

I have one shortcode, 8500, which delivers messages to two applications.
 Here's a snippet from my config file:

-----BEGIN CONFIG SOURCE-------
##############################
# An "exclusive" application #
##############################
group = sms-service
keyword = default
max-messages = 0
get-url = "
http://myexclusivesite.com/getamessage/?smsc=%i&sender=%p&message=%b"
white-list = "http://myexclusivesite.com/whitelist/"
allowed-receiver-prefix = 8500
concatenation = true
assume-plain-text = true
accept-x-kannel-headers = true
omit-empty = true

#############################
# A "catch-all" application #
#############################
group = sms-service
keyword = default
max-messages = 0
get-url = "
http://everyone-else.com/getamessage/?smsc=%i&sender=%p&message=%b"
allowed-receiver-prefix = 8500
concatenation = true
assume-plain-text = true
accept-x-kannel-headers = true
omit-empty = true
-----END CONFIG SOURCE-------

So, basically, I have one application that should accept only users of the
exclusive application to send MO (incoming) messages.  Everything else gets
routed to a different application.  The complication is that users of the
"exclusive" application can update their contact information (changing the
whitelist), and currently I think the only way to pull in a new whitelist is
to restart the smsbox completely.  My patch is strictly intended to fix
that, in the simplest way possible, as I can't restart smsbox completely
whenever a phone number is updated.

Let me know the best way to incorporate this feature?

Thanks again,
--dm


On Fri, Dec 17, 2010 at 4:49 PM, Nikos Balkanas <[email protected]> wrote:

> Hi David,
>
> Yes. bb has its own black/white lists for incoming MO traffic, similar to
> smsbox's MT. These can be reloaded on the fly through its http admin
> interface. Another very useful feature is that it allows you to change
> log-levels on the fly. Very useful for debugging.
>
> Check gw/bb_http.c: httpd_commands for sources.
>
> I am not talking about bearerbox telling smsbox to reload its lists. I am
> talking for a separate http admin for smsbox, like the one in bb. Otherwise
> you would have major restructuring to get it through the admin *Msg, and it
> is not worth it.
>
> BR,
> Nikos
>
> On Fri, Dec 17, 2010 at 1:07 PM, David McCann <[email protected]>wrote:
>
>> Hi Nikos--
>>
>> Thank you for the promt reply!  I completely agree that this makes more
>> sense as a bearerbox, admin command.  I initially added it as such, but then
>> realized that in fact, all the translations logic sat within the smsbox
>> process, rather than the bearerbox.  Adding it directly as an smsbox command
>> removes any need for any communication between the bearerbox and the smsbox.
>>
>> But I agree it still feels like a hack, in terms of where a user would
>> expect to send a command such as "refresh list."  If you could point me to a
>> pattern in the code where the bearerbox communicates with the smsbox in a
>> similar fashion, it'd be a huge help and I'd be happy to re-submit my patch
>> with it working in that manner.  The current diff is still attached to the
>> feature request, but I've attached it here as well (currently in two
>> patches, src and doc) just for review, as we discuss this alternate
>> approach.
>>
>> In regards to your comment about bearerbox handling this on the fly
>> through its admin HTTP interface...I'm not quite sure I follow?  I know this
>> service-level refreshing functionality doesn't currently exist, are you just
>> referring to similar functionality that exists in bearerbox?  Forgive my
>> confusion.
>>
>> Thanks again,
>> --dm
>>
>>
>> On Fri, Dec 17, 2010 at 1:07 PM, Nikos Balkanas <[email protected]>wrote:
>>
>>> Hi,
>>>
>>> Usually people just post the patch to the devel list with subject: Patch:
>>> <filename>. Patch is attached as a diff of the file(s) from latest svn
>>> sources, followed by a brief description in the body.
>>>
>>> Wrt to your proposed solution, I am not very much in favor. In bearerbox
>>> this is handle on the fly through its admin HTTP interface. I think a
>>> similar approach would be best for smsbox.
>>>
>>>  BR,
>>> Nikos
>>>
>>> On Fri, Dec 17, 2010 at 8:10 AM, David McCann <[email protected]>wrote:
>>>
>>>> Greetings all!
>>>>
>>>> I've been a kannel user for years, but within the past week I've just
>>>> started to work directly with the code.  I had a particular need which I
>>>> couldn't find a good workaround for:
>>>>
>>>> My current deployment with kannel uses whitelisting to dispatch messages
>>>> to various running web applications (at the sms-service group level),
>>>> however users do update their contact information from time to time, meaning
>>>> the whitelist needs to updated, preferrably without the smsbox having to be
>>>> restarted entirely.
>>>>
>>>> I've added a new command to the list of available commands for SMSBox,
>>>> namely /cgi-bin/refreshlist, and (maybe a little overzealously) created an
>>>> issue: https://redmine.kannel.org/issues/584
>>>>
>>>> And submitted my patch there.
>>>>
>>>> Given that I'm pretty new to this community, I'm wondering if anyone can
>>>> advise me on the best/most convenient way to submit a patch for
>>>> incorporation into the code?
>>>>
>>>> Thanks in advance,
>>>> David McCann
>>>> T4D, UNICEF Uganda
>>>>
>>>>
>>>
>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.