Changeset 668
- Timestamp:
- Aug 9, 2006 1:53:59 PM (18 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src/samples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
r657 r668 397 397 pj_bool_t has_initial = PJ_TRUE; 398 398 399 PJ_UNUSED_ARG(h); 400 399 401 entry->id = 0; 400 402 send_response(call->inv, NULL, 200, &has_initial); … … 533 535 } else { 534 536 /* Send the 200 response immediately . */ 535 status = pjsip_inv_send_msg(call->inv, tdata);537 status = send_response(call->inv, rdata, 200, &has_initial); 536 538 PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return PJ_TRUE); 537 539 } -
pjproject/trunk/pjsip-apps/src/samples/simpleua.c
r582 r668 257 257 PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 258 258 259 /*260 * Initialize RTP socket info for the media.261 * The RTP socket is hard-codec to port 4000.262 */263 status = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &g_med_skinfo.rtp_sock);264 PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);265 259 266 pj_sockaddr_in_init( &g_med_skinfo.rtp_addr_name, 267 pjsip_endpt_name(g_endpt), 4000); 268 269 status = pj_sock_bind(g_med_skinfo.rtp_sock, &g_med_skinfo.rtp_addr_name, 270 sizeof(pj_sockaddr_in)); 271 if (status != PJ_SUCCESS) { 272 app_perror( THIS_FILE, 273 "Unable to bind RTP socket", 274 status); 275 return 1; 276 } 277 278 279 /* For simplicity, ignore RTCP socket. */ 280 g_med_skinfo.rtcp_sock = PJ_INVALID_SOCKET; 281 g_med_skinfo.rtcp_addr_name = g_med_skinfo.rtp_addr_name; 282 283 284 /* Create media transport */ 285 status = pjmedia_transport_udp_attach(g_med_endpt, NULL, &g_med_skinfo, 286 0, &g_med_transport); 260 /* 261 * Create media transport used to send/receive RTP/RTCP socket. 262 * One media transport is needed for each call. Application may 263 * opt to re-use the same media transport for subsequent calls. 264 */ 265 status = pjmedia_transport_udp_create(g_med_endpt, NULL, 4000, 0, 266 &g_med_transport); 287 267 if (status != PJ_SUCCESS) { 288 268 app_perror(THIS_FILE, "Unable to create media transport", status); 289 269 return 1; 290 270 } 271 272 /* 273 * Get socket info (address, port) of the media transport. We will 274 * need this info to create SDP (i.e. the address and port info in 275 * the SDP). 276 */ 277 { 278 pjmedia_transport_udp_info udp_info; 279 280 pjmedia_transport_udp_get_info(g_med_transport, &udp_info); 281 pj_memcpy(&g_med_skinfo, &udp_info.skinfo, 282 sizeof(pjmedia_sock_info)); 283 } 284 291 285 292 286 /*
Note: See TracChangeset
for help on using the changeset viewer.