if (ast)
strncpy(ast_text, ast->name, sizeof(ast_text)-1);
ast_text[sizeof(ast_text)-1] = '\0';
-
- ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer);
+
+printf("\n[call=%s ast=%s] %s\n", call_text, ast_text, buffer);
+// ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer);
ast_mutex_unlock(&log_lock);
lock_debug("l");
{
union parameter newparam;
struct ast_channel *ast = call->ast;
- const char *tmp;
+// const char *tmp;
if (!call->ast || !call->ref)
return;
default:
newparam.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
}
- tmp = pbx_builtin_getvar_helper(ast, "LCR_TRANSFERCAPABILITY");
- if (tmp && *tmp)
- ast->transfercapability = atoi(tmp);
+#warning DISABLED DUE TO DOUBLE LOCKING PROBLEM
+// tmp = pbx_builtin_getvar_helper(ast, "LCR_TRANSFERCAPABILITY");
+// if (tmp && *tmp)
+// ast->transfercapability = atoi(tmp);
newparam.setup.capainfo.bearer_capa = ast->transfercapability;
newparam.setup.capainfo.bearer_mode = INFO_BMODE_CIRCUIT;
if (call->hdlc)
if (message_type == MESSAGE_BCHANNEL) {
switch(param->bchannel.type) {
case BCHANNEL_ASSIGN:
+lock_debug("rx1");
CDEBUG(NULL, NULL, "Received BCHANNEL_ASSIGN message. (handle=%08lx) for ref %d\n", param->bchannel.handle, ref);
if ((bchannel = find_bchannel_handle(param->bchannel.handle))) {
CERROR(NULL, NULL, "bchannel handle %x already assigned.\n", (int)param->bchannel.handle);
CERROR(NULL, NULL, "Socket received illegal message %d.\n", msg.message);
goto error;
}
+ lock_debug("handleX");
receive_message(msg.u.msg.type, msg.u.msg.ref, &msg.u.msg.param);
+ lock_debug("handleY");
} else {
CERROR(NULL, NULL, "Socket failed (errno %d).\n", errno);
goto error;
struct ast_frame fr;
char *p;
+again:
call = call_first;
while(call) {
p = call->queue_string;
ast = call->ast;
if (*p && ast) {
lock_debug("A1+");
- ast_channel_lock(ast);
+ if (ast_channel_trylock(ast)) {
+ lock_debug("<trylock failed>");
+ ast_mutex_unlock(&chan_lock);
+ usleep(1000);
+ lock_debug("A1++");
+ ast_mutex_lock(&chan_lock);
+ lock_debug("A1+-");
+ goto again;
+ }
lock_debug("A1-");
while(*p) {
switch (*p) {
ast_playtones_start(ast,0,dtmf_tones[15], 0);
else {
/* not handled */
- ast_log(LOG_DEBUG, "Unable to handle DTMF tone "
- "'%c' for '%s'\n", digit, ast->name);
+// ast_log(LOG_DEBUG, "Unable to handle DTMF tone "
+// "'%c' for '%s'\n", digit, ast->name);
}
}