提交 f840b2fa authored 作者: Anthony Minessale's avatar Anthony Minessale

convert contrib mods to zstr

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15248 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0f8dc479
...@@ -157,7 +157,7 @@ SWITCH_STANDARD_API(xml_radius_function) ...@@ -157,7 +157,7 @@ SWITCH_STANDARD_API(xml_radius_function)
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (switch_strlen_zero(cmd)) { if (zstr(cmd)) {
goto usage; goto usage;
} }
...@@ -188,7 +188,7 @@ static switch_status_t xml_radius_expand_tag(switch_xml_t xml_in, switch_event_t ...@@ -188,7 +188,7 @@ static switch_status_t xml_radius_expand_tag(switch_xml_t xml_in, switch_event_t
switch_xml_t xml_in_tmp = NULL; switch_xml_t xml_in_tmp = NULL;
int i; int i;
if (switch_strlen_zero(xml_out->name)) { if (zstr(xml_out->name)) {
xml_out->name = strdup(xml_in->name); xml_out->name = strdup(xml_in->name);
} else if (!(xml_out = switch_xml_add_child_d(xml_out, xml_in->name, *off++))) { } else if (!(xml_out = switch_xml_add_child_d(xml_out, xml_in->name, *off++))) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
...@@ -540,7 +540,7 @@ static switch_status_t load_config(void) ...@@ -540,7 +540,7 @@ static switch_status_t load_config(void)
binding->bindings = strdup(bname); binding->bindings = strdup(bname);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML RADIUS Fetch Function [%s]\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML RADIUS Fetch Function [%s]\n",
switch_strlen_zero(bname) ? "N/A" : bname, binding->bindings ? binding->bindings : "all"); zstr(bname) ? "N/A" : bname, binding->bindings ? binding->bindings : "all");
switch_xml_bind_search_function(xml_radius_search, switch_xml_parse_section_string(bname), binding); switch_xml_bind_search_function(xml_radius_search, switch_xml_parse_section_string(bname), binding);
binding = NULL; binding = NULL;
} }
......
...@@ -191,22 +191,22 @@ static switch_status_t load_config(void) ...@@ -191,22 +191,22 @@ static switch_status_t load_config(void)
/* Set defaults for any variables still not set */ /* Set defaults for any variables still not set */
setdefaults: setdefaults:
if (switch_strlen_zero(globals.db_username)) { if (zstr(globals.db_username)) {
set_global_db_username("bandwidth.com"); set_global_db_username("bandwidth.com");
} }
if (switch_strlen_zero(globals.db_password)) { if (zstr(globals.db_password)) {
set_global_db_password("dev"); set_global_db_password("dev");
} }
if (switch_strlen_zero(globals.db_dsn)) { if (zstr(globals.db_dsn)) {
set_global_db_dsn("bandwidth.com"); set_global_db_dsn("bandwidth.com");
} }
if (switch_strlen_zero(globals.percall_action)) { if (zstr(globals.percall_action)) {
set_global_percall_action("hangup"); set_global_percall_action("hangup");
} }
if (switch_strlen_zero(globals.lowbal_action)) { if (zstr(globals.lowbal_action)) {
set_global_lowbal_action("play ding"); set_global_lowbal_action("play ding");
} }
if (switch_strlen_zero(globals.nobal_action)) { if (zstr(globals.nobal_action)) {
set_global_nobal_action("hangup"); set_global_nobal_action("hangup");
} }
...@@ -719,7 +719,7 @@ SWITCH_STANDARD_APP(nibblebill_app_function) ...@@ -719,7 +719,7 @@ SWITCH_STANDARD_APP(nibblebill_app_function)
char *lbuf = NULL; char *lbuf = NULL;
char *argv[3] = { 0 }; char *argv[3] = { 0 };
if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data)) if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
if (!strcasecmp(argv[0], "adjust") && argc == 2) { if (!strcasecmp(argv[0], "adjust") && argc == 2) {
nibblebill_adjust(session, atof(argv[1])); nibblebill_adjust(session, atof(argv[1]));
...@@ -748,9 +748,9 @@ SWITCH_STANDARD_API(nibblebill_api_function) ...@@ -748,9 +748,9 @@ SWITCH_STANDARD_API(nibblebill_api_function)
char *mycmd = NULL, *argv[3] = { 0 }; char *mycmd = NULL, *argv[3] = { 0 };
int argc = 0; int argc = 0;
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) { if (!zstr(cmd) && (mycmd = strdup(cmd))) {
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) { if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
char *uuid = argv[0]; char *uuid = argv[0];
if ((psession = switch_core_session_locate(uuid))) { if ((psession = switch_core_session_locate(uuid))) {
switch_channel_t *channel; switch_channel_t *channel;
......
...@@ -88,7 +88,7 @@ SWITCH_STANDARD_APP(fastsms_function) ...@@ -88,7 +88,7 @@ SWITCH_STANDARD_APP(fastsms_function)
char* text = NULL; char* text = NULL;
const char* originator = switch_channel_get_variable(channel, "fastsms_originator"); const char* originator = switch_channel_get_variable(channel, "fastsms_originator");
if (!switch_strlen_zero(data)) { if (!zstr(data)) {
msisdn = switch_core_session_strdup(session, data); msisdn = switch_core_session_strdup(session, data);
text = strchr(msisdn, ' '); text = strchr(msisdn, ' ');
if (text) if (text)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论