Changeset 4363 for pjproject/trunk
- Timestamp:
- Feb 21, 2013 4:43:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r4345 r4363 553 553 #endif 554 554 555 static void med_tp_timer_cb(void *user_data) 555 /* Deferred callback to notify ICE init complete */ 556 static void ice_init_complete_cb(void *user_data) 556 557 { 557 558 pjsua_call_media *call_med = (pjsua_call_media*)user_data; … … 571 572 pjsip_dialog *dlg = NULL; 572 573 573 if (acquire_call(" med_tp_timer_cb", call_med->call->index,574 if (acquire_call("ice_init_complete_cb", call_med->call->index, 574 575 &call, &dlg) != PJ_SUCCESS) 575 576 { … … 586 587 } 587 588 589 /* Deferred callback to notify ICE negotiation failure */ 590 static void ice_failed_nego_cb(void *user_data) 591 { 592 int call_id = (int)(long)user_data; 593 pjsua_call *call = NULL; 594 pjsip_dialog *dlg = NULL; 595 596 if (acquire_call("ice_failed_nego_cb", call_id, 597 &call, &dlg) != PJ_SUCCESS) 598 { 599 /* Call have been terminated */ 600 return; 601 } 602 603 pjsua_var.ua_cfg.cb.on_call_media_state(call_id); 604 605 if (dlg) 606 pjsip_dlg_dec_lock(dlg); 607 608 } 588 609 589 610 /* This callback is called when ICE negotiation completes */ … … 603 624 case PJ_ICE_STRANS_OP_INIT: 604 625 call_med->tp_result = result; 605 pjsua_schedule_timer2(& med_tp_timer_cb, call_med, 1);626 pjsua_schedule_timer2(&ice_init_complete_cb, call_med, 1); 606 627 break; 607 628 case PJ_ICE_STRANS_OP_NEGOTIATION: … … 616 637 call_med->dir = PJMEDIA_DIR_NONE; 617 638 if (call && pjsua_var.ua_cfg.cb.on_call_media_state) { 618 pjsua_var.ua_cfg.cb.on_call_media_state(call->index); 639 /* Defer the callback to a timer */ 640 pjsua_schedule_timer2(&ice_failed_nego_cb, 641 (void*)(long)call->index, 1); 619 642 } 620 643 }
Note: See TracChangeset
for help on using the changeset viewer.