Re: dynamic rescan of SMSC configuration
Alejandro Guerrieri <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Manish, Please send a diff -u of what you've done and we'll take a look at it in context. Also please base it on the latest CVS HEAD. Regards, -- Alejandro Guerrieri [email protected] On 19/06/2009, at 10:03, Manish Nema wrote: > Earlier I have posted the requirement for dynamic rescan of SMSC > configuration at kannel users mail group, > > Thanks Alejandro for all help. > > I thought to write few lines for the requirements, here is how I > have done that > > 1) in bb_smscconn.c i have created a function int rescan_smsc(), > please find the attached bb_smscconn.c > > 2) created one global Octstr* gCfgFilename in bearerbox.c and > initialize it in main > if (argv[cf_index] == NULL) > { > gCfgFilename = octstr_create("kannel.conf"); > filename = octstr_create("kannel.conf"); > } > else > { > gCfgFilename = octstr_create(argv[cf_index]); > filename = octstr_create(argv[cf_index]); > } > > This is to store configuration file name on bearbox startup > > 3) added following in bb_http.c > > a) added > { "reload-smsc",httpd_reload_smscs }, > in httpd_commands > > b) created function httpd_reload_smscs > > static Octstr *httpd_reload_smscs(List *cgivars, int > status_type) > { > Octstr *reply; > if ((reply = httpd_check_authorization(cgivars, 0))!= > NULL) return reply; > if ((reply = httpd_check_status())!= NULL) return reply; > > if (rescan_smsc() == -1) > return octstr_create("Could not re-load SMSC > configuration"); > else > return octstr_create("Successfully rescanned SMSC > configuration"); > > > } > > I am not sure that if the implementation of rescan_smsc() is 100% > correct/valid/safe, I request all the expert/developers to please > give their suggestion/feedback. > > It wish if this requirement can be implemented in future releases of > the kannel. > > Thanks, > Manish Nema > > > > > <bb_smscconn.c>