}
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:
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")),
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;