Ignore:
Timestamp:
Jul 1, 2010 10:25:47 AM (12 years ago)
Author:
ming
Message:

Re #1098:
Fixed failure in socket binding of CLI telnet daemon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/cli/pjsip-apps/src/samples/clidemo.c

    r3231 r3232  
    3030#define THIS_FILE       "clidemo.c" 
    3131 
     32/* Set this to 1 if you want to let the system assign a port 
     33 * for the CLI telnet daemon. 
     34 * Default: 1 
     35 */ 
     36#define USE_RANDOM_PORT 1 
     37 
    3238struct cmd_xml_t { 
    3339    char * xml; 
     
    128134    pjlib_util_init(); 
    129135 
    130     pj_log_set_log_func(&log_writer); 
    131  
    132136    /* 
    133137     * Create CLI app. 
     
    158162    pj_cli_telnet_cfg_default(&tcfg); 
    159163//    tcfg.passwd = pj_str("pjsip"); 
     164#if USE_RANDOM_PORT 
     165    tcfg.port = 0; 
     166#endif 
    160167    status = pj_cli_telnet_create(cli, &tcfg, NULL); 
    161168    if (status != PJ_SUCCESS) 
     
    196203    if (status != PJ_SUCCESS) 
    197204        return status; 
     205 
     206    pj_log_set_log_func(&log_writer); 
    198207 
    199208    /* 
Note: See TracChangeset for help on using the changeset viewer.