[Freeswitch-svn] [commit] r13062 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
FreeSWITCH SVN
mikej at freeswitch.org
Thu Apr 16 10:18:57 PDT 2009
Author: mikej
Date: Thu Apr 16 12:18:56 2009
New Revision: 13062
Log:
Thu Apr 16 12:04:08 CDT 2009 Pekka Pessi <first.last at nokia.com>
* nua_client, nua_session: avoid restarting in-progress transactions
This is supposed to fix bugs #SFSIP-135 and #SFSIP-137. Thanks for Tamas
Jalsovszky and kawarod for reporting the problem.
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Thu Apr 16 12:18:56 2009
@@ -1 +1 @@
-Thu Apr 16 10:00:29 CDT 2009
+Thu Apr 16 12:18:30 CDT 2009
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c Thu Apr 16 12:18:56 2009
@@ -413,6 +413,20 @@
return 0;
}
+/** Check if client request is in progress.
+ *
+ * A client request is in progress, if
+ * 1) it has actual transaction going on
+ * 2) it is waiting credentials from application
+ * 3) it is waiting for Retry-After timer
+ */
+int
+nua_client_request_in_progress(nua_client_request_t const *cr)
+{
+ return cr &&
+ (cr->cr_orq || cr->cr_wait_for_cred || cr->cr_timer);
+}
+
/**Initialize client request for sending.
*
* This function is called when the request is taken from queue and sent.
@@ -1564,7 +1578,7 @@
break;
}
- if (cr && cr->cr_orq == NULL) {
+ if (cr && !nua_client_request_in_progress(cr)) {
nua_client_init_request(cr);
}
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.h Thu Apr 16 12:18:56 2009
@@ -250,6 +250,8 @@
return cr && cr->cr_prev;
}
+int nua_client_request_in_progress(nua_client_request_t const *cr);
+
int nua_client_request_complete(nua_client_request_t *cr);
int nua_client_request_remove(nua_client_request_t *cr);
int nua_client_request_clean(nua_client_request_t *cr);
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Thu Apr 16 12:18:56 2009
@@ -1535,7 +1535,7 @@
if (ss->ss_state >= nua_callstate_terminating ||
/* INVITE is in progress or being authenticated */
- (cr && (cr->cr_orq || cr->cr_wait_for_cred)))
+ nua_client_request_in_progress(cr))
return;
/* UPDATE has been queued */
More information about the Freeswitch-svn
mailing list