Ignore:
Timestamp:
Mar 6, 2006 4:25:59 PM (18 years ago)
Author:
bennylp
Message:

Added --uas-duration and --uas-refresh option (the later is broken)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_settings.c

    r300 r305  
    102102    puts  ("  --auto-answer=code  Automatically answer incoming calls with code (e.g. 200)"); 
    103103    puts  ("  --max-calls=N       Maximum number of concurrent calls (default:4, max:255)"); 
     104    puts  ("  --uas-refresh=N     Interval in UAS to send re-INVITE (default:-1)"); 
     105    puts  ("  --uas-duration=N    Maximum duration of incoming call (default:-1)"); 
    104106    puts  (""); 
    105107    fflush(stdout); 
     
    226228           OPT_PLAY_FILE, OPT_WB, OPT_UWB, OPT_RTP_PORT, OPT_ADD_CODEC, 
    227229           OPT_COMPLEXITY, OPT_QUALITY, 
    228            OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, 
     230           OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, OPT_UAS_REFRESH, 
     231           OPT_UAS_DURATION, 
    229232    }; 
    230233    struct pj_getopt_option long_options[] = { 
     
    266269        { "next-cred",  0, 0, OPT_NEXT_CRED}, 
    267270        { "max-calls",  1, 0, OPT_MAX_CALLS}, 
     271        { "uas-refresh",1, 0, OPT_UAS_REFRESH}, 
     272        { "uas-duration",1,0, OPT_UAS_DURATION}, 
    268273        { NULL, 0, 0, 0} 
    269274    }; 
     
    534539            if (pjsua.max_calls < 1 || pjsua.max_calls > 255) { 
    535540                PJ_LOG(1,(THIS_FILE,"Too many calls for max-calls (1-255)")); 
     541                return -1; 
     542            } 
     543            break; 
     544 
     545        case OPT_UAS_REFRESH: 
     546            pjsua.uas_refresh = my_atoi(pj_optarg); 
     547            if (pjsua.uas_refresh < 1) { 
     548                PJ_LOG(1,(THIS_FILE,"Invalid value for --uas-refresh (must be >0)")); 
     549                return -1; 
     550            } 
     551            break; 
     552 
     553        case OPT_UAS_DURATION: 
     554            pjsua.uas_duration = my_atoi(pj_optarg); 
     555            if (pjsua.uas_duration < 1) { 
     556                PJ_LOG(1,(THIS_FILE,"Invalid value for --uas-duration (must be >0)")); 
    536557                return -1; 
    537558            } 
     
    916937    pj_strcat2(&cfg, line); 
    917938 
     939    /* Uas-refresh. */ 
     940    if (pjsua.uas_refresh > 0) { 
     941        pj_ansi_sprintf(line, "--uas-refresh %d\n", 
     942                        pjsua.uas_refresh); 
     943        pj_strcat2(&cfg, line); 
     944    } 
     945 
     946    /* Uas-duration. */ 
     947    if (pjsua.uas_duration > 0) { 
     948        pj_ansi_sprintf(line, "--uas-duration %d\n", 
     949                        pjsua.uas_duration); 
     950        pj_strcat2(&cfg, line); 
     951    } 
    918952 
    919953    pj_strcat2(&cfg, "#\n# Buddies:\n#\n"); 
Note: See TracChangeset for help on using the changeset viewer.