mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
CEL refactoring cleanup
This change removes AST_CEL_BRIDGE_UPDATE since it should no longer be used because masquerade situations are now accounted for in other ways. This also refactors usage of AST_CEL_FORWARD to be produced by a Dial message which has been extended with a "forward" field. (closes issue ASTERISK-21566) Review: https://reviewboard.asterisk.org/r/2635/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -62,6 +62,7 @@ static int celgenuserevent_exec(struct ast_channel *chan, const char *data)
|
||||
{
|
||||
int res = 0;
|
||||
char *parse;
|
||||
RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(event);
|
||||
AST_APP_ARG(extra);
|
||||
@@ -74,7 +75,13 @@ static int celgenuserevent_exec(struct ast_channel *chan, const char *data)
|
||||
parse = ast_strdupa(data);
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
ast_cel_report_event(chan, AST_CEL_USER_DEFINED, args.event, args.extra, NULL);
|
||||
blob = ast_json_pack("{s: s, s: s}",
|
||||
"event", args.event,
|
||||
"extra", args.extra);
|
||||
if (!blob) {
|
||||
return res;
|
||||
}
|
||||
ast_cel_publish_event(chan, AST_CEL_USER_DEFINED, blob);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@@ -859,8 +859,6 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
|
||||
ast_clear_flag64(o, OPT_IGNORE_CONNECTEDLINE);
|
||||
}
|
||||
|
||||
ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(c), NULL);
|
||||
|
||||
/* Before processing channel, go ahead and check for forwarding */
|
||||
ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", ast_channel_name(in), tech, stuff, ast_channel_name(c));
|
||||
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
|
||||
@@ -1004,7 +1002,8 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
|
||||
ast_channel_unlock(c);
|
||||
|
||||
ast_channel_lock_both(original, in);
|
||||
ast_channel_publish_dial(in, original, NULL, "CANCEL");
|
||||
ast_channel_publish_dial_forward(in, original, NULL, "CANCEL",
|
||||
ast_channel_call_forward(c));
|
||||
ast_channel_unlock(in);
|
||||
ast_channel_unlock(original);
|
||||
|
||||
|
@@ -4449,8 +4449,6 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
|
||||
o->block_connected_update = 0;
|
||||
}
|
||||
|
||||
ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(o->chan), NULL);
|
||||
|
||||
ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);
|
||||
/* Setup parameters */
|
||||
o->chan = ast_request(tech, ast_channel_nativeformats(in), in, stuff, &status);
|
||||
@@ -4544,7 +4542,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
|
||||
ast_channel_unlock(qe->chan);
|
||||
|
||||
ast_channel_lock_both(qe->chan, original);
|
||||
ast_channel_publish_dial(qe->chan, original, NULL, "CANCEL");
|
||||
ast_channel_publish_dial_forward(qe->chan, original, NULL, "CANCEL",
|
||||
ast_channel_call_forward(original));
|
||||
ast_channel_unlock(original);
|
||||
ast_channel_unlock(qe->chan);
|
||||
/* Hangup the original channel now, in case we needed it */
|
||||
|
Reference in New Issue
Block a user