diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-08-17 15:33:45 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-08-17 15:33:45 +0000 |
commit | 11cfa6f01fae0418234b517996d86094632f6e17 (patch) | |
tree | db0a05e93e473b9a9983f89b4a2bb53182a6c000 /pjsip-apps/src/pjsua/main.c | |
parent | d29873572ef5ef79cf37c76247b4eecd8928ec53 (diff) |
Misc (ticket #915): added reload command in pjsua to shutdown and reinitialize the library
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2892 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/pjsua/main.c')
-rw-r--r-- | pjsip-apps/src/pjsua/main.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pjsip-apps/src/pjsua/main.c b/pjsip-apps/src/pjsua/main.c index 79235308..37941efe 100644 --- a/pjsip-apps/src/pjsua/main.c +++ b/pjsip-apps/src/pjsua/main.c @@ -23,8 +23,9 @@ /* - * These are defined in pjsua.c. + * These are defined in pjsua_app.c. */ +extern pj_bool_t app_restart; pj_status_t app_init(int argc, char *argv[]); pj_status_t app_main(void); pj_status_t app_destroy(void); @@ -75,16 +76,20 @@ static void setup_signal_handler(void) int main(int argc, char *argv[]) { - if (app_init(argc, argv) != PJ_SUCCESS) - return 1; + do { + app_restart = PJ_FALSE; - setup_signal_handler(); + if (app_init(argc, argv) != PJ_SUCCESS) + return 1; - app_main(); - app_destroy(); + setup_signal_handler(); - /* This is on purpose */ - app_destroy(); + app_main(); + app_destroy(); + + /* This is on purpose */ + app_destroy(); + } while (app_restart); return 0; } |