better name for struct dial_localuser.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-12-19 16:36:45 +00:00
parent d0b9eb93b6
commit 83f52ed5e2

View File

@@ -288,22 +288,21 @@ AST_APP_OPTIONS(dial_exec_options, {
AST_APP_OPTION('K', OPT_CALLER_PARK), AST_APP_OPTION('K', OPT_CALLER_PARK),
}); });
/* We define a custom "local user" structure because we /*
use it not only for keeping track of what is in use but * The list of active channels
also for keeping track of who we're dialing. */ */
struct chanlist {
struct dial_localuser { struct chanlist *next;
struct ast_channel *chan; struct ast_channel *chan;
unsigned int flags; unsigned int flags;
int forwards; int forwards;
struct dial_localuser *next;
}; };
static void hanguptree(struct dial_localuser *outgoing, struct ast_channel *exception) static void hanguptree(struct chanlist *outgoing, struct ast_channel *exception)
{ {
/* Hang up a tree of stuff */ /* Hang up a tree of stuff */
struct dial_localuser *oo; struct chanlist *oo;
while (outgoing) { while (outgoing) {
/* Hangup any existing lines we have open */ /* Hangup any existing lines we have open */
if (outgoing->chan && (outgoing->chan != exception)) if (outgoing->chan && (outgoing->chan != exception))
@@ -425,7 +424,7 @@ static void senddialendevent(const struct ast_channel *src, const char *dialstat
* XXX this code is highly suspicious, as it essentially overwrites * XXX this code is highly suspicious, as it essentially overwrites
* the outgoing channel without properly deleting it. * the outgoing channel without properly deleting it.
*/ */
static void do_forward(struct dial_localuser *o, static void do_forward(struct chanlist *o,
struct cause_args *num, struct ast_flags *peerflags, int single) struct cause_args *num, struct ast_flags *peerflags, int single)
{ {
char tmpchan[256]; char tmpchan[256];
@@ -525,7 +524,7 @@ struct privacy_args {
}; };
static struct ast_channel *wait_for_answer(struct ast_channel *in, static struct ast_channel *wait_for_answer(struct ast_channel *in,
struct dial_localuser *outgoing, int *to, struct ast_flags *peerflags, struct chanlist *outgoing, int *to, struct ast_flags *peerflags,
struct privacy_args *pa, struct privacy_args *pa,
const struct cause_args *num_in, int priority_jump, int *result) const struct cause_args *num_in, int priority_jump, int *result)
{ {
@@ -545,7 +544,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
while (*to && !peer) { while (*to && !peer) {
struct dial_localuser *o; struct chanlist *o;
int pos = 0; /* how many channels do we handle */ int pos = 0; /* how many channels do we handle */
int numlines = prestart; int numlines = prestart;
struct ast_channel *winner; struct ast_channel *winner;
@@ -1170,7 +1169,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
int res = -1; /* default: error */ int res = -1; /* default: error */
struct ast_module_user *u; struct ast_module_user *u;
char *rest, *cur; /* scan the list of destinations */ char *rest, *cur; /* scan the list of destinations */
struct dial_localuser *outgoing = NULL; /* list of destinations */ struct chanlist *outgoing = NULL; /* list of destinations */
struct ast_channel *peer; struct ast_channel *peer;
int to; /* timeout */ int to; /* timeout */
struct cause_args num = { chan, 0, 0, 0 }; struct cause_args num = { chan, 0, 0, 0 };
@@ -1267,7 +1266,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
/* loop through the list of dial destinations */ /* loop through the list of dial destinations */
rest = args.peers; rest = args.peers;
while ((cur = strsep(&rest, "&")) ) { while ((cur = strsep(&rest, "&")) ) {
struct dial_localuser *tmp; struct chanlist *tmp;
struct ast_channel *tc; /* channel for this destination */ struct ast_channel *tc; /* channel for this destination */
/* Get a technology/[device:]number pair */ /* Get a technology/[device:]number pair */
char *number = cur; char *number = cur;