From: agree Date: Mon, 27 Feb 2023 02:49:12 +0000 (-0500) Subject: [core] switch_ivr_originate set originate endpoint used X-Git-Tag: v1.10.10^2~105^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81046e943a7dbef4037ccda875c3955504afc8a6;p=thirdparty%2Ffreeswitch.git [core] switch_ivr_originate set originate endpoint used This commit introduces a new channel variable that sets the channel endpoint used by the originate. This is particulary useful when using `execute_on_originate` that will execute multiple times when using fake endpoints as `user/` or `group/`. With this variable, a user can determine which endpoint is being used by the originate, and whether they want to process it. --- diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index f1e3e39de1..e0b0b55246 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -3215,6 +3215,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess l_session = NULL; } + switch_channel_set_variable(oglobals.originate_status[i].peer_channel, "originate_endpoint", chan_type); switch_channel_execute_on(oglobals.originate_status[i].peer_channel, SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE); switch_channel_api_on(oglobals.originate_status[i].peer_channel, SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE); }