Re: smsc_smpp.c - reconnection/enquiry timings

Alan McNatty <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <1021337867.29967.3.camel@euclid>
Ok - here's a couple of quick patches which I will be testing but have
posted for comment. I've added the 3 vars into the smpp sturcture and
set to SMPP_ vars if not in config (also required patch for
gwlib/cfg.def which is also required). Comments, etc always appreciated.
Cheers,
Alan


On Tue, 2002-05-14 at 08:51, Alan McNatty wrote:
> Sounds like a plan - will submit a quick patch shortly.
> Cheers,
> Alan
> 
> On Mon, 2002-05-13 at 23:54, Alex Judd wrote:
> > These values are currently hardwire in and it would be easy to export them 
> > out to the configuration level if need be. Reasonable idea in my opinion 
> > as I'm never a fan of hard wire values.
> > 
> > I would suggest we do a 'if defined in config file use that value else use 
> > a default value of x' so that only the users that need this ability have 
> > to define it.
> > 
> > Alex
> > 
> > On Fri, 10 May 2002, Aarno Syvänen wrote:
> > 
> > > Can you use configuration variables instead ?
> > > 
> > > Aarno
> > > ----- Original Message ----- 
> > > From: "Alan McNatty" <[email protected]>
> > > To: "Kannel Dev" <[email protected]>
> > > Sent: Monday, May 13, 2002 7:58 AM
> > > Subject: smsc_smpp.c - reconnection/enquiry timings
> > > 
> > > 
> > > > Hello,
> > > > 
> > > > Our local friendly telco who alow us to smpp to their smsc are
> > > > interested in being able to control the kannel <-> smsc
> > > > reconnection/enquiry timings (mainly in testing environment which can be
> > > > up and down).
> > > > 
> > > > Consequently I would like to be able to specify the SMPP_ constants
> > > > (below) via the smpp config options (default as below obviously). Does
> > > > this sound like a resonable thing to do? If so I'm happy to work towards
> > > > supplying a patch (post to list or to xyz?). 
> > > > 
> > > > <snip smsc_smpp.c>
> > > > 
> > > > #define SMPP_ENQUIRE_LINK_INTERVAL  30.0
> > > > #define SMPP_MAX_PENDING_SUBMITS    10
> > > > #define SMPP_RECONNECT_DELAY        10.0
> > > > 
> > > > Cheers,
> > > > Alan
> > > > 
> > > > -- 
> > > > Alan McNatty -- Catalyst IT Ltd -- http://www.catalyst.net.nz
> > > >   Level 2, 150-154 Willis St, PO Box 11-053, Wellington, NZ
> > > > Mob: +64 21-312136, DDI: +64 4 9167203, Office: +64 4 4992267
> > > > 
> > > > ... error accessing whit
> > > > Segmentation fault (core dumped) 
> > > > 
> > > > 
> > > 
> > > 
> > 
> > -- 
> > Alex Judd
> > http://www.skywire.co.uk
> > 
> -- 
> Alan McNatty -- Catalyst IT Ltd -- http://www.catalyst.net.nz
>   Level 2, 150-154 Willis St, PO Box 11-053, Wellington, NZ
> Mob: +64 21-312136, DDI: +64 4 9167203, Office: +64 4 4992267
> 
> ... error accessing whit
> Segmentation fault (core dumped) 
> 
-- 
Alan McNatty -- Catalyst IT Ltd -- http://www.catalyst.net.nz
  Level 2, 150-154 Willis St, PO Box 11-053, Wellington, NZ
Mob: +64 21-312136, DDI: +64 4 9167203, Office: +64 4 4992267

... error accessing whit
Segmentation fault (core dumped)
smsc_smpp.c-patch (text/plain, 1.8 KB)
43a44
> 
45c46
<  * Some defaults.
---
>  * Some constants.
52a54
> 
80,82d81
<     long enquire_link_interval;
<     long max_pending_submits;
<     long reconnect_delay;
93,95d91
<                          int enquire_link_interval, 
<                          int max_pending_submits, 
<                          int reconnect_delay,
121,123d116
<     smpp->enquire_link_interval = enquire_link_interval;
<     smpp->max_pending_submits = max_pending_submits; 
<     smpp->reconnect_delay = reconnect_delay;
313c306
<     if (date_universal_now() - *last_sent < smpp->enquire_link_interval)
---
>     if (date_universal_now() - *last_sent < SMPP_ENQUIRE_LINK_INTERVAL)
349c342
<     while (*pending_submits < smpp->max_pending_submits ) {
---
>     while (*pending_submits < SMPP_MAX_PENDING_SUBMITS) {
785c778
< 	    gwthread_sleep(smpp->reconnect_delay);
---
> 	    gwthread_sleep(SMPP_RECONNECT_DELAY);
794c787
< 	    timeout = last_enquire_sent + smpp->enquire_link_interval;
---
> 	    timeout = last_enquire_sent + SMPP_ENQUIRE_LINK_INTERVAL 
912,914c905
<     long enquire_link_interval;
<     long max_pending_submits;
<     long reconnect_delay;
---
> 
943,951d933
<     /* Check for timings */
< 
<     if (cfg_get_integer(&enquire_link_interval, grp, octstr_imm("enquire-link-interval")) == -1)
<     	enquire_link_interval = SMPP_ENQUIRE_LINK_INTERVAL;
<     if (cfg_get_integer(&max_pending_submits, grp, octstr_imm("max-pending-submits")) == -1)
<     	max_pending_submits = SMPP_MAX_PENDING_SUBMITS;
<     if (cfg_get_integer(&reconnect_delay, grp, octstr_imm("reconnect-delay")) == -1)
<     	reconnect_delay = SMPP_RECONNECT_DELAY;
< 
982,984c964
<                        dest_addr_npi, enquire_link_interval, 
<                        max_pending_submits, reconnect_delay, 
<                        my_number);
---
>                        dest_addr_npi, my_number);
cfg.def-patch (text/plain, 166 B)
211,215d210
<     OCTSTR(enquire-link-interval)
<     OCTSTR(max-pending-submits)
<     OCTSTR(reconnect-delay)
<     OCTSTR(idle-timeout)
<     OCTSTR(idle-timeout)
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.