X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=chan_lcr.c;h=dcc9b4151ba14ed1ebac4f1bccc3f2e0533ad996;hp=a4b1a1522c4f4c1d094ef0aee957d20150b53399;hb=bdd274c5e8ac1f53fb2fb38995833a57b6475088;hpb=464ed1f2840332b587a81fd64c0875567c9024d2 diff --git a/chan_lcr.c b/chan_lcr.c index a4b1a15..dcc9b41 100644 --- a/chan_lcr.c +++ b/chan_lcr.c @@ -646,8 +646,6 @@ static void send_setup_to_lcr(struct chan_call *call) strncpy(newparam.setup.dialinginfo.keypad, call->dialstring, sizeof(newparam.setup.dialinginfo.keypad)-1); else strncpy(newparam.setup.dialinginfo.id, call->dialstring, sizeof(newparam.setup.dialinginfo.id)-1); - if (!!strcmp(call->interface, "pbx")) - strncpy(newparam.setup.dialinginfo.interfaces, call->interface, sizeof(newparam.setup.dialinginfo.interfaces)-1); newparam.setup.callerinfo.itype = INFO_ITYPE_CHAN; newparam.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN; strncpy(newparam.setup.callerinfo.display, call->display, sizeof(newparam.setup.callerinfo.display)-1); @@ -1002,8 +1000,8 @@ static void lcr_in_setup(struct chan_call *call, int message_type, union paramet strncpy(ast->context, param->setup.callerinfo.interface, AST_MAX_CONTEXT-1); #else ast_channel_exten_set(ast, param->setup.dialinginfo.id); - if (param->setup.context[0]) - ast_channel_context_set(ast, param->setup.context); + if (param->setup.dialinginfo.context[0]) + ast_channel_context_set(ast, param->setup.dialinginfo.context); else ast_channel_context_set(ast, param->setup.callerinfo.interface); #endif @@ -1414,7 +1412,9 @@ static void lcr_in_information(struct chan_call *call, int message_type, union p #if ASTERISK_VERSION_NUM < 110000 strncat(ast->exten, param->information.id, AST_MAX_EXTENSION-1); #else - ast_channel_exten_set(ast, param->information.id); + char *tmp[AST_MAX_EXTENSION]; + snprintf(tmp,AST_MAX_EXTENSION,"%s%s",ast_channel_exten(ast),param->information.id); + ast_channel_exten_set(ast, tmp); #endif lcr_start_pbx(call, ast, param->information.sending_complete); return; @@ -2425,6 +2425,7 @@ static int lcr_call(struct ast_channel *ast, char *dest, int timeout) /* send MESSAGE_NEWREF */ memset(&newparam, 0, sizeof(union parameter)); newparam.newref.direction = 0; /* request from app */ + strncpy(newparam.newref.interface, call->interface, sizeof(newparam.newref.interface) - 1); send_message(MESSAGE_NEWREF, 0, &newparam); /* set hdlc if capability requires hdlc */ @@ -2782,11 +2783,12 @@ static int lcr_write(struct ast_channel *ast, struct ast_frame *fr) call = ast_channel_tech_pvt(ast); #endif if (!call || !call->ref) { + /* drop the frame, if no ref exists, but return successfull delivery, or asterisk will abort connection */ ast_mutex_unlock(&chan_lock); if (f != fr) { ast_frfree(f); } - return -1; + return 0; } len = f->samples; p = *((unsigned char **)&(f->data));