- Timestamp:
- Jun 26, 2008 1:29:29 PM (16 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src/test-pjsua
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/test-pjsua/inc_cfg.py
r2057 r2059 56 56 self.have_reg = have_reg 57 57 self.have_publish = have_publish 58 if not ("--publish" in self.arg):58 if have_publish and have_reg and not ("--publish" in self.arg): 59 59 self.arg = self.arg + " --publish" 60 60 self.echo_enabled = echo_enabled -
pjproject/trunk/pjsip-apps/src/test-pjsua/mod_call.py
r2029 r2059 4 4 import sys 5 5 import inc_const as const 6 from inc_cfg import * 6 7 7 8 # Load configuration 8 9 cfg_file = imp.load_source("cfg_file", sys.argv[2]) 10 11 # Check media flow between ua1 and ua2 12 def check_media(ua1, ua2): 13 ua1.send("#") 14 ua1.send("1122") 15 ua2.expect(const.RX_DTMF + "1") 16 ua2.expect(const.RX_DTMF + "1") 17 ua2.expect(const.RX_DTMF + "2") 18 ua2.expect(const.RX_DTMF + "2") 9 19 10 20 … … 14 24 caller = t.process[1] 15 25 26 # if have_reg then wait for couple of seconds for PUBLISH 27 # to complete (just in case pUBLISH is used) 28 if callee.inst_param.have_reg: 29 time.sleep(1) 30 if caller.inst_param.have_reg: 31 time.sleep(1) 32 16 33 # Caller making call 17 34 caller.send("m") … … 19 36 caller.expect(const.STATE_CALLING) 20 37 21 # Callee answers with 200/OK38 # Callee waits for call and answers with 180/Ringing 22 39 time.sleep(1) 23 40 callee.expect(const.EVENT_INCOMING_CALL) 41 callee.send("a") 42 callee.send("180") 43 callee.expect("SIP/2.0 180") 44 caller.expect("SIP/2.0 180") 45 46 # Synchronize stdout 47 caller.sync_stdout() 48 callee.sync_stdout() 49 50 # Callee answers with 200/OK 24 51 callee.send("a") 25 52 callee.send("200") … … 27 54 # Wait until call is connected in both endpoints 28 55 time.sleep(1) 29 if callee.expect(const.STATE_CONFIRMED, False)==None:30 raise TestError("Call failed")31 56 caller.expect(const.STATE_CONFIRMED) 57 callee.expect(const.STATE_CONFIRMED) 32 58 33 59 # Synchronize stdout 34 caller.send("echo 1") 35 caller.expect("echo 1") 36 callee.send("echo 1") 37 callee.expect("echo 1") 60 caller.sync_stdout() 61 callee.sync_stdout() 62 time.sleep(1) 63 caller.sync_stdout() 64 callee.sync_stdout() 38 65 39 # Test that media is okay (with RFC 2833 DTMF)66 # Test that media is okay 40 67 time.sleep(2) 41 caller.send("#") 42 caller.send("1122") 43 callee.expect(const.RX_DTMF + "1") 44 callee.expect(const.RX_DTMF + "1") 45 callee.expect(const.RX_DTMF + "2") 46 callee.expect(const.RX_DTMF + "2") 68 check_media(caller, callee) 69 check_media(callee, caller) 47 70 48 # Hold call 71 # Hold call by caller 49 72 caller.send("H") 73 caller.sync_stdout() 50 74 caller.expect(const.MEDIA_HOLD) 51 75 callee.expect(const.MEDIA_HOLD) 52 76 77 # Synchronize stdout 78 caller.sync_stdout() 79 callee.sync_stdout() 80 53 81 # Release hold 54 82 time.sleep(2) 55 83 caller.send("v") 84 caller.sync_stdout() 85 callee.expect(const.MEDIA_ACTIVE) 86 caller.expect(const.MEDIA_ACTIVE) 87 88 # Synchronize stdout 89 caller.sync_stdout() 90 callee.sync_stdout() 91 92 # Test that media is okay 93 check_media(caller, callee) 94 check_media(callee, caller) 95 96 # Synchronize stdout 97 caller.sync_stdout() 98 callee.sync_stdout() 99 100 # Hold call by callee 101 callee.send("H") 102 callee.sync_stdout() 103 caller.expect(const.MEDIA_HOLD) 104 callee.expect(const.MEDIA_HOLD) 105 106 # Synchronize stdout 107 caller.sync_stdout() 108 callee.sync_stdout() 109 110 # Release hold 111 time.sleep(2) 112 callee.send("v") 113 callee.sync_stdout() 56 114 caller.expect(const.MEDIA_ACTIVE) 57 115 callee.expect(const.MEDIA_ACTIVE) 58 116 59 117 # Synchronize stdout 60 caller.send("echo 1") 61 caller.expect("echo 1") 62 callee.send("echo 1") 63 callee.expect("echo 1") 118 caller.sync_stdout() 119 callee.sync_stdout() 64 120 65 # Test that media is okay (with RFC 2833 DTMF) 66 caller.send("#") 67 caller.send("1122") 68 callee.expect(const.RX_DTMF + "1") 69 callee.expect(const.RX_DTMF + "1") 70 callee.expect(const.RX_DTMF + "2") 71 callee.expect(const.RX_DTMF + "2") 121 # Test that media is okay 122 check_media(caller, callee) 123 check_media(callee, caller) 72 124 73 125 # Synchronize stdout 74 caller.send("echo 1") 75 caller.expect("echo 1") 76 callee.send("echo 1") 77 callee.expect("echo 1") 126 caller.sync_stdout() 127 callee.sync_stdout() 78 128 79 129 # UPDATE (by caller) 80 130 caller.send("U") 131 caller.sync_stdout() 132 callee.expect(const.MEDIA_ACTIVE) 133 caller.expect(const.MEDIA_ACTIVE) 134 135 # Synchronize stdout 136 caller.sync_stdout() 137 callee.sync_stdout() 138 139 # Test that media is okay 140 time.sleep(2) 141 check_media(caller, callee) 142 check_media(callee, caller) 143 144 # UPDATE (by callee) 145 callee.send("U") 146 callee.sync_stdout() 81 147 caller.expect(const.MEDIA_ACTIVE) 82 148 callee.expect(const.MEDIA_ACTIVE) 83 149 84 150 # Synchronize stdout 85 caller.send("echo 1") 86 caller.expect("echo 1") 87 callee.send("echo 1") 88 callee.expect("echo 1") 151 caller.sync_stdout() 152 callee.sync_stdout() 89 153 90 # Test that media is okay (with RFC 2833 DTMF)154 # Test that media is okay 91 155 time.sleep(2) 92 caller.send("#") 93 caller.send("1122") 94 callee.expect(const.RX_DTMF + "1") 95 callee.expect(const.RX_DTMF + "1") 96 callee.expect(const.RX_DTMF + "2") 97 callee.expect(const.RX_DTMF + "2") 98 99 # UPDATE (by callee) 100 callee.send("U") 101 callee.expect(const.MEDIA_ACTIVE) 102 caller.expect(const.MEDIA_ACTIVE) 103 104 # Synchronize stdout 105 caller.send("echo 1") 106 caller.expect("echo 1") 107 callee.send("echo 1") 108 callee.expect("echo 1") 109 110 # Test that media is okay (with RFC 2833 DTMF) 111 time.sleep(2) 112 caller.send("#") 113 caller.send("1122") 114 callee.expect(const.RX_DTMF + "1") 115 callee.expect(const.RX_DTMF + "1") 116 callee.expect(const.RX_DTMF + "2") 117 callee.expect(const.RX_DTMF + "2") 156 check_media(caller, callee) 157 check_media(callee, caller) 118 158 119 159 # Hangup call 120 160 time.sleep(1) 121 161 caller.send("h") 162 caller.sync_stdout() 122 163 123 164 # Wait until calls are cleared in both endpoints -
pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py
r2051 r2059 14 14 "pyc", 15 15 "scripts-call/150_srtp_2_1", # SRTP optional 'cannot' call SRTP mandatory 16 "scripts-call/301_ice_public_b.py", # Doesn't work because OpenSER modifies SDP 16 17 "scripts-media-playrec/100_resample_lf_8_11.py", # related to clock-rate 11 kHz problem 17 18 "scripts-media-playrec/100_resample_lf_8_22.py", # related to clock-rate 22 kHz problem
Note: See TracChangeset
for help on using the changeset viewer.