Ignore:
Timestamp:
Jun 26, 2012 2:28:59 AM (12 years ago)
Author:
nanang
Message:

Close #1523:

  • updated scenarios to work with mod_sipp.py (adding config .py file, etc)
  • integrated mod_sipp.py to runall.py
  • removed uas.xml, as it is similar to recvfrom\100_simple.py (REGISTER+resp 200)
  • renamed scenarios (to allow running these SIPp scenarios without .py file):
    • prack_fork.xml -> uas-prack_fork.xml
    • inv_401_retry_after_100.xml -> uas-inv_401_retry_after_100.xml
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/tests/pjsua/mod_sipp.py

    r4147 r4177  
    88import subprocess 
    99from inc_cfg import * 
     10import inc_const 
    1011 
    1112# SIPp executable path and param 
     
    1314SIPP_PATH = 'sipp' 
    1415SIPP_PARAM = "-i 127.0.0.1 -p 6000 -m 1 127.0.0.1" 
    15 SIPP_TIMEOUT = 10 
     16SIPP_TIMEOUT = 60 
    1617# On BG mode, SIPp doesn't require special terminal 
    1718# On non-BG mode, on win, it needs env var: "TERMINFO=c:\cygwin\usr\share\terminfo" 
    1819SIPP_BG_MODE = True 
    1920 
    20 PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp" 
     21# Will be updated based on configuration file (a .py file whose the same name as SIPp XML file) 
    2122PJSUA_INST_PARAM = [] 
    2223PJSUA_EXPECTS = [] 
     24 
     25# Default PJSUA param if configuration file (the corresponding .py file) is not available: 
     26# - no-tcp as SIPp is on UDP only 
     27# - id, username, and realm: to allow PJSUA sending re-INVITE with auth after receiving 401/407 response 
     28PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp --id=sip:a@localhost --username=a --realm=*" 
    2329 
    2430# Get SIPp scenario (XML file) 
     
    5864        sipp_param = sipp_param + " -bg" 
    5965    if SIPP_TIMEOUT: 
    60         sipp_param = sipp_param + " -timeout "+str(SIPP_TIMEOUT)+"s -timeout_error" 
     66        sipp_param = sipp_param + " -timeout "+str(SIPP_TIMEOUT)+"s -timeout_error" + " -deadcall_wait "+str(SIPP_TIMEOUT)+"s" 
    6167    fullcmd = os.path.normpath(SIPP_PATH) + " " + sipp_param 
    6268    print "Running SIPP: " + fullcmd 
     
    132138        ua.append(t.process[ua_idx]) 
    133139 
    134     # If there is no PJSUA EXPECT scenario, must keep polling PJSUA stdout 
    135     # otherwise PJSUA process may stuck (due to stdout pipe buffer full?) 
    136     # Ideally the poll should be done contiunously until SIPp process is 
    137     # terminated. 
    138     if len(PJSUA_EXPECTS)==0: 
    139         import inc_const 
    140         ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False) 
    141         return "" 
    142  
    143140    ua_err_st = "" 
    144141    while len(PJSUA_EXPECTS): 
     
    159156            ua_err_st = "Unknown error" 
    160157            break; 
     158 
     159    # Need to poll here for handling these cases: 
     160    # - If there is no PJSUA EXPECT scenario, we must keep polling the stdout, 
     161    #   otherwise PJSUA process may stuck (due to stdout pipe buffer full?). 
     162    # - last PJSUA_EXPECT contains a pjsua command that needs time to 
     163    #   finish, for example "v" (re-INVITE), the SIPp XML scenario may expect 
     164    #   that re-INVITE transaction to be completed and without stdout poll 
     165    #   PJSUA process may stuck. 
     166    # Ideally the poll should be done contiunously until SIPp process is 
     167    # terminated. 
     168    ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False) 
    161169 
    162170    return ua_err_st 
Note: See TracChangeset for help on using the changeset viewer.