summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip-ua
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-09-11 08:00:47 +0000
committerBenny Prijono <bennylp@teluu.com>2008-09-11 08:00:47 +0000
commit0713abf7556bacb5c4c32545996907548c179fdf (patch)
tree2b72b3d97a707cc3370b2949f9d4444d0d481002 /pjsip/src/pjsip-ua
parent5e976eec4b731070a2d04ff4eff54a0ad91926e7 (diff)
Ticket #620: PRACK is sent to the wrong UAS when 100rel is used and the dialog forks (thanks Ruud Klaver for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2271 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-ua')
-rw-r--r--pjsip/src/pjsip-ua/sip_100rel.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/pjsip/src/pjsip-ua/sip_100rel.c b/pjsip/src/pjsip-ua/sip_100rel.c
index 657b298c..d8bb402c 100644
--- a/pjsip/src/pjsip-ua/sip_100rel.c
+++ b/pjsip/src/pjsip-ua/sip_100rel.c
@@ -417,14 +417,26 @@ PJ_DEF(pj_status_t) pjsip_100rel_on_rx_prack( pjsip_inv_session *inv,
pj_str_t method;
pj_status_t status;
- dd = (dlg_data*) inv->dlg->mod_data[mod_100rel.mod.id];
- PJ_ASSERT_RETURN(dd != NULL, PJSIP_ENOTINITIALIZED);
-
tsx = pjsip_rdata_get_tsx(rdata);
pj_assert(tsx != NULL);
msg = rdata->msg_info.msg;
+ dd = (dlg_data*) inv->dlg->mod_data[mod_100rel.mod.id];
+ if (dd == NULL) {
+ /* UAC sends us PRACK while we didn't send reliable provisional
+ * response. Respond with 400 (?)
+ */
+ const pj_str_t reason = pj_str("Unexpected PRACK");
+
+ status = pjsip_dlg_create_response(inv->dlg, rdata, 400,
+ &reason, &tdata);
+ if (status == PJ_SUCCESS) {
+ status = pjsip_dlg_send_response(inv->dlg, tsx, tdata);
+ }
+ return PJSIP_ENOTINITIALIZED;
+ }
+
/* Always reply with 200/OK for PRACK */
status = pjsip_dlg_create_response(inv->dlg, rdata, 200, NULL, &tdata);
if (status == PJ_SUCCESS) {