ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer);
ast_mutex_unlock(&log_lock);
ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer);
ast_mutex_unlock(&log_lock);
/* open socket the first time */
handle_retry(NULL, NULL, 0);
/* open socket the first time */
handle_retry(NULL, NULL, 0);
CERROR(NULL, NULL, "Thread exit.\n");
ast_mutex_unlock(&chan_lock);
CERROR(NULL, NULL, "Thread exit.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
CDEBUG(NULL, NULL, "Received request from Asterisk. (data=%s)\n", (char *)data);
ast_mutex_lock(&chan_lock);
CDEBUG(NULL, NULL, "Received request from Asterisk. (data=%s)\n", (char *)data);
if (lcr_sock < 0) {
CERROR(NULL, NULL, "Rejecting call from Asterisk, because LCR not running.\n");
ast_mutex_unlock(&chan_lock);
if (lcr_sock < 0) {
CERROR(NULL, NULL, "Rejecting call from Asterisk, because LCR not running.\n");
ast_mutex_unlock(&chan_lock);
apply_opt(call, (char *)opt);
ast_mutex_unlock(&chan_lock);
apply_opt(call, (char *)opt);
ast_mutex_unlock(&chan_lock);
if (!call) {
CERROR(NULL, ast, "Received call from Asterisk, but call instance does not exist.\n");
ast_mutex_unlock(&chan_lock);
if (!call) {
CERROR(NULL, ast, "Received call from Asterisk, but call instance does not exist.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received digit from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received digit from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
"Received digit from Asterisk, "
"but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
"Received digit from Asterisk, "
"but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
if (inband_dtmf) {
CDEBUG(call, ast, "-> sending '%c' inband.\n", digit);
if (inband_dtmf) {
CDEBUG(call, ast, "-> sending '%c' inband.\n", digit);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received answer from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received answer from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
// send_message(MESSAGE_ENABLEKEYPAD, call->ref, &newparam);
ast_mutex_unlock(&chan_lock);
// send_message(MESSAGE_ENABLEKEYPAD, call->ref, &newparam);
ast_mutex_unlock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received hangup from Asterisk, but no call instance exists.\n");
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received hangup from Asterisk, but no call instance exists.\n");
if (!(f->subclass & ast->nativeformats))
CDEBUG(NULL, ast, "Unexpected format.\n");
if (!(f->subclass & ast->nativeformats))
CDEBUG(NULL, ast, "Unexpected format.\n");
return -1;
}
if (call->bchannel && f->samples)
bchannel_transmit(call->bchannel, *((unsigned char **)&(f->data)), f->samples);
ast_mutex_unlock(&chan_lock);
return -1;
}
if (call->bchannel && f->samples)
bchannel_transmit(call->bchannel, *((unsigned char **)&(f->data)), f->samples);
ast_mutex_unlock(&chan_lock);
return NULL;
} else if (call->rebuffer && call->framepos < 160) {
/* Not a complete frame, so we send a null-frame */
ast_mutex_unlock(&chan_lock);
return NULL;
} else if (call->rebuffer && call->framepos < 160) {
/* Not a complete frame, so we send a null-frame */
ast_mutex_unlock(&chan_lock);
call->read_fr.delivery = ast_tv(0,0);
*((unsigned char **)&(call->read_fr.data)) = call->read_buff;
ast_mutex_unlock(&chan_lock);
call->read_fr.delivery = ast_tv(0,0);
*((unsigned char **)&(call->read_fr.data)) = call->read_buff;
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received indicate from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received indicate from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received fixup from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received fixup from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
return -1;
}
CDEBUG(call, ast, "Received fixup from Asterisk.\n");
call->ast = ast;
ast_mutex_unlock(&chan_lock);
return -1;
}
CDEBUG(call, ast, "Received fixup from Asterisk.\n");
call->ast = ast;
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received send_text from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
if (!call) {
CERROR(NULL, ast, "Received send_text from Asterisk, but no call instance exists.\n");
ast_mutex_unlock(&chan_lock);
strncpy(newparam.notifyinfo.display, text, sizeof(newparam.notifyinfo.display)-1);
send_message(MESSAGE_NOTIFY, call->ref, &newparam);
ast_mutex_unlock(&chan_lock);
strncpy(newparam.notifyinfo.display, text, sizeof(newparam.notifyinfo.display)-1);
send_message(MESSAGE_NOTIFY, call->ref, &newparam);
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call1 = ast1->tech_pvt;
call2 = ast2->tech_pvt;
if (!call1 || !call2) {
CDEBUG(NULL, NULL, "Bridge, but we don't have two call instances, exitting.\n");
ast_mutex_unlock(&chan_lock);
ast_mutex_lock(&chan_lock);
call1 = ast1->tech_pvt;
call2 = ast2->tech_pvt;
if (!call1 || !call2) {
CDEBUG(NULL, NULL, "Bridge, but we don't have two call instances, exitting.\n");
ast_mutex_unlock(&chan_lock);
CERROR(NULL, ast, "lcr_config app not called by chan_lcr channel.\n");
ast_mutex_unlock(&chan_lock);
CERROR(NULL, ast, "lcr_config app not called by chan_lcr channel.\n");
ast_mutex_unlock(&chan_lock);