mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-10 20:08:16 +00:00
Run predial routine on local;2 channel where you would expect.
Before this patch, the predial routine executes on the ;1 channel of a local channel pair. Executing predial on the ;1 channel of a local channel pair is of limited utility. Any channel variables set by the predial routine executing on the ;1 channel will not be available when the local channel executes dialplan on the ;2 channel. * Create ast_pre_call() and an associated pre_call() technology callback to handle running the predial routine. If a channel technology does not provide the callback, the predial routine is simply run on the channel. Review: https://reviewboard.asterisk.org/r/1903/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5671,6 +5671,23 @@ struct ast_channel *ast_request(const char *type, struct ast_format_cap *request
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ast_pre_call(struct ast_channel *chan, const char *sub_args)
|
||||
{
|
||||
int (*pre_call)(struct ast_channel *chan, const char *sub_args);
|
||||
|
||||
ast_channel_lock(chan);
|
||||
pre_call = ast_channel_tech(chan)->pre_call;
|
||||
if (pre_call) {
|
||||
int res;
|
||||
|
||||
res = pre_call(chan, sub_args);
|
||||
ast_channel_unlock(chan);
|
||||
return res;
|
||||
}
|
||||
ast_channel_unlock(chan);
|
||||
return ast_app_exec_sub(NULL, chan, sub_args);
|
||||
}
|
||||
|
||||
int ast_call(struct ast_channel *chan, const char *addr, int timeout)
|
||||
{
|
||||
/* Place an outgoing call, but don't wait any longer than timeout ms before returning.
|
||||
|
||||
Reference in New Issue
Block a user