Changeset 4489


Ignore:
Timestamp:
Apr 23, 2013 7:53:25 AM (11 years ago)
Author:
riza
Message:

Re #1643: Modification to avoid namespace conflict with pjsua

Location:
pjproject/trunk/pjsip-apps
Files:
5 added
5 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/build/Makefile

    r4476 r4489  
    3434export PJSUA_SRCDIR = ../src/pjsua 
    3535export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 
    36             main.o pjsua_app.o pjsua_cli.o pjsua_common.o \ 
    37             pjsua_config.o pjsua_legacy.o 
     36            main.o pjsua_app.o pjsua_app_cli.o pjsua_app_common.o \ 
     37            pjsua_app_config.o pjsua_app_legacy.o 
    3838export PJSUA_CFLAGS += $(_CFLAGS) 
    3939export PJSUA_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) 
  • pjproject/trunk/pjsip-apps/build/pjsua.vcproj

    r4484 r4489  
    37093709                        </File> 
    37103710                        <File 
    3711                                 RelativePath="..\src\pjsua\pjsua_cli.c" 
     3711                                RelativePath="..\src\pjsua\pjsua_app_cli.c" 
    37123712                                > 
    37133713                        </File> 
    37143714                        <File 
    3715                                 RelativePath="..\src\pjsua\pjsua_common.c" 
     3715                                RelativePath="..\src\pjsua\pjsua_app_common.c" 
    37163716                                > 
    37173717                        </File> 
    37183718                        <File 
    3719                                 RelativePath="..\src\pjsua\pjsua_config.c" 
     3719                                RelativePath="..\src\pjsua\pjsua_app_config.c" 
    37203720                                > 
    37213721                        </File> 
    37223722                        <File 
    3723                                 RelativePath="..\src\pjsua\pjsua_legacy.c" 
     3723                                RelativePath="..\src\pjsua\pjsua_app_legacy.c" 
    37243724                                > 
    37253725                        </File> 
     
    37343734                        </File> 
    37353735                        <File 
    3736                                 RelativePath="..\src\pjsua\pjsua_common.h" 
     3736                                RelativePath="..\src\pjsua\pjsua_app_common.h" 
    37373737                                > 
    37383738                        </File> 
  • pjproject/trunk/pjsip-apps/src/pjsua/main.c

    r4476 r4489  
    2525static pj_status_t          receive_end_sig; 
    2626static pj_thread_t          *sig_thread; 
    27 static app_cfg_t            cfg; 
     27static pjsua_app_cfg_t      cfg; 
    2828 
    2929/* Called when CLI (re)started */ 
     
    3333} 
    3434 
    35 pj_bool_t on_app_stopped(pj_bool_t restart, int argc, char** argv) 
     35void on_app_stopped(pj_bool_t restart, int argc, char** argv) 
    3636{ 
    3737    cfg.argc = argc; 
     
    3939 
    4040    running = restart; 
    41     return PJ_TRUE; 
    4241} 
    4342 
     
    6160            PJ_LOG(3,(THIS_FILE, "Ctrl-C detected, quitting..")); 
    6261            receive_end_sig = PJ_TRUE; 
    63             app_destroy();           
     62            pjsua_app_destroy();             
    6463            ExitProcess(1); 
    6564            PJ_UNREACHED(return TRUE;) 
     
    105104 
    106105    while (running) {         
    107         status = app_init(&cfg); 
     106        status = pjsua_app_init(&cfg); 
    108107        if (status == PJ_SUCCESS) { 
    109             status = app_run(PJ_TRUE); 
     108            status = pjsua_app_run(PJ_TRUE); 
    110109        } else { 
    111110            pj_perror(3, THIS_FILE, status, "Failed init"); 
     
    114113 
    115114        if (!receive_end_sig) { 
    116             app_destroy(); 
     115            pjsua_app_destroy(); 
    117116 
    118117            /* This is on purpose */ 
    119             app_destroy(); 
     118            pjsua_app_destroy(); 
    120119        } else { 
    121120            pj_thread_join(sig_thread); 
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r4485 r4489  
    4747#endif 
    4848 
    49 pj_status_t app_destroy(void); 
    50  
    5149static void ringback_start(pjsua_call_id call_id); 
    5250static void ring_start(pjsua_call_id call_id); 
    5351static void ring_stop(pjsua_call_id call_id); 
    54 static pj_status_t pjsua_app_init(); 
    55 static pj_status_t pjsua_app_destroy(); 
    56  
    57 static app_cfg_t app_cfg; 
     52static pj_status_t app_init(); 
     53static pj_status_t app_destroy(); 
     54 
     55static pjsua_app_cfg_t app_cfg; 
    5856pj_str_t                    uri_arg; 
    5957pj_bool_t                   app_running = PJ_FALSE; 
     
    12171215 
    12181216/* Called on CLI (re)started, e.g: initial start, after iOS bg */ 
    1219 PJ_DEF(void) cli_on_started(pj_status_t status) 
     1217void cli_on_started(pj_status_t status) 
    12201218{ 
    12211219    /* Notify app */ 
     
    12361234 
    12371235/* Called on CLI quit */ 
    1238 PJ_DEF(pj_bool_t) cli_on_stopped(pj_bool_t restart, int argc, char* argv[]) 
     1236void cli_on_stopped(pj_bool_t restart, int argc, char* argv[]) 
    12391237{ 
    12401238    /* Notify app */ 
    12411239    if (app_cfg.on_stopped) 
    1242         return (*app_cfg.on_stopped)(restart, argc, argv); 
    1243  
    1244     return PJ_SUCCESS; 
     1240        (*app_cfg.on_stopped)(restart, argc, argv); 
    12451241} 
    12461242 
    12471243 
    12481244/* Called on pjsua legacy quit */ 
    1249 PJ_DEF(pj_bool_t) legacy_on_stopped(pj_bool_t restart) 
     1245void legacy_on_stopped(pj_bool_t restart) 
    12501246{ 
    12511247    /* Notify app */ 
    12521248    if (app_cfg.on_stopped) 
    1253         return (*app_cfg.on_stopped)(restart, 0, NULL); 
    1254  
    1255     return PJ_SUCCESS; 
    1256 } 
    1257  
    1258  
     1249        (*app_cfg.on_stopped)(restart, 1, NULL); 
     1250} 
    12591251 
    12601252/***************************************************************************** 
     
    12831275} 
    12841276 
    1285 static pj_status_t pjsua_app_init() 
     1277static pj_status_t app_init() 
    12861278{ 
    12871279    pjsua_transport_id transport_id = -1; 
     
    18451837} 
    18461838 
    1847 PJ_DEF(pj_status_t) app_init(const app_cfg_t *cfg) 
     1839pj_status_t pjsua_app_init(const pjsua_app_cfg_t *cfg) 
    18481840{ 
    18491841    pj_status_t status; 
    18501842    pj_memcpy(&app_cfg, cfg, sizeof(app_cfg)); 
    18511843 
    1852     status = pjsua_app_init(); 
     1844    status = app_init(); 
    18531845    if (status != PJ_SUCCESS) 
    18541846        return status; 
     
    18611853} 
    18621854 
    1863 pj_status_t app_run(pj_bool_t wait_telnet_cli) 
     1855pj_status_t pjsua_app_run(pj_bool_t wait_telnet_cli) 
    18641856{ 
    18651857    pj_thread_t *stdout_refresh_thread = NULL; 
     
    19171909} 
    19181910 
    1919 static pj_status_t pjsua_app_destroy() 
     1911static pj_status_t app_destroy() 
    19201912{ 
    19211913    pj_status_t status = PJ_SUCCESS; 
     
    19821974} 
    19831975 
    1984 pj_status_t app_destroy() 
     1976pj_status_t pjsua_app_destroy() 
    19851977{ 
    19861978    pj_status_t status; 
    19871979 
    1988     status = pjsua_app_destroy(); 
     1980    status = app_destroy(); 
    19891981 
    19901982    if (app_config.use_cli) {    
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.h

    r4476 r4489  
    2525 */ 
    2626 
    27 #include "pjsua_common.h" 
     27#include "pjsua_app_common.h" 
    2828 
    2929PJ_BEGIN_DECL 
     
    3232 * This structure contains the configuration of application. 
    3333 */ 
    34 typedef struct app_cfg_t 
     34typedef struct pjsua_app_cfg_t 
    3535{ 
    3636    /** 
     
    5656     * cleanup procedure. 
    5757     */ 
    58     pj_bool_t (*on_stopped)(pj_bool_t restart, int argc, char** argv); 
     58    void (*on_stopped)(pj_bool_t restart, int argc, char** argv); 
    5959 
    6060    /** 
     
    6363     */ 
    6464    void (*on_config_init)(pjsua_app_config *cfg); 
    65 } app_cfg_t; 
     65} pjsua_app_cfg_t; 
    6666 
    6767/** 
     
    6969 * the provided configuration. 
    7070 */ 
    71 PJ_DECL(pj_status_t) app_init(const app_cfg_t *app_cfg); 
     71pj_status_t pjsua_app_init(const pjsua_app_cfg_t *app_cfg); 
    7272 
    7373/** 
     
    7777 * should define this param as PJ_FALSE. 
    7878 */ 
    79 PJ_DECL(pj_status_t) app_run(pj_bool_t wait_telnet_cli); 
     79pj_status_t pjsua_app_run(pj_bool_t wait_telnet_cli); 
    8080 
    8181/** 
    8282 * This will destroy/cleanup the application library. 
    8383 */ 
    84 PJ_DECL(pj_status_t) app_destroy(); 
     84pj_status_t pjsua_app_destroy(); 
    8585 
    8686PJ_END_DECL 
Note: See TracChangeset for help on using the changeset viewer.