char * descXML;
int descXMLsize = 0;
struct UPNPDev * dev;
+ int ndev = 0;
int state; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */
if(!devlist)
{
lanaddr, lanaddrlen);
if(descXML)
{
+ ndev++;
memset(data, 0, sizeof(struct IGDdatas));
memset(urls, 0, sizeof(struct UPNPUrls));
parserootdesc(descXML, descXMLsize, data);
#include <stdarg.h>
-
-#ifdef __APPLE__
-#include <strings.h>
-#else
#include <string.h>
-#endif
#include "xmlrpc_config.h"
#include "c_util.h"
/* Copyright information is at end of file */
#define _XOPEN_SOURCE 600 /* Make sure strdup() is in <string.h> */
-#ifdef __APPLE__
-#define _DARWIN_C_SOURCE
-#endif
#define _BSD_SOURCE /* Make sure setgroups()is in <grp.h> */
#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#ifdef __APPLE__
-#include <sys/wait.h>
-#else
#include <wait.h>
-#endif
#include <signal.h>
#include "xmlrpc_config.h"
#define _XOPEN_SOURCE 600 /* Make sure strdup() is in <string.h> */
-#ifdef __APPLE__
-#define _DARWIN_C_SOURCE
-#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* But only when HAVE_ASPRINTF */
#endif
switch_status_t conference_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
{
+ int count = 0;
switch_hash_index_t *hi;
void *val;
switch_xml_t x_conference, x_conferences;
x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
switch_assert(conference);
+ count++;
conference_xlist(conference, x_conference, off);
}
} else {
x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
switch_assert(conference);
-
+ count++;
conference_xlist(conference, x_conference, off);
}
#endif
int wrote;
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
- (void)wrote;
+ wrote++;
close(fd);
} else {
char ebuf[512] = { 0 };
char *string = NULL;
switch_channel_t *channel;
switch_core_session_t *use_session = act->session;
+ int x = 0;
char *flags = "";
if (act->target == DIGIT_TARGET_PEER || act->target == DIGIT_TARGET_BOTH) {
}
top:
+ x++;
string = switch_core_session_strdup(use_session, act->string);
exec = 0;
switch_hash_index_t *hi;
void *val;
const void *vvar;
+ int c = 0;
+ int ac = 0;
const char *header = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
if (argc > 0) {
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
if (strcmp(vvar, profile->name)) {
+ ac++;
stream->write_function(stream, "<alias>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</alias>\n", vvar, "alias",
profile->name, "ALIASED");
} else {
profile->inuse);
}
+ c++;
+
for (gp = profile->gateways; gp; gp = gp->next) {
switch_assert(gp->state < REG_STATE_LAST);
stream->write_function(stream, "<gateway>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</gateway>\n",
* <dt>-6</dt>
* <dd>Query IP6 addresses (AAAA records).
* </dd>
+ * <dt>-v</dt>
+ * <dd>Be verbatim.
+ * </dd>
* <dt></dt>
* <dd>
* </dd>
switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
{
- int o_sctp = 1, o_tls_sctp = 1;
+ int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
int family = 0, multiple = 0;
char const *string;
url_t *uri = NULL;
}
while (argv[i] && argv[i][0] == '-') {
- if (strcmp(argv[i], "-6") == 0) {
+ if (strcmp(argv[i], "-v") == 0) {
+ o_verbatim++;
+ } else if (strcmp(argv[i], "-6") == 0) {
dig->ip6 = ++family;
} else if (strcmp(argv[i], "-4") == 0) {
dig->ip4 = ++family;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Event Thread Started\n");
while (mod_sofia_globals.running == 1) {
+ int count = 0;
if (switch_queue_pop(mod_sofia_globals.presence_queue, &pop) == SWITCH_STATUS_SUCCESS) {
switch_event_t *event = (switch_event_t *) pop;
}
switch_event_destroy(&event);
+ count++;
}
}
{
char delim = ',';
char *cur, *next;
+ int count = 0;
char *edup;
if (!zstr(str)) {
delim = ' ';
}
- for (cur = edup; cur;) {
+ for (cur = edup; cur; count++) {
if ((next = strchr(cur, delim))) {
*next++ = '\0';
}
{
verto_profile_t *profile = NULL;
jsock_t *jsock;
+ int cp = 0;
+ int cc = 0;
const char *header = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
int i;
stream->write_function(stream, "<profile>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</profile>\n", profile->name, "profile", tmpurl, (profile->running) ? "RUNNING" : "DOWN");
switch_safe_free(tmpurl);
}
+ cp++;
switch_mutex_lock(profile->mutex);
for(jsock = profile->jsock_head; jsock; jsock = jsock->next) {
char *tmpname = switch_mprintf("%s@%s", jsock->id, jsock->domain);
stream->write_function(stream, "<client>\n<profile>%s</profile>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s (%s)</state>\n</client>\n", profile->name, tmpname, "client", jsock->name,
(!zstr(jsock->uid)) ? "CONN_REG" : "CONN_NO_REG", (jsock->ptype & PTYPE_CLIENT_SSL) ? "WSS": "WS");
+ cc++;
switch_safe_free(tmpname);
}
switch_mutex_unlock(profile->mutex);
char *loglevel = switch_event_get_header(stream->param_event, "loglevel");
switch_memory_pool_t *pool;
char *next, *cur;
- uint32_t key_count = 0;
+ uint32_t count = 0, key_count = 0;
uint8_t custom = 0;
char *edup;
delim = ' ';
}
- for (cur = edup; cur;) {
+ for (cur = edup; cur; count++) {
switch_event_types_t type;
if ((next = strchr(cur, delim))) {
if (allowed_events) {
char delim = ',';
char *cur, *next;
- int custom = 0;
+ int count = 0, custom = 0, key_count = 0;
switch_set_flag(listener, LFLAG_AUTH_EVENTS);
delim = ' ';
}
- for (cur = edup; cur;) {
+ for (cur = edup; cur; count++) {
switch_event_types_t type;
if ((next = strchr(cur, delim))) {
if (custom) {
switch_core_hash_insert(listener->allowed_event_hash, cur, MARKER);
} else if (switch_name_event(cur, &type) == SWITCH_STATUS_SUCCESS) {
+ key_count++;
if (type == SWITCH_EVENT_ALL) {
uint32_t x = 0;
switch_set_flag(listener, LFLAG_ALL_EVENTS_AUTHED);
if (allowed_api) {
char delim = ',';
char *cur, *next;
+ int count = 0;
switch_snprintf(api_reply, sizeof(api_reply), "Allowed-API: %s\n", allowed_api);
delim = ' ';
}
- for (cur = edup; cur;) {
+ for (cur = edup; cur; count++) {
if ((next = strchr(cur, delim))) {
*next++ = '\0';
}
} else if (!strncasecmp(cmd, "nixevent", 8)) {
char *next, *cur;
- uint32_t key_count = 0;
+ uint32_t count = 0, key_count = 0;
uint8_t custom = 0;
strip_cr(cmd);
cur = cmd + 8;
if ((cur = strchr(cur, ' '))) {
- for (cur++; cur;) {
+ for (cur++; cur; count++) {
switch_event_types_t type;
if ((next = strchr(cur, ' '))) {
#endif
int wrote;
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
- (void)wrote;
+ wrote++;
close(fd);
} else {
char ebuf[512] = { 0 };
#endif
int wrote;
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
- (void)wrote;
+ wrote++;
close(fd);
} else {
char ebuf[512] = { 0 };
switch_channel_t *channel = switch_core_session_get_channel(session);
const char *val;
const char *crypto = NULL;
- int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, saw_video = 0, got_avp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0, got_text = 0, got_text_crypto = 0, got_msrp = 0;
+ int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, saw_video = 0, got_avp = 0, got_video_avp = 0, got_video_savp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0, got_text = 0, got_text_crypto = 0, got_msrp = 0;
int scrooge = 0;
sdp_parser_t *parser = NULL;
sdp_session_t *sdp;
if (m->m_proto == sdp_proto_srtp || m->m_proto == sdp_proto_extended_srtp) {
if (m->m_type == sdp_media_audio) {
got_savp++;
+ } else {
+ got_video_savp++;
}
} else if (m->m_proto == sdp_proto_rtp) {
if (m->m_type == sdp_media_audio) {
got_avp++;
+ } else {
+ got_video_avp++;
}
} else if (m->m_proto == sdp_proto_udptl) {
got_udptl++;
switch_status_t status;
switch_frame_t *read_frame = NULL;
switch_media_handle_t *smh;
- uint32_t loops = 0, xloops = 0;
+ uint32_t loops = 0, xloops = 0, vloops = 0;
switch_image_t *blank_img = NULL;
switch_frame_t fr = { 0 };
unsigned char *buf = NULL;
continue;
}
+ vloops++;
+
send_blank = blank_enabled || switch_channel_test_flag(channel, CF_VIDEO_ECHO);
if (switch_channel_test_flag(channel, CF_VIDEO_READY) && !switch_test_flag(read_frame, SFF_CNG)) {
switch_size_t len;
const char *i;
char *o;
- int in_m = 0, slash = 0;
+ int in_m = 0, m_tally = 0, slash = 0;
int number = 0, skip = 0;
int remove = !strcasecmp(cmd, "remove");
int only = !strcasecmp(cmd, "only");
if (*i == 'm' && *(i+1) == '=') {
in_m = 1;
+ m_tally++;
}
if (in_m) {
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_io_event_hook_video_read_frame_t *ptr;
+ uint32_t loops = 0;
switch_media_handle_t *smh;
int is_keyframe = 0;
top:
+ loops++;
+
if (switch_channel_down_nosig(session->channel)) {
return SWITCH_STATUS_FALSE;
}
{
switch_threadattr_t *thd_attr;
uint32_t index = 0;
+ int launched = 0;
uint32_t sanity = 200;
switch_memory_pool_t *pool = RUNTIME_POOL;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Create additional event dispatch thread %d\n", index);
}
+ launched++;
}
SOFT_MAX_DISPATCH = index;
int sleep_val_i = 250;
int eof = 0;
switch_size_t bread = 0;
+ int l16 = 0;
switch_codec_implementation_t read_impl = { 0 };
char *file_dup;
char *argv[128] = { 0 };
arg_recursion_check_start(args);
+ if (!zstr(read_impl.iananame) && !strcasecmp(read_impl.iananame, "l16")) {
+ l16++;
+ }
+
if (play_delimiter) {
file_dup = switch_core_session_strdup(session, file);
argc = switch_separate_string(file_dup, play_delimiter, argv, (sizeof(argv) / sizeof(argv[0])));
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_core_thread_session_t *ts = obj;
switch_loadable_module_t *module = ts->objs[0];
+ int restarts;
switch_assert(thread != NULL);
switch_assert(module != NULL);
- for (; status != SWITCH_STATUS_TERM && !module->shutting_down;) {
+ for (restarts = 0; status != SWITCH_STATUS_TERM && !module->shutting_down; restarts++) {
status = module->switch_module_runtime();
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Thread ended for %s\n", module->module_interface->module_name);
{
int was_blocking = 0;
switch_size_t bytes;
+ uint32_t flushed = 0;
switch_size_t bytes_out = 0;
if (!switch_rtp_ready(rtp_session)) {
#endif
}
+ flushed++;
+
rtp_session->stats.inbound.raw_bytes += bytes;
rtp_session->stats.inbound.flush_packet_count++;
rtp_session->stats.inbound.packet_count++;
} else {
if (tfd > -1 && globals.RUNNING == 1) {
uint64_t exp;
- read(tfd, &exp, sizeof(exp));
- (void)exp;
+ int r;
+ r = read(tfd, &exp, sizeof(exp));
+ r++;
} else {
switch_time_t timediff = runtime.reference - ts;
static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t *orig)
{
switch_frame_node_t *np;
+ int x = 0;
switch_mutex_lock(fb->mutex);
for (np = fb->head; np; np = np->next) {
+ x++;
+
if (!np->inuse && ((orig->packet && np->frame->packet) || (!orig->packet && !np->frame->packet))) {
if (np == fb->head) {