projects
/
lcr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Append information (overlap dialing) to Asterisk's extension string
[lcr.git]
/
chan_lcr.c
diff --git
a/chan_lcr.c
b/chan_lcr.c
index
a4b1a15
..
dcc9b41
100644
(file)
--- 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);
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);
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);
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
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
#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;
#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 */
/* 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 */
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) {
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);
}
ast_mutex_unlock(&chan_lock);
if (f != fr) {
ast_frfree(f);
}
- return
-1
;
+ return
0
;
}
len = f->samples;
p = *((unsigned char **)&(f->data));
}
len = f->samples;
p = *((unsigned char **)&(f->data));