switch_port_t port = 0;
switch_memory_pool_t *pool = NULL;
char *error = "";
+ char *argv[3] = { 0 };
+ char *mycmd = NULL;
ip = ip_buf;
return SWITCH_STATUS_SUCCESS;
}
- stun_ip = strdup(cmd);
+ mycmd = strdup(cmd);
+ switch_split(mycmd, ' ', argv);
+
+ stun_ip = argv[0];
+
switch_assert(stun_ip);
+ port = argv[1] ? atoi(argv[1]) : 0;
+
if ((p = strchr(stun_ip, ':'))) {
int iport;
*p++ = '\0';
}
switch_core_destroy_memory_pool(&pool);
- free(stun_ip);
+ switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS;
}