Changeset 2262 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Sep 4, 2008 1:55:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2227 r2262 24 24 25 25 //#define STEREO_DEMO 26 //#define TRANSPORT_ADAPTER_SAMPLE 26 27 27 28 /* Ringtones US UK */ … … 132 133 #ifdef STEREO_DEMO 133 134 static void stereo_demo(); 135 #endif 136 #ifdef TRANSPORT_ADAPTER_SAMPLE 137 static pj_status_t transport_adapter_sample(void); 134 138 #endif 135 139 pj_status_t app_destroy(void); … … 4207 4211 4208 4212 /* Add RTP transports */ 4213 #ifdef TRANSPORT_ADAPTER_SAMPLE 4214 status = transport_adapter_sample(); 4215 4216 #else 4209 4217 status = pjsua_media_transports_create(&app_config.rtp_cfg); 4218 #endif 4210 4219 if (status != PJ_SUCCESS) 4211 4220 goto on_error; … … 4392 4401 #endif 4393 4402 4403 #ifdef TRANSPORT_ADAPTER_SAMPLE 4404 static pj_status_t create_transport_adapter(pjmedia_endpt *med_endpt, int port, 4405 pjmedia_transport **p_tp) 4406 { 4407 pjmedia_transport *udp; 4408 pj_status_t status; 4409 4410 /* Create the UDP media transport */ 4411 status = pjmedia_transport_udp_create(med_endpt, NULL, port, 0, &udp); 4412 if (status != PJ_SUCCESS) 4413 return status; 4414 4415 /* Create the adapter */ 4416 status = pjmedia_tp_adapter_create(med_endpt, NULL, udp, p_tp); 4417 if (status != PJ_SUCCESS) { 4418 pjmedia_transport_close(udp); 4419 return status; 4420 } 4421 4422 return PJ_SUCCESS; 4423 } 4424 4425 static pj_status_t transport_adapter_sample(void) 4426 { 4427 pjsua_media_transport tp[PJSUA_MAX_CALLS]; 4428 pj_status_t status; 4429 int port = 7000; 4430 unsigned i; 4431 4432 for (i=0; i<app_config.cfg.max_calls; ++i) { 4433 status = create_transport_adapter(pjsua_get_pjmedia_endpt(), 4434 port + i*10, 4435 &tp[i].transport); 4436 if (status != PJ_SUCCESS) 4437 return status; 4438 } 4439 4440 return pjsua_media_transports_attach(tp, i, PJ_TRUE); 4441 } 4442 #endif 4443
Note: See TracChangeset
for help on using the changeset viewer.