Changeset 5710 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Dec 5, 2017 7:11:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5701 r5710 4410 4410 } 4411 4411 /* 4412 * On incoming NOTIFY, notify application about call transfer progress. 4412 * On incoming NOTIFY or an error response, notify application about call 4413 * transfer progress. 4413 4414 */ 4414 4415 else if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_ACTIVE || … … 4438 4439 goto on_return; 4439 4440 } 4440 4441 /* This better be a NOTIFY request */ 4441 4442 4442 if (event->type == PJSIP_EVENT_TSX_STATE && 4443 4443 event->body.tsx_state.type == PJSIP_EVENT_RX_MSG) … … 4446 4446 4447 4447 rdata = event->body.tsx_state.src.rdata; 4448 4449 /* Check if there's body */4450 4448 msg = rdata->msg_info.msg; 4451 body = msg->body; 4452 if (!body) { 4453 PJ_LOG(2,(THIS_FILE, 4454 "Warning: received NOTIFY without message body")); 4455 goto on_return; 4449 4450 /* This better be a NOTIFY request */ 4451 if (pjsip_method_cmp(&msg->line.req.method, 4452 pjsip_get_notify_method()) == 0) 4453 { 4454 /* Check if there's body */ 4455 body = msg->body; 4456 if (!body) { 4457 PJ_LOG(2, (THIS_FILE, 4458 "Warning: received NOTIFY without message " 4459 "body")); 4460 goto on_return; 4461 } 4462 4463 /* Check for appropriate content */ 4464 if (pj_stricmp2(&body->content_type.type, "message") != 0 || 4465 pj_stricmp2(&body->content_type.subtype, "sipfrag") != 0) 4466 { 4467 PJ_LOG(2, (THIS_FILE, 4468 "Warning: received NOTIFY with non " 4469 "message/sipfrag content")); 4470 goto on_return; 4471 } 4472 4473 /* Try to parse the content */ 4474 status = pjsip_parse_status_line((char*)body->data, body->len, 4475 &status_line); 4476 if (status != PJ_SUCCESS) { 4477 PJ_LOG(2, (THIS_FILE, 4478 "Warning: received NOTIFY with invalid " 4479 "message/sipfrag content")); 4480 goto on_return; 4481 } 4482 } else { 4483 status_line.code = msg->line.status.code; 4484 status_line.reason = msg->line.status.reason; 4456 4485 } 4457 4458 /* Check for appropriate content */4459 if (pj_stricmp2(&body->content_type.type, "message") != 0 ||4460 pj_stricmp2(&body->content_type.subtype, "sipfrag") != 0)4461 {4462 PJ_LOG(2,(THIS_FILE,4463 "Warning: received NOTIFY with non message/sipfrag "4464 "content"));4465 goto on_return;4466 }4467 4468 /* Try to parse the content */4469 status = pjsip_parse_status_line((char*)body->data, body->len,4470 &status_line);4471 if (status != PJ_SUCCESS) {4472 PJ_LOG(2,(THIS_FILE,4473 "Warning: received NOTIFY with invalid "4474 "message/sipfrag content"));4475 goto on_return;4476 }4477 4478 4486 } else { 4479 4487 status_line.code = 500;
Note: See TracChangeset
for help on using the changeset viewer.