FW: issue 611

kleanthis tsaousis <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>

 Please find attached file containing changes in function int 
 bb_reload_smsc_groups().
 This change is related to issue 611.
 Use it if you think that is useful.
 
 thank you
 k.t
611_issue_changes.txt (text/plain, 1.7 KB)
Hello,

Am sending you the following change for the issue 611:

Changes in file bearerbox. c 

function :

int bb_reload_smsc_groups()
{
  Cfg *cfg;

  debug("bb.sms", 0, "Reloading groups list from disk");
  cfg =  cfg_create(cfg_filename);
  if (cfg_read(cfg) == -1) 
  {
    warning(0, "Error opening configuration file %s", octstr_get_cstr(cfg_filename));
    return -1;
  }
    
  if (smsc_groups != NULL)
   gwlist_destroy(smsc_groups, destroy_group);                   /* kltsa 28/9/2011: NULL replaced by the function that can destroy cfg group.     */
    
   smsc_groups = cfg_remove_multi_group(cfg, octstr_imm("smsc")); /*                  Old code : cfg_get_multi_group(cfg, octstr_imm("smsc"));      */
   cfg_destroy(cfg);                                              /*                  Instead of getting the list of smscs the list will be removed */
                                                                   /*                  and the cfg will be destroyed at the end.                     */
   return 0;                                                        
}                                                             


Definition of function cfg_remove_multi_grout() in function cfg.c

/* kltsa 28/9/2011: New function used for removing a multi group complitelly from a cfg. 
                    This will be used in bb_reload_smsc_groups where cfg needs to be destroyed 
                    but multi group to be extracted first.
*/ 
List *cfg_remove_multi_group(Cfg *cfg, Octstr *name)
{
  List *list;
      
  list = dict_remove(cfg->multi_groups, name);
  if (list == NULL)
   return NULL;    
    
  return list;
}




Also functions definitions should be added in h files.



thank you.
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.