mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
now that CDR is a loadable module, don't depend on it elsewhere (issue #6460)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@9581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
36
manager.c
36
manager.c
@@ -64,16 +64,17 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/utils.h"
|
||||
|
||||
struct fast_originate_helper {
|
||||
char tech[256];
|
||||
char data[256];
|
||||
char tech[AST_MAX_MANHEADER_LEN];
|
||||
char data[AST_MAX_MANHEADER_LEN];
|
||||
int timeout;
|
||||
char app[256];
|
||||
char appdata[256];
|
||||
char cid_name[256];
|
||||
char cid_num[256];
|
||||
char context[256];
|
||||
char exten[256];
|
||||
char idtext[256];
|
||||
char app[AST_MAX_APP];
|
||||
char appdata[AST_MAX_MANHEADER_LEN];
|
||||
char cid_name[AST_MAX_MANHEADER_LEN];
|
||||
char cid_num[AST_MAX_MANHEADER_LEN];
|
||||
char context[AST_MAX_CONTEXT];
|
||||
char exten[AST_MAX_EXTENSION];
|
||||
char idtext[AST_MAX_MANHEADER_LEN];
|
||||
char account[AST_MAX_ACCOUNT_CODE];
|
||||
int priority;
|
||||
struct ast_variable *vars;
|
||||
};
|
||||
@@ -939,12 +940,12 @@ static void *fast_originate(void *data)
|
||||
res = ast_pbx_outgoing_app(in->tech, AST_FORMAT_SLINEAR, in->data, in->timeout, in->app, in->appdata, &reason, 1,
|
||||
!ast_strlen_zero(in->cid_num) ? in->cid_num : NULL,
|
||||
!ast_strlen_zero(in->cid_name) ? in->cid_name : NULL,
|
||||
in->vars, &chan);
|
||||
in->vars, in->account, &chan);
|
||||
} else {
|
||||
res = ast_pbx_outgoing_exten(in->tech, AST_FORMAT_SLINEAR, in->data, in->timeout, in->context, in->exten, in->priority, &reason, 1,
|
||||
!ast_strlen_zero(in->cid_num) ? in->cid_num : NULL,
|
||||
!ast_strlen_zero(in->cid_name) ? in->cid_name : NULL,
|
||||
in->vars, &chan);
|
||||
in->vars, in->account, &chan);
|
||||
}
|
||||
if (!res)
|
||||
manager_event(EVENT_FLAG_CALL,
|
||||
@@ -1047,12 +1048,6 @@ static int action_originate(struct mansession *s, struct message *m)
|
||||
if (ast_strlen_zero(l))
|
||||
l = NULL;
|
||||
}
|
||||
if (account) {
|
||||
struct ast_variable *newvar;
|
||||
newvar = ast_variable_new("CDR(accountcode|r)", account);
|
||||
newvar->next = vars;
|
||||
vars = newvar;
|
||||
}
|
||||
if (ast_true(async)) {
|
||||
struct fast_originate_helper *fast = malloc(sizeof(struct fast_originate_helper));
|
||||
if (!fast) {
|
||||
@@ -1072,6 +1067,7 @@ static int action_originate(struct mansession *s, struct message *m)
|
||||
fast->vars = vars;
|
||||
ast_copy_string(fast->context, context, sizeof(fast->context));
|
||||
ast_copy_string(fast->exten, exten, sizeof(fast->exten));
|
||||
ast_copy_string(fast->account, account, sizeof(fast->account));
|
||||
fast->timeout = to;
|
||||
fast->priority = pi;
|
||||
pthread_attr_init(&attr);
|
||||
@@ -1083,10 +1079,10 @@ static int action_originate(struct mansession *s, struct message *m)
|
||||
}
|
||||
}
|
||||
} else if (!ast_strlen_zero(app)) {
|
||||
res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 1, l, n, vars, NULL);
|
||||
res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL);
|
||||
} else {
|
||||
if (exten && context && pi)
|
||||
res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 1, l, n, vars, NULL);
|
||||
res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 1, l, n, vars, account, NULL);
|
||||
else {
|
||||
astman_send_error(s, m, "Originate with 'Exten' requires 'Context' and 'Priority'");
|
||||
return 0;
|
||||
@@ -1405,7 +1401,7 @@ static void *session_do(void *data)
|
||||
if (process_message(s, &m))
|
||||
break;
|
||||
memset(&m, 0, sizeof(m));
|
||||
} else if (m.hdrcount < MAX_HEADERS - 1)
|
||||
} else if (m.hdrcount < AST_MAX_MANHEADERS - 1)
|
||||
m.hdrcount++;
|
||||
} else if (res < 0)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user