]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6531: #resolve set to tag on auto answer notify to make grandstream happy, even...
authorMichael Jerris <mike@jerris.com>
Thu, 13 Nov 2014 03:37:14 +0000 (21:37 -0600)
committerBrian West <brian@freeswitch.org>
Thu, 13 Nov 2014 03:37:14 +0000 (21:37 -0600)
src/mod/endpoints/mod_sofia/sofia.c

index 17c06a30a004bb8ef77c4c502e367b45970bb825..3bff27e1cd2faa289320168dae44a6abff5228b6 100644 (file)
@@ -6665,10 +6665,19 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
        }
 
        if (channel && (status == 180 || status == 183) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+               const char *full_to = NULL;
                const char *val;
                if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
-                       nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_WITH_THIS_MSG(de->data->e_msg),
-                                          NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_EVENT_STR("talk"), TAG_END());
+                       full_to = switch_str_nil(switch_channel_get_variable(channel, "sip_full_to"));
+
+                       nua_notify(nh,
+                                          NUTAG_NEWSUB(1),
+                                          NUTAG_WITH_THIS_MSG(de->data->e_msg),
+                                          NUTAG_SUBSTATE(nua_substate_terminated),
+                                          TAG_IF((full_to), SIPTAG_TO_STR(full_to)),
+                                          SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
+                                          SIPTAG_EVENT_STR("talk"),
+                                          TAG_END());
                }
        }