Changeset 1670


Ignore:
Timestamp:
Jan 8, 2008 10:50:06 PM (16 years ago)
Author:
bennylp
Message:

Added call gaping in siprtp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/siprtp.c

    r1657 r1670  
    3636" Program options:\n" 
    3737"   --count=N,        -c    Set number of calls to create (default:1) \n" 
     38"   --gap=N           -g    Set call gapping to N msec (default:0)\n" 
    3839"   --duration=SEC,   -d    Set maximum call duration (default:unlimited) \n" 
    3940"   --auto-quit,      -q    Quit when calls have been completed (default:no)\n" 
     41"   --call-report     -R    Display report on call termination (default:yes)\n" 
    4042"\n" 
    4143" Address and ports options:\n" 
     
    160162{ 
    161163    unsigned             max_calls; 
     164    unsigned             call_gap; 
     165    pj_bool_t            call_report; 
    162166    unsigned             uac_calls; 
    163167    unsigned             duration; 
     
    759763                  (int)inv->cause_text.slen, 
    760764                  inv->cause_text.ptr)); 
    761         PJ_LOG(3,(THIS_FILE, "Call #%d statistics:", call->index)); 
    762         print_call(call->index); 
     765 
     766        if (app.call_report) { 
     767            PJ_LOG(3,(THIS_FILE, "Call #%d statistics:", call->index)); 
     768            print_call(call->index); 
     769        } 
    763770 
    764771 
     
    847854    struct pj_getopt_option long_options[] = { 
    848855        { "count",          1, 0, 'c' }, 
     856        { "gap",            1, 0, 'g' }, 
     857        { "call-report",    0, 0, 'R' }, 
    849858        { "duration",       1, 0, 'd' }, 
    850859        { "auto-quit",      0, 0, 'q' }, 
     
    899908    /* Parse options */ 
    900909    pj_optind = 0; 
    901     while((c=pj_getopt_long(argc,argv, "c:d:p:r:i:l:q",  
     910    while((c=pj_getopt_long(argc,argv, "c:d:p:r:i:l:g:qR",  
    902911                            long_options, &option_index))!=-1)  
    903912    { 
     
    909918                return 1; 
    910919            } 
     920            break; 
     921        case 'g': 
     922            app.call_gap = atoi(pj_optarg); 
     923            break; 
     924        case 'R': 
     925            app.call_report = PJ_TRUE; 
    911926            break; 
    912927        case 'd': 
     
    18311846            continue; 
    18321847        hangup_call(i); 
     1848        pj_thread_sleep(app.call_gap); 
    18331849    } 
    18341850     
     
    21132129                break; 
    21142130            } 
     2131            pj_thread_sleep(app.call_gap); 
    21152132        } 
    21162133 
Note: See TracChangeset for help on using the changeset viewer.