Ignore:
Timestamp:
Sep 15, 2007 8:30:16 AM (17 years ago)
Author:
bennylp
Message:

Ticket #370: Implemented callback notification to application when ICE negotiation fails (via on_call_media_state callback)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_session.c

    r1410 r1435  
    337337    } 
    338338 
     339    if (ice->completion_timer.id) { 
     340        pj_timer_heap_cancel(ice->stun_cfg.timer_heap,  
     341                             &ice->completion_timer); 
     342        ice->completion_timer.id = PJ_FALSE; 
     343    } 
     344 
    339345    for (i=0; i<ice->comp_cnt; ++i) { 
    340346        if (ice->comp[i].stun_sess) { 
     
    946952} 
    947953 
     954/* Timer callback to call on_ice_complete() callback */ 
     955static void on_completion_timer(pj_timer_heap_t *th,  
     956                                pj_timer_entry *te) 
     957{ 
     958    pj_ice_sess *ice = (pj_ice_sess*) te->user_data; 
     959 
     960    PJ_UNUSED_ARG(th); 
     961 
     962    te->id = PJ_FALSE; 
     963 
     964    if (ice->cb.on_ice_complete) 
     965        (*ice->cb.on_ice_complete)(ice, ice->ice_status); 
     966} 
     967 
    948968/* This function is called when ICE processing completes */ 
    949969static void on_ice_complete(pj_ice_sess *ice, pj_status_t status) 
     
    963983        /* Call callback */ 
    964984        if (ice->cb.on_ice_complete) { 
    965             (*ice->cb.on_ice_complete)(ice, status); 
     985            pj_time_val delay = {0, 0}; 
     986 
     987            ice->completion_timer.cb = &on_completion_timer; 
     988            ice->completion_timer.user_data = (void*) ice; 
     989            ice->completion_timer.id = PJ_TRUE; 
     990 
     991            pj_timer_heap_schedule(ice->stun_cfg.timer_heap,  
     992                                   &ice->completion_timer, 
     993                                   &delay); 
    966994        } 
    967995    } 
Note: See TracChangeset for help on using the changeset viewer.