Changeset 738
- Timestamp:
- Sep 25, 2006 1:40:12 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r637 r738 199 199 */ 200 200 #define PJMEDIA_SDPNEG_ENOMEDIA (PJMEDIA_ERRNO_START+48) /* 220048 */ 201 /** 202 * @hideinitializer 203 * No suitable codec for remote offer. 204 */ 205 #define PJMEDIA_SDPNEG_NOANSCODEC (PJMEDIA_ERRNO_START+49) /* 220049 */ 206 /** 207 * @hideinitializer 208 * No suitable telephone-event for remote offer. 209 */ 210 #define PJMEDIA_SDPNEG_NOANSTELEVENT (PJMEDIA_ERRNO_START+50) /* 220050 */ 211 /** 212 * @hideinitializer 213 * No suitable answer for unknown remote offer. 214 */ 215 #define PJMEDIA_SDPNEG_NOANSUNKNOWN (PJMEDIA_ERRNO_START+51) /* 220051 */ 201 216 202 217 -
pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c
r638 r738 396 396 if (attr->setting.dec_fmtp_mode == 20) 397 397 ilbc_codec->dec_frame_size = 38; 398 else if (attr->setting.dec_fmtp_mode == 20)398 else if (attr->setting.dec_fmtp_mode == 30) 399 399 ilbc_codec->dec_frame_size = 50; 400 400 else { -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r637 r738 68 68 PJ_BUILD_ERR( PJMEDIA_SDPNEG_EANSNOMEDIA, "No common SDP media payload in answer" ), 69 69 PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOMEDIA, "No active media stream after negotiation" ), 70 PJ_BUILD_ERR( PJMEDIA_SDPNEG_NOANSCODEC, "No suitable codec for remote offer"), 71 PJ_BUILD_ERR( PJMEDIA_SDPNEG_NOANSTELEVENT, "No suitable telephone-event for remote offer"), 72 PJ_BUILD_ERR( PJMEDIA_SDPNEG_NOANSUNKNOWN, "No suitable answer for unknown remote offer"), 70 73 71 74 /* SDP comparison results */ -
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r734 r738 534 534 * count match 535 535 */ 536 if (!pj_str cmp(&or.enc_name, &ar.enc_name) &&536 if (!pj_stricmp(&or.enc_name, &ar.enc_name) && 537 537 or.clock_rate == ar.clock_rate && 538 pj_strcmp(&or.param, &ar.param)==0) 538 (pj_stricmp(&or.param, &ar.param)==0 || 539 ar.param.slen==1 && *ar.param.ptr=='1')) 539 540 { 540 541 /* Match! */ … … 629 630 630 631 /* Try to match offer with answer. */ 631 static pj_ bool_t match_offer(pj_pool_t *pool,632 const pjmedia_sdp_media *offer,633 const pjmedia_sdp_media *local,634 pjmedia_sdp_media **p_answer)632 static pj_status_t match_offer(pj_pool_t *pool, 633 const pjmedia_sdp_media *offer, 634 const pjmedia_sdp_media *local, 635 pjmedia_sdp_media **p_answer) 635 636 { 636 637 unsigned i; … … 698 699 if (!a) { 699 700 pj_assert(!"Bug! Offer should have been validated"); 700 return PJ _FALSE;701 return PJMEDIA_SDP_EMISSINGRTPMAP; 701 702 } 702 703 pjmedia_sdp_attr_get_rtpmap(a, &or); … … 727 728 * channel count match 728 729 */ 729 if (!pj_str cmp(&or.enc_name, &lr.enc_name) &&730 if (!pj_stricmp(&or.enc_name, &lr.enc_name) && 730 731 or.clock_rate == lr.clock_rate && 731 pj_strcmp(&or.param, &lr.param)==0) 732 (pj_strcmp(&or.param, &lr.param)==0 || 733 or.param.slen==1 && *or.param.ptr=='1')) 732 734 { 733 735 /* Match! */ … … 767 769 /* See if all types of offer can be matched. */ 768 770 #if 1 769 if ((offer_has_codec && !found_matching_codec) || 770 (offer_has_telephone_event && !found_matching_telephone_event) || 771 (offer_has_other && !found_matching_other)) 772 { 773 /* Some of the payload in the offer has no matching local sdp */ 774 return PJ_FALSE; 771 if (offer_has_codec && !found_matching_codec) { 772 return PJMEDIA_SDPNEG_NOANSCODEC; 773 } 774 775 if (offer_has_telephone_event && !found_matching_telephone_event) { 776 return PJMEDIA_SDPNEG_NOANSTELEVENT; 777 } 778 779 if (offer_has_other && !found_matching_other) { 780 return PJMEDIA_SDPNEG_NOANSUNKNOWN; 775 781 } 776 782 #else … … 828 834 829 835 *p_answer = answer; 830 return PJ_ TRUE;836 return PJ_SUCCESS; 831 837 } 832 838 … … 837 843 pjmedia_sdp_session **p_answer) 838 844 { 839 pj_status_t status ;845 pj_status_t status = PJMEDIA_SDPNEG_ENOMEDIA; 840 846 pj_bool_t has_active = PJ_FALSE; 841 847 pjmedia_sdp_session *answer; … … 880 886 { 881 887 /* See if it has matching codec. */ 882 pj_bool_t match; 883 884 match = match_offer(pool, om, im, &am); 885 if (match) { 888 status = match_offer(pool, om, im, &am); 889 if (status == PJ_SUCCESS) { 886 890 /* Mark media as used. */ 887 891 media_used[j] = 1; … … 926 930 *p_answer = answer; 927 931 928 return has_active ? PJ_SUCCESS : PJMEDIA_SDPNEG_ENOMEDIA; 929 //return PJ_SUCCESS; 932 return has_active ? PJ_SUCCESS : status; 930 933 } 931 934 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r737 r738 2103 2103 #define PJSUA_DEFAULT_CODEC_QUALITY 5 2104 2104 #define PJSUA_DEFAULT_ILBC_MODE 20 2105 #define PJSUA_DEFAULT_EC_TAIL_LEN 2562105 #define PJSUA_DEFAULT_EC_TAIL_LEN 0 2106 2106 2107 2107 -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r671 r738 615 615 /* Incompatible media */ 616 616 code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 617 status = PJSIP_ERRNO_FROM_SIP_STATUS(code);618 617 619 618 if (p_tdata) { … … 2415 2414 /* Process SDP in the answer */ 2416 2415 status = process_answer(inv, 200, tdata, NULL); 2417 if (status != PJ_SUCCESS) 2416 2417 if (status != PJ_SUCCESS) { 2418 /* 2419 * SDP negotiation has failed. 2420 */ 2421 pj_status_t rc; 2422 pj_str_t reason; 2423 2424 /* Delete the 2xx answer */ 2425 pjsip_tx_data_dec_ref(tdata); 2426 2427 /* Create 500 response */ 2428 reason = pj_str("SDP negotiation failed"); 2429 rc = pjsip_dlg_create_response(dlg, rdata, 500, &reason, 2430 &tdata); 2431 if (rc == PJ_SUCCESS) { 2432 pjsip_warning_hdr *w; 2433 const pj_str_t *endpt_name; 2434 2435 endpt_name = pjsip_endpt_name(dlg->endpt); 2436 w = pjsip_warning_hdr_create_from_status(tdata->pool, 2437 endpt_name, 2438 status); 2439 if (w) 2440 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)w); 2441 2442 pjsip_inv_send_msg(inv, tdata); 2443 } 2418 2444 return; 2419 2445 } 2446 2447 /* Send 2xx regardless of the status of negotiation */ 2420 2448 status = pjsip_inv_send_msg(inv, tdata); 2421 2449 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r737 r738 395 395 PJSUA_LOCK(); 396 396 397 /* Verify that we can handle the request. */398 status = pjsip_inv_verify_request(rdata, &options, NULL, NULL,399 pjsua_var.endpt, &response);400 if (status != PJ_SUCCESS) {401 402 /*403 * No we can't handle the incoming INVITE request.404 */405 406 if (response) {407 pjsip_response_addr res_addr;408 409 pjsip_get_response_addr(response->pool, rdata, &res_addr);410 pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response,411 NULL, NULL);412 413 } else {414 415 /* Respond with 500 (Internal Server Error) */416 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL,417 NULL, NULL);418 }419 420 PJSUA_UNLOCK();421 return PJ_TRUE;422 }423 424 425 /*426 * Yes we can handle the incoming INVITE request.427 */428 429 397 /* Find free call slot. */ 430 398 for (call_id=0; call_id<(int)pjsua_var.ua_cfg.max_calls; ++call_id) { … … 461 429 return PJ_TRUE; 462 430 } 431 432 433 /* Verify that we can handle the request. */ 434 status = pjsip_inv_verify_request(rdata, &options, answer, NULL, 435 pjsua_var.endpt, &response); 436 if (status != PJ_SUCCESS) { 437 438 /* 439 * No we can't handle the incoming INVITE request. 440 */ 441 442 if (response) { 443 pjsip_response_addr res_addr; 444 445 pjsip_get_response_addr(response->pool, rdata, &res_addr); 446 pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response, 447 NULL, NULL); 448 449 } else { 450 451 /* Respond with 500 (Internal Server Error) */ 452 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL, 453 NULL, NULL); 454 } 455 456 PJSUA_UNLOCK(); 457 return PJ_TRUE; 458 } 459 463 460 464 461 /* … … 1838 1835 pjsua_perror(THIS_FILE, "SDP negotiation has failed", status); 1839 1836 1837 /* Stop/destroy media, if any */ 1838 call_destroy_media(call->index); 1839 1840 1840 /* Disconnect call if we're not in the middle of initializing an 1841 1841 * UAS dialog and if this is not a re-INVITE
Note: See TracChangeset
for help on using the changeset viewer.