Ignore:
Timestamp:
Jun 13, 2006 10:57:13 PM (18 years ago)
Author:
bennylp
Message:

-- REWRITE OF PJSUA API --

File:
1 edited

Legend:

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

    r492 r503  
    1818 */ 
    1919#include <pjsua-lib/pjsua.h> 
    20 #include <pjsua-lib/pjsua_console_app.h> 
    21  
    2220 
    2321#define THIS_FILE       "main.c" 
    2422 
    25 /***************************************************************************** 
    26  * main(): 
     23 
     24/* 
     25 * These are defined in pjsua.c. 
    2726 */ 
     27pj_status_t app_init(int argc, char *argv[]); 
     28pj_status_t app_main(void); 
     29pj_status_t app_destroy(void); 
     30 
    2831int main(int argc, char *argv[]) 
    2932{ 
    30     pjsua_config cfg; 
    31     pj_str_t uri_to_call = { NULL, 0 }; 
    32  
    33     /* Init default settings. */ 
    34     pjsua_default_config(&cfg); 
    35  
    36  
    37     /* Create PJLIB and memory pool */ 
    38     pjsua_create(); 
    39  
    40  
    41     /* Parse command line arguments: */ 
    42     if (pjsua_parse_args(argc, argv, &cfg, &uri_to_call) != PJ_SUCCESS) 
     33    if (app_init(argc, argv) != PJ_SUCCESS) 
    4334        return 1; 
    4435 
    45  
    46     /* Init pjsua */ 
    47     if (pjsua_init(&cfg, &console_callback) != PJ_SUCCESS) 
    48         return 1; 
    49  
    50  
    51     /* Start pjsua! */ 
    52     if (pjsua_start() != PJ_SUCCESS) { 
    53         pjsua_destroy(); 
    54         return 1; 
    55     } 
    56  
    57  
    58     /* Sleep for a while, let any messages get printed to console: */ 
    59     pj_thread_sleep(500); 
    60  
    61  
    62     /* Start UI console main loop: */ 
    63     pjsua_console_app_main(&uri_to_call); 
    64  
    65  
    66     /* Destroy pjsua: */ 
    67     pjsua_destroy(); 
    68  
    69     /* This is for internal testing, to make sure that pjsua_destroy() 
    70      * can be called multiple times.  
    71      */ 
    72     pjsua_destroy(); 
    73  
    74  
    75     /* Exit... */ 
     36    app_main(); 
     37    app_destroy(); 
    7638 
    7739    return 0; 
Note: See TracChangeset for help on using the changeset viewer.