zap_span_t *boost_spans[ZAP_MAX_PHYSICAL_SPANS_PER_LOGICAL_SPAN];
zap_span_t *boost_span = NULL;
unsigned boosti = 0;
+ unsigned int i = 0;
memset(boost_spans, 0, sizeof(boost_spans));
memset(&globals, 0, sizeof(globals));
/* start all boost spans now that we're done configuring. Unfortunately at this point boost modules have the limitation
* of needing all spans to be configured before starting them */
- unsigned i = 0;
for ( ; i < boosti; i++) {
boost_span = boost_spans[i];
zap_log(ZAP_LOG_DEBUG, "Starting boost span %d\n", boost_span->span_id);
chan->native_codec = chan->effective_codec = ZAP_CODEC_ULAW;
}
- err = sangoma_tdm_get_hw_dtmf(chan->sockfd, &tdm_api);
- if (err > 0) {
+ //err = sangoma_tdm_get_hw_dtmf(chan->sockfd, &tdm_api);
+ //if (err > 0) {
err = sangoma_tdm_enable_dtmf_events(chan->sockfd, &tdm_api);
if (err == 0) {
zap_channel_set_feature(chan, ZAP_CHANNEL_FEATURE_DTMF_DETECT);
dtmf = "hardware";
}
- }
+ //}
}
#if 0
}
-static inline void *zap_std_malloc(void *pool, zap_size_t size)
+static __inline__ void *zap_std_malloc(void *pool, zap_size_t size)
{
void *ptr = malloc(size);
+ pool = NULL; /* fix warning */
zap_assert(ptr != NULL, NULL, "Out of memory");
return ptr;
}
-static inline void *zap_std_calloc(void *pool, zap_size_t elements, zap_size_t size)
+static __inline__ void *zap_std_calloc(void *pool, zap_size_t elements, zap_size_t size)
{
void *ptr = calloc(elements, size);
+ pool = NULL;
zap_assert(ptr != NULL, NULL, "Out of memory");
return ptr;
}
-static inline void zap_std_free(void *pool, void *ptr)
+static __inline__ void zap_std_free(void *pool, void *ptr)
{
+ pool = NULL;
+ zap_assert(ptr != NULL, , "Attempted to free null pointer");
free(ptr);
}
OZ_DECLARE_DATA zap_memory_handler_t g_zap_mem_handler =
{
- .pool = NULL,
- .malloc = zap_std_malloc,
- .calloc = zap_std_calloc,
- .free = zap_std_free
+ /*.pool =*/ NULL,
+ /*.malloc =*/ zap_std_malloc,
+ /*.calloc =*/ zap_std_calloc,
+ /*.free =*/ zap_std_free
};
OZ_DECLARE_DATA zap_crash_policy_t g_zap_crash_policy = ZAP_CRASH_NEVER;
OZ_DECLARE(void) zap_channel_replace_token(zap_channel_t *zchan, const char *old_token, const char *new_token)
{
- int i;
+ unsigned int i;
if (zchan->token_count) {
for(i = 0; i < zchan->token_count; i++) {
OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *condition, int ms)
{
- zap_assert(condition != NULL, ZAP_FAIL, "Condition is null!\n");
#ifdef WIN32
DWORD res = 0;
- res = WaitForSingleObject(condition->condition, waitms > 0 ? waitms : INFINITE);
+#endif
+ zap_assert(condition != NULL, ZAP_FAIL, "Condition is null!\n");
+#ifdef WIN32
+ res = WaitForSingleObject(condition->condition, ms > 0 ? ms : INFINITE);
switch (res) {
case WAIT_ABANDONED:
case WAIT_TIMEOUT:
return ZAP_TIMEOUT;
case WAIT_FAILED:
return ZAP_FAIL;
- defaul:
- zap_log(ZAP_LOG_ERROR, "Error waiting for openzap condition event\n");
- return ZAP_FAIL;
+ default:
+ zap_log(ZAP_LOG_ERROR, "Error waiting for openzap condition event (WaitForSingleObject returned %d)\n", res);
}
#else
int res = 0;