Thu Jun 5 11:32:08 EDT 2008 Pekka Pessi <first.last@nokia.com>

* 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
This commit is contained in:
Michael Jerris 2008-06-05 16:20:01 +00:00
parent c6e2840a60
commit 74244d9a97
2 changed files with 11 additions and 11 deletions

View File

@ -1 +1 @@
Tue Jun 3 14:56:27 EDT 2008
Thu Jun 5 12:19:53 EDT 2008

View File

@ -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);