summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-06-26 19:47:23 +0000
committerBenny Prijono <bennylp@teluu.com>2008-06-26 19:47:23 +0000
commit1cbe183e8d7c355373c17e4e9ce3b0955e76bc38 (patch)
treea798e05cde91a656f6f609cd406b4ad315c79457
parentc2bf0b1ca18b3ccc8ccf3d580840900a0518e049 (diff)
Fixed assertion in invite session when INVITE has bad SDP because the SDP is given without having been validated first
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2065 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index d12ea9d2..53035f5f 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -721,12 +721,27 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
status = pjmedia_sdp_parse(rdata->tp_info.pool,
(char*)rdata->msg_info.msg->body->data,
rdata->msg_info.msg->body->len, &offer);
+ if (status == PJ_SUCCESS) {
+ /* Validate */
+ status = pjmedia_sdp_validate(offer);
+ }
+
if (status != PJ_SUCCESS) {
const pj_str_t reason = pj_str("Bad SDP");
- pjsua_perror(THIS_FILE, "Error parsing SDP in incoming INVITE",
+ pjsip_hdr hdr_list;
+ pjsip_warning_hdr *w;
+
+ pjsua_perror(THIS_FILE, "Bad SDP in incoming INVITE",
status);
+
+ w = pjsip_warning_hdr_create_from_status(rdata->tp_info.pool,
+ pjsip_endpt_name(pjsua_var.endpt),
+ status);
+ pj_list_init(&hdr_list);
+ pj_list_push_back(&hdr_list, w);
+
pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400,
- &reason, NULL, NULL, NULL);
+ &reason, &hdr_list, NULL, NULL);
PJSUA_UNLOCK();
return PJ_TRUE;
}