From 74244d9a97d8cda6fbdc2a9bccd9a60879cdad35 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 5 Jun 2008 16:20:01 +0000 Subject: [PATCH] Thu Jun 5 11:32:08 EDT 2008 Pekka Pessi * nua_session.c: sanitized asserts with dialog usage for SIP session git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8766 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- .../libsofia-sip-ua/nua/nua_session.c | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 3dc57e3c0b..08cff62241 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Jun 3 14:56:27 EDT 2008 +Thu Jun 5 12:19:53 EDT 2008 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 571d069332..f951531e85 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c @@ -761,18 +761,18 @@ static int nua_invite_client_request(nua_client_request_t *cr, { nua_handle_t *nh = cr->cr_owner; nua_dialog_usage_t *du = cr->cr_usage; - nua_session_usage_t *ss = nua_dialog_usage_private(du); + nua_session_usage_t *ss; int offer_sent = 0, retval; sip_time_t invite_timeout; if (du == NULL) /* Call terminated */ return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg); + ss = NUA_DIALOG_USAGE_PRIVATE(du); + if (ss->ss_state >= nua_callstate_terminating) return nua_client_return(cr, 900, "Session is terminating", msg); - assert(ss); - invite_timeout = NH_PGET(nh, invite_timeout); if (invite_timeout == 0) invite_timeout = UINT_MAX; @@ -868,7 +868,7 @@ static int nua_invite_client_preliminary(nua_client_request_t *cr, nua_dialog_usage_t *du = cr->cr_usage; nua_session_usage_t *ss = nua_dialog_usage_private(du); - assert(sip); assert(ss); + assert(sip); if (ss && sip && sip->sip_rseq) { /* Handle 100rel responses */ @@ -1683,7 +1683,7 @@ static int nua_prack_client_request(nua_client_request_t *cr, { nua_handle_t *nh = cr->cr_owner; nua_dialog_usage_t *du = cr->cr_usage; - nua_session_usage_t *ss = nua_dialog_usage_private(du); + nua_session_usage_t *ss; nua_client_request_t *cri; int offer_sent = 0, answer_sent = 0, retval; int status = 0; char const *phrase = "PRACK Sent"; @@ -1691,7 +1691,8 @@ static int nua_prack_client_request(nua_client_request_t *cr, if (du == NULL) /* Call terminated */ return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg); - assert(ss); + + ss = NUA_DIALOG_USAGE_PRIVATE(du); if (ss->ss_state >= nua_callstate_terminating) return nua_client_return(cr, 900, "Session is terminating", msg); @@ -2371,8 +2372,6 @@ int nua_invite_server_report(nua_server_request_t *sr, tagi_t const *tags) return retval; } - assert(ss); - /* Update session state */ if (status < 300 || application != 0) { assert(ss->ss_state != nua_callstate_calling); @@ -3148,14 +3147,15 @@ static int nua_update_client_request(nua_client_request_t *cr, { nua_handle_t *nh = cr->cr_owner; nua_dialog_usage_t *du = cr->cr_usage; - nua_session_usage_t *ss = nua_dialog_usage_private(du); + nua_session_usage_t *ss; nua_server_request_t *sr; nua_client_request_t *cri; int offer_sent = 0, retval; if (du == NULL) /* Call terminated */ return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg); - assert(ss); + + ss = NUA_DIALOG_USAGE_PRIVATE(du); if (ss->ss_state >= nua_callstate_terminating) return nua_client_return(cr, 900, "Session is terminating", msg);