Ignore:
Timestamp:
Aug 17, 2009 3:33:45 PM (13 years ago)
Author:
bennylp
Message:

Misc (ticket #915): added reload command in pjsua to shutdown and reinitialize the library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/main.c

    r2407 r2892  
    2424 
    2525/* 
    26  * These are defined in pjsua.c. 
     26 * These are defined in pjsua_app.c. 
    2727 */ 
     28extern pj_bool_t app_restart; 
    2829pj_status_t app_init(int argc, char *argv[]); 
    2930pj_status_t app_main(void); 
     
    7677int main(int argc, char *argv[]) 
    7778{ 
    78     if (app_init(argc, argv) != PJ_SUCCESS) 
    79         return 1; 
     79    do { 
     80        app_restart = PJ_FALSE; 
    8081 
    81     setup_signal_handler(); 
     82        if (app_init(argc, argv) != PJ_SUCCESS) 
     83            return 1; 
    8284 
    83     app_main(); 
    84     app_destroy(); 
     85        setup_signal_handler(); 
    8586 
    86     /* This is on purpose */ 
    87     app_destroy(); 
     87        app_main(); 
     88        app_destroy(); 
     89 
     90        /* This is on purpose */ 
     91        app_destroy(); 
     92    } while (app_restart); 
    8893 
    8994    return 0; 
Note: See TracChangeset for help on using the changeset viewer.