]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add var_event down into the endpoints so chans with no parents can still pass options
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 15 May 2008 19:29:35 +0000 (19:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 15 May 2008 19:29:35 +0000 (19:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8416 d0543943-73ff-0310-b7d9-9358b9ac24b2

15 files changed:
src/include/switch_core.h
src/include/switch_core_event_hook.h
src/include/switch_module_interfaces.h
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c
src/mod/endpoints/mod_alsa/mod_alsa.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/mod/endpoints/mod_iax/mod_iax.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
src/mod/endpoints/mod_reference/mod_reference.c
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
src/mod/endpoints/mod_woomera/mod_woomera.c
src/switch_core_session.c
src/switch_ivr_originate.c

index 2a004e4e7bb405b1da136864436b9ab56818f5fc..6c794e873f4364c243be6f65cfdbd08d1e63e7a0 100644 (file)
@@ -732,6 +732,7 @@ SWITCH_DECLARE(void) switch_core_service_session(_In_ switch_core_session_t *ses
   \return the cause code of the attempted call
 */
 SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(_In_opt_ switch_core_session_t *session,
+                                                                                                                                                _In_opt_ switch_event_t *var_event,
                                                                                                                                                 _In_z_ const char *endpoint_name,
                                                                                                                                                 _In_ switch_caller_profile_t *caller_profile,
                                                                                                                                                 _Inout_ switch_core_session_t **new_session,
index 70238c6cac272fd046671512b8765695cf378a39..b914762bb6f494f51493fc24169103fa8ef6d21d 100644 (file)
@@ -48,7 +48,7 @@ typedef struct switch_io_event_hook_recv_dtmf switch_io_event_hook_recv_dtmf_t;
 typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
 typedef struct switch_io_event_hook_resurrect_session switch_io_event_hook_resurrect_session_t;
 typedef switch_status_t (*switch_outgoing_channel_hook_t)
-(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *, switch_originate_flag_t);
+(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t *, switch_originate_flag_t);
 typedef switch_status_t (*switch_receive_message_hook_t) (switch_core_session_t *, switch_core_session_message_t *);
 typedef switch_status_t (*switch_receive_event_hook_t) (switch_core_session_t *, switch_event_t *);
 typedef switch_status_t (*switch_read_frame_hook_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
index 0aae00a729ebda600cb36815b46aae638b02d463..f4d303602c496b36b9d473a26c6a1d75a8513299 100644 (file)
@@ -100,7 +100,7 @@ struct switch_io_event_hooks;
 
 
 typedef switch_call_cause_t (*switch_io_outgoing_channel_t)
-(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t);
+(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t);
 typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
 typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
 typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
index c9b6c55517aa66c083d7d0a1f77ef5b0b6a0dcb0..22cfe1140af24134e206d9922e818887c4a60369 100644 (file)
@@ -1772,6 +1772,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
 /* fake chan_user */
 switch_endpoint_interface_t *user_endpoint_interface;
 static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
+                                                                                                switch_event_t *var_event,
                                                                                                 switch_caller_profile_t *outbound_profile,
                                                                                                 switch_core_session_t **new_session, 
                                                                                                 switch_memory_pool_t **pool,
@@ -1781,6 +1782,7 @@ switch_io_routines_t user_io_routines = {
 };
 
 static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
+                                                                                                switch_event_t *var_event,
                                                                                                 switch_caller_profile_t *outbound_profile,
                                                                                                 switch_core_session_t **new_session, 
                                                                                                 switch_memory_pool_t **pool,
@@ -1857,7 +1859,18 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                        d_dest = switch_channel_expand_variables(channel, dest);
 
                } else {
-                       d_dest = strdup(dest);
+                       switch_event_t *event = var_event;
+                       if (!event) {
+                               switch_event_create(&event, SWITCH_EVENT_MESSAGE);
+                               switch_assert(event);
+                       }
+                       
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", user);
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain);
+                       d_dest = switch_event_expand_headers(event, dest);
+                       if (event && event != var_event) {
+                               switch_event_destroy(&event);
+                       }
                }
                
                if ((flags & SOF_FORKED_DIAL)) {
index 48fef5fe69b91285fdb04565c0ccd0e5b4a6c55d..bc11ac8b5ea01916e88c649f082c61cdadc5532d 100644 (file)
@@ -289,7 +289,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
 
 /* fake chan_sip */
 switch_endpoint_interface_t *sip_endpoint_interface;
-static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                switch_caller_profile_t *outbound_profile,
                                                                                                switch_core_session_t **new_session, 
                                                                                                switch_memory_pool_t **pool,
@@ -298,7 +298,7 @@ switch_io_routines_t sip_io_routines = {
        /*.outgoing_channel */ sip_outgoing_channel
 };
 
-static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                switch_caller_profile_t *outbound_profile,
                                                                                                switch_core_session_t **new_session, 
                                                                                                switch_memory_pool_t **pool,
@@ -316,7 +316,7 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
        }
 
        outbound_profile->destination_number = switch_core_sprintf(outbound_profile->pool, "%s/%s", profile, outbound_profile->destination_number);
-       return switch_core_session_outgoing_channel(session, "sofia", outbound_profile, new_session, pool, SOF_NONE);
+       return switch_core_session_outgoing_channel(session, var_event, "sofia", outbound_profile, new_session, pool, SOF_NONE);
 }
 
 
@@ -324,7 +324,7 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
 
 /* fake chan_iax2 */
 switch_endpoint_interface_t *iax2_endpoint_interface;
-static switch_call_cause_t iax2_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t iax2_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                 switch_caller_profile_t *outbound_profile,
                                                                                                 switch_core_session_t **new_session, 
                                                                                                 switch_memory_pool_t **pool,
@@ -333,13 +333,13 @@ switch_io_routines_t iax2_io_routines = {
        /*.outgoing_channel */ iax2_outgoing_channel
 };
 
-static switch_call_cause_t iax2_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t iax2_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                 switch_caller_profile_t *outbound_profile,
                                                                                                 switch_core_session_t **new_session, 
                                                                                                 switch_memory_pool_t **pool,
                                                                                                 switch_originate_flag_t flags)
 {
-       return switch_core_session_outgoing_channel(session, "iax", outbound_profile, new_session, pool, SOF_NONE);
+       return switch_core_session_outgoing_channel(session, var_event, "iax", outbound_profile, new_session, pool, SOF_NONE);
 }
 
 
index 26ee890537bfcdd96b499f283146736648e99bee..4bc23e2a2652c971509357d6013c90900891f854 100644 (file)
@@ -146,7 +146,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session);
 static switch_status_t channel_on_routing(switch_core_session_t *session);
 static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
 static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -753,7 +753,7 @@ static switch_loadable_module_interface_t channel_module_interface = {
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
    that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
index e1a67471fd188171032bee767ce7355a04132423..d013b6b53daac21d5ffe53bd52003773c0ae4986 100644 (file)
@@ -208,7 +208,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session);
 static switch_status_t channel_on_routing(switch_core_session_t *session);
 static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
 static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -1566,7 +1566,7 @@ switch_io_routines_t dingaling_io_routines = {
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
    that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
index bffe2da28961e269ba72b4fc0fe9f747ede3191a..db9d2f2cd46d23e9d42337df15e01b1c18ac1c17 100644 (file)
@@ -419,7 +419,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session);
 static switch_status_t channel_on_routing(switch_core_session_t *session);
 static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
 static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -693,7 +693,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
    that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
index 32f424ab5600548c12450e1252eef41877a79792..1913d2e493ceab8ab5b76d111135cb46853f9517 100644 (file)
@@ -143,7 +143,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session);
 static switch_status_t channel_on_routing(switch_core_session_t *session);
 static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
 static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -631,7 +631,7 @@ switch_io_routines_t portaudio_io_routines = {
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
    that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
index 1d83e4ae8df313f89a247e23ef8dfba3d1951834..ae565558df1ac0ec4bae73df1337b1f086f8db2b 100644 (file)
@@ -103,7 +103,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session);
 static switch_status_t channel_on_routing(switch_core_session_t *session);
 static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
 static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -395,7 +395,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
    that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
-static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
index 170363c28537f4a556d7192a25cb557f5fae1920..a1b8130327287ac785c1ba9442f8a89d005d77ec 100644 (file)
@@ -52,7 +52,7 @@ static switch_status_t sofia_on_init(switch_core_session_t *session);
 
 static switch_status_t sofia_on_exchange_media(switch_core_session_t *session);
 static switch_status_t sofia_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                  switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
                                                                                                  switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -1682,7 +1682,7 @@ static switch_status_t sofia_manage(char *relative_oid, switch_management_action
        return SWITCH_STATUS_SUCCESS;
 }
 
-static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                  switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
                                                                                                  switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
@@ -1694,7 +1694,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
        private_object_t *tech_pvt = NULL;
        switch_channel_t *nchannel;
        char *host = NULL, *dest_to = NULL;
-
+       
        *new_session = NULL;
 
        if (!(nsession = switch_core_session_request(sofia_endpoint_interface, pool))) {
index ca35cfe44e508d78564ce21d9a1030bb89ac0ce6..a41aff3090befe38970b1b2196cca4aaaa591b87 100644 (file)
@@ -466,7 +466,7 @@ static switch_status_t wanpipe_on_init(switch_core_session_t *session);
 static switch_status_t wanpipe_on_hangup(switch_core_session_t *session);
 static switch_status_t wanpipe_on_exchange_media(switch_core_session_t *session);
 static switch_status_t wanpipe_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
+static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch_frame_t **frame,
                                                                                switch_io_flag_t flags, int stream_id);
@@ -1006,7 +1006,7 @@ switch_state_handler_table_t wanpipe_state_handlers = {
        /*.on_soft_execute */ wanpipe_on_soft_execute
 };
 
-static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
+static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
        char *bchan = NULL;
index f6ce9e4b1bf1114262cbda2da970ccaf670bc07c..da9eeb3ad6910de49a07fefcd6d3820ebeeaf915 100644 (file)
@@ -173,7 +173,7 @@ static switch_status_t woomera_on_hangup(switch_core_session_t *session);
 static switch_status_t woomera_on_routing(switch_core_session_t *session);
 static switch_status_t woomera_on_exchange_media(switch_core_session_t *session);
 static switch_status_t woomera_on_soft_execute(switch_core_session_t *session);
-static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
 static switch_status_t woomera_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
@@ -401,7 +401,7 @@ static switch_io_routines_t woomera_io_routines = {
 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
    that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
 */
-static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session,
+static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
                                                                                                        switch_caller_profile_t *outbound_profile,
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
 {
index d0deb5315f44ebfe9fee1e4cc46440dcc88fe12e..74c2190f936911df83d92230beb8f6b6fbfd317c 100644 (file)
@@ -188,12 +188,12 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(const
        return endpoint_interface->io_routines->resurrect_session(new_session, pool, data);
 }
 
-SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_core_session_t *session,
-                                                                                                                                                const char *endpoint_name,
-                                                                                                                                                switch_caller_profile_t *caller_profile,
-                                                                                                                                                switch_core_session_t **new_session, 
-                                                                                                                                                switch_memory_pool_t **pool,
-                                                                                                                                                switch_originate_flag_t flags)
+ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
+                                                                                                                                                 const char *endpoint_name,
+                                                                                                                                                 switch_caller_profile_t *caller_profile,
+                                                                                                                                                 switch_core_session_t **new_session, 
+                                                                                                                                                 switch_memory_pool_t **pool,
+                                                                                                                                                 switch_originate_flag_t flags)
 {
        switch_io_event_hook_outgoing_channel_t *ptr;
        switch_status_t status = SWITCH_STATUS_FALSE;
@@ -247,13 +247,13 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
                }
        }
 
-       if ((cause = endpoint_interface->io_routines->outgoing_channel(session, outgoing_profile, new_session, pool, flags)) != SWITCH_CAUSE_SUCCESS) {
+       if ((cause = endpoint_interface->io_routines->outgoing_channel(session, var_event, outgoing_profile, new_session, pool, flags)) != SWITCH_CAUSE_SUCCESS) {
                return cause;
        }
 
        if (session) {
                for (ptr = session->event_hooks.outgoing_channel; ptr; ptr = ptr->next) {
-                       if ((status = ptr->outgoing_channel(session, caller_profile, *new_session, flags)) != SWITCH_STATUS_SUCCESS) {
+                       if ((status = ptr->outgoing_channel(session, var_event, caller_profile, *new_session, flags)) != SWITCH_STATUS_SUCCESS) {
                                break;
                        }
                }
index c0be20c210807b163068e62bc53a098ccaff4448..a4ffca704dd63d2aeede79607b100af24cafccc0 100644 (file)
@@ -821,7 +821,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                                myflags |= SOF_FORKED_DIAL;
                                        }
                                }
-                               if ((reason = switch_core_session_outgoing_channel(session, chan_type, new_profile, &new_session, &pool, myflags)) != SWITCH_CAUSE_SUCCESS) {
+                               if ((reason = switch_core_session_outgoing_channel(session, var_event, chan_type, new_profile, &new_session, &pool, myflags)) != SWITCH_CAUSE_SUCCESS) {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot create outgoing channel of type [%s] cause: [%s]\n", 
                                                                          chan_type, switch_channel_cause2str(reason));
                                        if (pool) {