summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-10-01 12:22:52 +0000
committerBenny Prijono <bennylp@teluu.com>2007-10-01 12:22:52 +0000
commit247902b01386925a7580306a7d4aefb42702ee31 (patch)
tree6e71d4cd6893e16a9fe44efda236b75061a82e7d /pjsip
parenta9aa7a4191fca7f683240638669f821083690b9a (diff)
Related to ticket #385: bug in 100rel causing 2xx response to be queued indefinitely when UAS previously sent 1xx response with SDP
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1467 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-ua/sip_100rel.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/pjsip/src/pjsip-ua/sip_100rel.c b/pjsip/src/pjsip-ua/sip_100rel.c
index 145eacd1..48798259 100644
--- a/pjsip/src/pjsip-ua/sip_100rel.c
+++ b/pjsip/src/pjsip-ua/sip_100rel.c
@@ -101,7 +101,6 @@ typedef struct uas_state_t
{
pj_int32_t cseq;
pj_uint32_t rseq; /* Initialized to -1 */
- pj_bool_t has_sdp;
tx_data_list_t tx_data_list;
unsigned retransmit_count;
pj_timer_entry retransmit_timer;
@@ -615,6 +614,23 @@ static pjsip_tx_data *clone_tdata(dlg_data *dd,
return dst;
}
+/* Check if pending response has SDP */
+static pj_bool_t has_sdp(dlg_data *dd)
+{
+ tx_data_list_t *tl;
+
+ tl = dd->uas_state->tx_data_list.next;
+ while (tl != &dd->uas_state->tx_data_list) {
+ if (tl->tdata->msg->body)
+ return PJ_TRUE;
+ tl = tl->next;
+ }
+
+ return PJ_FALSE;
+}
+
+
+/* Send response reliably */
PJ_DEF(pj_status_t) pjsip_100rel_tx_response(pjsip_inv_session *inv,
pjsip_tx_data *tdata)
{
@@ -678,7 +694,7 @@ PJ_DEF(pj_status_t) pjsip_100rel_tx_response(pjsip_inv_session *inv,
responses are acknowledged.
*/
- if (dd->uas_state && dd->uas_state->has_sdp) {
+ if (dd->uas_state && has_sdp(dd)) {
/* Yes we have transmitted 1xx with SDP reliably.
* In this case, must queue the 2xx response.
*/
@@ -820,10 +836,6 @@ PJ_DEF(pj_status_t) pjsip_100rel_tx_response(pjsip_inv_session *inv,
status = PJ_SUCCESS;
}
- /* Update SDP flag. Need to call this after the response
- * is scheduled for transmission.
- */
- dd->uas_state->has_sdp |= (tdata->msg->body != NULL);
}
return status;