- Timestamp:
- Jan 17, 2008 5:29:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/users/nanang/pjsip/src/pjsua-lib/pjsua_media.c
r1655 r1698 535 535 goto on_error; 536 536 } 537 status = pjmedia_transport_udp_attach(pjsua_var.med_endpt, NULL, 538 &skinfo, 0, 539 &pjsua_var.calls[i].med_tp); 537 538 if (pjsua_var.media_cfg.enable_srtp) { 539 pjmedia_transport *tp; 540 unsigned srtp_options = 541 PJMEDIA_SRTP_AUTO_CLOSE_UNDERLYING_TRANSPORT; 542 543 status = pjmedia_transport_udp_attach(pjsua_var.med_endpt, NULL, 544 &skinfo, 0, &tp); 545 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, tp, 546 srtp_options, 547 &pjsua_var.calls[i].med_tp); 548 } else { 549 status = pjmedia_transport_udp_attach(pjsua_var.med_endpt, NULL, 550 &skinfo, 0, 551 &pjsua_var.calls[i].med_tp); 552 } 540 553 if (status != PJ_SUCCESS) { 541 554 pjsua_perror(THIS_FILE, "Unable to create media transport", … … 544 557 } 545 558 546 pjmedia_transport_ udp_simulate_lost(pjsua_var.calls[i].med_tp,547 548 549 550 pjmedia_transport_ udp_simulate_lost(pjsua_var.calls[i].med_tp,551 552 559 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 560 PJMEDIA_DIR_ENCODING, 561 pjsua_var.media_cfg.tx_drop_pct); 562 563 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 564 PJMEDIA_DIR_DECODING, 565 pjsua_var.media_cfg.rx_drop_pct); 553 566 554 567 } … … 646 659 } 647 660 648 pjmedia_ ice_simulate_lost(pjsua_var.calls[i].med_tp,649 PJMEDIA_DIR_ENCODING,650 pjsua_var.media_cfg.tx_drop_pct);651 652 pjmedia_ ice_simulate_lost(pjsua_var.calls[i].med_tp,653 PJMEDIA_DIR_DECODING,654 pjsua_var.media_cfg.rx_drop_pct);661 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 662 PJMEDIA_DIR_ENCODING, 663 pjsua_var.media_cfg.tx_drop_pct); 664 665 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 666 PJMEDIA_DIR_DECODING, 667 pjsua_var.media_cfg.rx_drop_pct); 655 668 656 669 status = pjmedia_ice_start_init(pjsua_var.calls[i].med_tp, 0, &addr, … … 757 770 758 771 /* Restart ICE */ 759 pjmedia_ ice_stop_ice(call->med_tp);772 pjmedia_transport_media_stop(call->med_tp); 760 773 761 774 status = pjmedia_ice_init_ice(call->med_tp, ice_role, NULL, NULL); … … 769 782 pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, 770 783 pj_pool_t *pool, 784 const pjmedia_sdp_session *rem_sdp, 771 785 pjmedia_sdp_session **p_sdp) 772 786 { … … 816 830 } 817 831 818 if (pjsua_var.media_cfg.enable_ice) { 819 status = pjmedia_ice_modify_sdp(call->med_tp, pool, sdp); 832 //if (pjsua_var.media_cfg.enable_ice) { 833 //status = pjmedia_transport_media_create(call->med_tp, pool, sdp, NULL); 834 status = pjmedia_transport_media_create(call->med_tp, pool, 835 sdp, rem_sdp); 820 836 if (status != PJ_SUCCESS) 821 837 goto on_error; 822 }838 //} 823 839 824 840 *p_sdp = sdp; … … 859 875 stop_media_session(call_id); 860 876 861 if (pjsua_var.media_cfg.enable_ice) {862 pjmedia_ ice_stop_ice(call->med_tp);863 }877 //if (pjsua_var.media_cfg.enable_ice) { 878 pjmedia_transport_media_stop(call->med_tp); 879 //} 864 880 865 881 return PJ_SUCCESS; … … 885 901 886 902 pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, 887 constpjmedia_sdp_session *local_sdp,903 pjmedia_sdp_session *local_sdp, 888 904 const pjmedia_sdp_session *remote_sdp) 889 905 { … … 947 963 948 964 /* Shutdown ICE session */ 949 if (pjsua_var.media_cfg.enable_ice) {950 pjmedia_ ice_stop_ice(call->med_tp);951 }965 //if (pjsua_var.media_cfg.enable_ice) { 966 pjmedia_transport_media_stop(call->med_tp); 967 //} 952 968 953 969 /* No need because we need keepalive? */ … … 955 971 } else { 956 972 /* Start ICE */ 957 if (pjsua_var.media_cfg.enable_ice) { 958 status = pjmedia_ice_start_ice(call->med_tp, call->inv->pool, 959 remote_sdp, 0); 973 //if (pjsua_var.media_cfg.enable_ice) { 974 status = pjmedia_transport_media_start(call->med_tp, 975 call->inv->pool, 976 local_sdp, remote_sdp, 0); 960 977 if (status != PJ_SUCCESS) 961 978 return status; 962 }979 //} 963 980 964 981 /* Override ptime, if this option is specified. */
Note: See TracChangeset
for help on using the changeset viewer.