diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index e8f0f9bff6..e15f86aef1 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -134,8 +134,18 @@ void sofia_event_callback(nua_event_t event, } break; - case nua_r_get_params: + case nua_r_invite: + { + if (channel) { + char *val; + if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) { + nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END()); + } + } + } + break; + case nua_r_get_params: case nua_r_unregister: case nua_r_options: case nua_i_fork: @@ -305,14 +315,17 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void nua_set_params(profile->nua, NUTAG_APPL_METHOD("OPTIONS"), + NUTAG_APPL_METHOD("NOTIFY"), //NUTAG_EARLY_MEDIA(1), NUTAG_AUTOANSWER(0), NUTAG_AUTOALERT(0), NUTAG_ALLOW("REGISTER"), NUTAG_ALLOW("REFER"), NUTAG_ALLOW("INFO"), + NUTAG_ALLOW("NOTIFY"), + NUTAG_ALLOW_EVENTS("talk"), TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("PUBLISH")), - TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("NOTIFY")), + //TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("NOTIFY")), TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("SUBSCRIBE")), TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ENABLEMESSAGE(1)), TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence")), diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index c202a4b44f..ab97e34f67 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -598,6 +598,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END()); + + switch_safe_free(stream.data); return SWITCH_STATUS_SUCCESS;