Ignore:
Timestamp:
Apr 19, 2013 6:05:06 AM (6 years ago)
Author:
riza
Message:

Re #1643: Code restructure + modification to handle non blocking mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_common.h

    r4461 r4476  
    2626#define current_acc     pjsua_acc_get_default() 
    2727 
    28 #define NO_LIMIT_DURATION   (int)0x7FFFFFFF 
    29 #define MAX_AVI             4 
    30 #define NO_NB               -2 
     28#define PJSUA_APP_NO_LIMIT_DURATION     (int)0x7FFFFFFF 
     29#define PJSUA_APP_MAX_AVI               4 
     30#define PJSUA_APP_NO_NB                 -2 
    3131 
    3232typedef struct input_result 
     
    5353    pj_bool_t               out_auto_transmit; 
    5454} app_vid; 
     55 
     56/* Enumeration of CLI frontends */ 
     57typedef enum { 
     58    CLI_FE_CONSOLE          = 1, 
     59    CLI_FE_TELNET           = 2 
     60} CLI_FE; 
     61 
     62/** CLI config **/ 
     63typedef struct cli_cfg_t 
     64{ 
     65    /** Bitmask of CLI_FE **/ 
     66    int                     cli_fe; 
     67    pj_cli_cfg              cfg; 
     68    pj_cli_telnet_cfg       telnet_cfg; 
     69    pj_cli_console_cfg      console_cfg; 
     70} cli_cfg_t; 
    5571 
    5672/* Pjsua application data */ 
     
    134150        pjmedia_vid_dev_index   dev_id; 
    135151        pjsua_conf_port_id      slot; 
    136     } avi[MAX_AVI]; 
     152    } avi[PJSUA_APP_MAX_AVI]; 
    137153    pj_bool_t               avi_auto_play; 
    138154    int                     avi_def_idx; 
     
    140156    /* CLI setting */ 
    141157    pj_bool_t               use_cli; 
    142     int                     cli_telnet_port; 
    143     pj_bool_t               disable_cli_console; 
     158    cli_cfg_t               cli_cfg; 
    144159} pjsua_app_config; 
    145  
    146 /** CLI callback **/ 
    147 /** This specifies the callback called when cli quit is called. **/ 
    148 typedef void (*pj_cli_on_quit)(pj_bool_t is_restarting); 
    149 /** This callback is called when the cli is completely destroyed **/ 
    150 typedef void (*pj_cli_on_destroy)(void); 
    151 /** This callback is called when pjsua restart command is invode by cli **/ 
    152 typedef void (*pj_cli_on_restart_pjsua)(void); 
    153160 
    154161/** Extern variable declaration **/ 
     
    159166extern pjsua_call_setting   call_opt; 
    160167extern pjsua_msg_data       msg_data; 
     168extern pj_bool_t            app_running; 
    161169 
    162170PJ_DECL(int) my_atoi(const char *cs); 
     
    172180PJ_DECL(pj_bool_t) is_cli_inited(); 
    173181 
    174 /** Defined in pjsua_app.c **/ 
    175 PJ_DECL(pj_status_t) app_init(pj_cli_telnet_on_started on_started_cb, 
    176                               pj_cli_on_quit on_quit_cb, 
    177                               pj_cli_on_destroy on_destroy_cb, 
    178                               pj_cli_on_restart_pjsua on_restart_pjsua_cb); 
    179 PJ_DECL(void) setup_signal_handler(void); 
    180  
    181182/** Defined in pjsua_config.c **/ 
    182 /** This is to store the app runtime/startup options **/ 
    183 PJ_DECL(void) add_startup_config(int argc, char *argv[]); 
    184 /** This is to store the app reload options **/ 
    185 PJ_DECL(void) add_reload_config(unsigned idx, pj_str_t *option); 
    186183/** This is to load the configuration **/ 
    187 PJ_DECL(pj_status_t) load_config(pjsua_app_config *app_config,  
    188                                  pj_str_t *uri_arg, 
    189                                  pj_bool_t app_running); 
     184PJ_DECL(pj_status_t) load_config(int argc, 
     185                                 char **argv, 
     186                                 pj_str_t *uri_arg); 
     187 
     188/** Pjsua app callback **/ 
     189/** This callback is called when CLI is started. **/ 
     190PJ_DECL(void) cli_on_started(pj_status_t status); 
     191 
     192/** This callback is called when "shutdown"/"restart" command is invoked **/ 
     193PJ_DECL(pj_bool_t) cli_on_stopped(pj_bool_t restart, int argc, char **argv); 
     194 
     195/** This callback is called when "quit"/"restart" command is invoked **/ 
     196PJ_DECL(pj_bool_t) legacy_on_stopped(pj_bool_t restart); 
     197 
     198/** Pjsua cli method **/ 
     199PJ_DECL(pj_status_t) cli_init(); 
     200PJ_DECL(pj_status_t) cli_main(pj_bool_t wait_telnet_cli); 
     201PJ_DECL(void) cli_destroy(); 
     202PJ_DECL(void) cli_get_info(char *info, pj_size_t size);  
     203 
     204/** Legacy method **/ 
     205PJ_DECL(void) legacy_main(); 
    190206 
    191207#if PJSUA_HAS_VIDEO 
     
    211227PJ_END_DECL 
    212228     
    213 #endif  /* __PJSUA_CMD_H__ */ 
    214  
     229#endif  /* __PJSUA_COMMON_H__ */ 
     230 
Note: See TracChangeset for help on using the changeset viewer.