From 0e45cc850f0fa14689b02df824d891b070c0c1b0 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 15 May 2009 15:45:39 +0000 Subject: [PATCH] Tue May 12 11:05:19 CDT 2009 Pekka Pessi * nua: NUTAG_AUTOACK(0) is now obeyed always when media is disabled Ignore-this: c5960a8330904eae5a1428158e4498c7 If media is enabled, stack autoacks 2XX responses to re-INVITEs unless NUTAG_AUTOACK(0) is set on handle. Also documenting NUTAG_AUTOACK() behaviour with re-INVITEs. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13320 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- .../sofia-sip/libsofia-sip-ua/nua/nua_session.c | 17 +++++++++++------ libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c | 6 ++++++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index d7fb051287..0678374ad7 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Fri May 15 10:43:59 CDT 2009 +Fri May 15 10:45:11 CDT 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c index 50a983b9db..e32d9f1982 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c @@ -1108,8 +1108,9 @@ static int nua_invite_client_report(nua_client_request_t *cr, if (next_state == nua_callstate_completing) { if (NH_PGET(nh, auto_ack) || - /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */ - (ss->ss_state == nua_callstate_ready && + /* Auto-ACK response to re-INVITE when media is enabled + and auto_ack is not set to 0 on handle */ + (ss->ss_state == nua_callstate_ready && nh->nh_soa && !NH_PISSET(nh, auto_ack))) { nua_client_request_t *cru; @@ -1867,8 +1868,10 @@ static int nua_prack_client_report(nua_client_request_t *cr, /* There is an un-ACK-ed INVITE there */ assert(du->du_cr->cr_method == sip_method_invite); if (NH_PGET(nh, auto_ack) || - /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */ - (ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) { + /* Auto-ACK response to re-INVITE when media is enabled + and auto_ack is not set to 0 on handle */ + (ss->ss_state == nua_callstate_ready && nh->nh_soa && + !NH_PISSET(nh, auto_ack))) { /* There should be no UPDATE with offer/answer if PRACK with offer/answer was ongoing! */ if (nua_invite_client_ack(du->du_cr, NULL) > 0) @@ -3407,8 +3410,10 @@ static int nua_update_client_report(nua_client_request_t *cr, assert(du->du_cr->cr_method == sip_method_invite); if (NH_PGET(nh, auto_ack) || - /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */ - (ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) { + /* Auto-ACK response to re-INVITE when media is enabled + and auto_ack is not set to 0 on handle */ + (ss->ss_state == nua_callstate_ready && nh->nh_soa && + !NH_PISSET(nh, auto_ack))) { if (nua_invite_client_ack(du->du_cr, NULL) > 0) next_state = nua_callstate_ready; else diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c index 5aa795ffcb..caf36e1036 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c @@ -1319,6 +1319,12 @@ tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer); * * Default value is NUTAG_AUTOACK(1). * + * @par Auto ACK with Re-INVITE requests + * By default, NUA tries to auto-ACK the final response to re-INVITE used to + * refresh the session when the media is enabled. Set NUTAG_AUTOACK(0) on + * the call handle (e.g., include the tag with nua_invite() or + * nua_respond()) in order to disable the auto ACK with re-INVITE. + * * Corresponding tag taking reference parameter is NUTAG_AUTOACK_REF(). */ tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK);