cleanup of mmsc conf reader
This commit is contained in:
parent
71c19b6b30
commit
824b57f35f
|
@ -168,29 +168,23 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays)
|
|||
user = _mms_cfg_getx(grp, octstr_imm("sendsms-username"));
|
||||
pass = _mms_cfg_getx(grp, octstr_imm("sendsms-password"));
|
||||
from = mms_cfg_get(grp, octstr_imm("sendsms-global-sender"));
|
||||
|
||||
if (user && octstr_len(user) > 1)
|
||||
octstr_url_encode(user);
|
||||
if (pass && octstr_len(pass) > 1)
|
||||
octstr_url_encode(pass);
|
||||
if (from && octstr_len(from) > 1)
|
||||
octstr_url_encode(from);
|
||||
|
||||
|
||||
i = octstr_search_char(m->sendsms_url, '?', 0); /* If ? is in there, omit below. */
|
||||
|
||||
octstr_format_append(m->sendsms_url,
|
||||
(from && octstr_len(from) > 1) ?
|
||||
"%susername=%S&password=%S&from=%S" :
|
||||
"%susername=%S&password=%S",
|
||||
(i >= 0) ? "" : "?",
|
||||
user,
|
||||
pass,from);
|
||||
"%sfrom=%E" : "%s_dummy=x",
|
||||
(i >= 0) ? "" : "?", from);
|
||||
|
||||
if (user && octstr_len(user) > 0)
|
||||
octstr_format_append(m->sendsms_url,
|
||||
"&username=%E&password=%E",
|
||||
user, pass);
|
||||
m->system_user = octstr_format("system-user@%S",
|
||||
m->hostname);
|
||||
octstr_destroy(user);
|
||||
octstr_destroy(pass);
|
||||
if (from) octstr_destroy(from);
|
||||
octstr_destroy(from);
|
||||
|
||||
mms_cfg_get_int(grp, octstr_imm("mms-port"), &port);
|
||||
|
||||
|
|
Loading…
Reference in New Issue