Changeset 5065
- Timestamp:
- Apr 13, 2015 12:14:02 PM (10 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_config.c
r4868 r5065 212 212 puts (""); 213 213 214 fflush(stdout); 215 } 216 217 static void log_writer_nobuf(int level, const char *buffer, int len) 218 { 219 pj_log_write(level, buffer, len); 214 220 fflush(stdout); 215 221 } … … 1252 1258 case OPT_STDOUT_NO_BUF: 1253 1259 setvbuf(stdout, NULL, _IONBF, 0); 1260 cfg->log_cfg.cb = &log_writer_nobuf; 1254 1261 break; 1255 1262 #endif -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
r4851 r5065 24 24 #define THIS_FILE "pjsua_app_legacy.c" 25 25 26 27 /* An attempt to avoid stdout buffering for python tests: 28 * - call 'fflush(stdout)' after each call to 'printf()/puts()' 29 * - apply 'setbuf(stdout, 0)', but it is not guaranteed by the standard: 30 * http://stackoverflow.com/questions/1716296 31 */ 32 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ 33 (defined (_MSC_VER) && _MSC_VER >= 1400) 34 /* Variadic macro is introduced in C99; MSVC supports it in since 2005. */ 35 # define printf(...) {printf(__VA_ARGS__);fflush(stdout);} 36 # define puts(s) {puts(s);fflush(stdout);} 37 #endif 38 39 26 40 static pj_bool_t cmd_echo; 27 41 … … 39 53 pjsua_enum_buddies(ids, &count); 40 54 41 if (count == 0) 55 if (count == 0) { 42 56 puts(" -none-"); 43 else {57 } else { 44 58 for (i=0; i<(int)count; ++i) { 45 59 pjsua_buddy_info info; … … 1089 1103 } 1090 1104 if (result.nb_result != PJSUA_APP_NO_NB) { 1091 if (result.nb_result == -1 || result.nb_result == 0) 1105 if (result.nb_result == -1 || result.nb_result == 0) { 1092 1106 puts("You can't do that with transfer call!"); 1093 else {1107 } else { 1094 1108 pjsua_buddy_info binfo; 1095 1109 pjsua_buddy_get_info(result.nb_result-1, &binfo); … … 1670 1684 } 1671 1685 1686 1672 1687 /* 1673 1688 * Main "user interface" loop. -
pjproject/trunk/tests/pjsua/mod_call.py
r2078 r5065 54 54 55 55 # Wait until call is connected in both endpoints 56 time.sleep(0.2)56 ##time.sleep(0.2) 57 57 caller.expect(const.STATE_CONFIRMED) 58 58 callee.expect(const.STATE_CONFIRMED) … … 61 61 caller.sync_stdout() 62 62 callee.sync_stdout() 63 time.sleep(0.1)64 caller.sync_stdout() 65 callee.sync_stdout() 66 67 # Test that media is okay 68 time.sleep(0.3)63 ##time.sleep(0.1) 64 caller.sync_stdout() 65 callee.sync_stdout() 66 67 # Test that media is okay 68 ##time.sleep(0.3) 69 69 check_media(caller, callee) 70 70 check_media(callee, caller) … … 74 74 caller.expect("INVITE sip:") 75 75 callee.expect("INVITE sip:") 76 callee.expect(const.MEDIA_HOLD) 77 caller.expect(const.MEDIA_HOLD) 78 79 # Synchronize stdout 80 caller.sync_stdout() 81 callee.sync_stdout() 82 83 # Release hold 84 ##time.sleep(0.5) 85 caller.send("v") 86 caller.expect("INVITE sip:") 87 callee.expect("INVITE sip:") 88 callee.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold") 89 caller.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold") 90 91 # Synchronize stdout 92 caller.sync_stdout() 93 callee.sync_stdout() 94 95 # Test that media is okay 96 check_media(caller, callee) 97 check_media(callee, caller) 98 99 # Synchronize stdout 100 caller.sync_stdout() 101 callee.sync_stdout() 102 103 # Hold call by callee 104 callee.send("H") 105 callee.expect("INVITE sip:") 106 caller.expect("INVITE sip:") 76 107 caller.expect(const.MEDIA_HOLD) 77 108 callee.expect(const.MEDIA_HOLD) … … 82 113 83 114 # Release hold 84 time.sleep(0.5)85 calle r.send("v")86 calle r.expect("INVITE sip:")87 calle e.expect("INVITE sip:")115 ##time.sleep(0.1) 116 callee.send("v") 117 callee.expect("INVITE sip:") 118 caller.expect("INVITE sip:") 88 119 caller.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold") 89 120 callee.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold") … … 94 125 95 126 # Test that media is okay 96 check_media(caller, callee)97 check_media(callee, caller)98 99 # Synchronize stdout100 caller.sync_stdout()101 callee.sync_stdout()102 103 # Hold call by callee104 callee.send("H")105 callee.expect("INVITE sip:")106 caller.expect("INVITE sip:")107 caller.expect(const.MEDIA_HOLD)108 callee.expect(const.MEDIA_HOLD)109 110 # Synchronize stdout111 caller.sync_stdout()112 callee.sync_stdout()113 114 # Release hold115 time.sleep(0.1)116 callee.send("v")117 callee.expect("INVITE sip:")118 caller.expect("INVITE sip:")119 callee.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold")120 caller.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold")121 122 # Synchronize stdout123 caller.sync_stdout()124 callee.sync_stdout()125 126 # Test that media is okay127 127 # Wait for some time for ICE negotiation 128 time.sleep(0.6)128 ##time.sleep(0.6) 129 129 check_media(caller, callee) 130 130 check_media(callee, caller) … … 145 145 146 146 # Test that media is okay 147 time.sleep(0.1)147 ##time.sleep(0.1) 148 148 check_media(caller, callee) 149 149 check_media(callee, caller) … … 161 161 162 162 # Test that media is okay 163 time.sleep(0.1)163 ##time.sleep(0.1) 164 164 check_media(caller, callee) 165 165 check_media(callee, caller) … … 194 194 195 195 # Test that media is still okay 196 time.sleep(0.1)196 ##time.sleep(0.1) 197 197 check_media(caller, callee) 198 198 check_media(callee, caller) … … 208 208 209 209 # Test that media is still okay 210 time.sleep(0.1)210 ##time.sleep(0.1) 211 211 check_media(callee, caller) 212 212 check_media(caller, callee) 213 213 214 214 # Hangup call 215 time.sleep(0.1)215 ##time.sleep(0.1) 216 216 caller.send("h") 217 217 -
pjproject/trunk/tests/pjsua/scripts-call/300_ice_1_1.py
r2084 r5065 7 7 "Callee=use ICE, caller=use ICE", 8 8 [ 9 InstanceParam("callee", "--null-audio --use-ice --max-calls=1" , enable_buffer=True),10 InstanceParam("caller", "--null-audio --use-ice --max-calls=1" , enable_buffer=True)9 InstanceParam("callee", "--null-audio --use-ice --max-calls=1"), 10 InstanceParam("caller", "--null-audio --use-ice --max-calls=1") 11 11 ] 12 12 ) -
pjproject/trunk/tests/pjsua/scripts-call/305_ice_comp_1_2.py
r2196 r5065 7 7 "Callee=use ICE, caller=use ICE", 8 8 [ 9 InstanceParam("callee", "--null-audio --use-ice --max-calls=1 --ice-no-rtcp" , enable_buffer=True),10 InstanceParam("caller", "--null-audio --use-ice --max-calls=1" , enable_buffer=True)9 InstanceParam("callee", "--null-audio --use-ice --max-calls=1 --ice-no-rtcp"), 10 InstanceParam("caller", "--null-audio --use-ice --max-calls=1") 11 11 ] 12 12 ) -
pjproject/trunk/tests/pjsua/scripts-call/305_ice_comp_2_1.py
r2196 r5065 7 7 "Callee=use ICE, caller=use ICE", 8 8 [ 9 InstanceParam("callee", "--null-audio --use-ice --max-calls=1" , enable_buffer=True),10 InstanceParam("caller", "--null-audio --use-ice --max-calls=1 --ice-no-rtcp" , enable_buffer=True)9 InstanceParam("callee", "--null-audio --use-ice --max-calls=1"), 10 InstanceParam("caller", "--null-audio --use-ice --max-calls=1 --ice-no-rtcp") 11 11 ] 12 12 ) -
pjproject/trunk/tests/pjsua/scripts-sendto/200_ice_success_2.py
r2084 r5065 32 32 sendto_cfg = sip.SendtoCfg( "caller sends only one component", 33 33 pjsua_args=args, sdp=sdp, resp_code=200, 34 resp_inc=include, resp_exc=exclude, 35 enable_buffer = True) 34 resp_inc=include, resp_exc=exclude) 36 35 -
pjproject/trunk/tests/pjsua/scripts-sendto/200_ice_success_3.py
r2376 r5065 31 31 sendto_cfg = sip.SendtoCfg( "caller sends two components without a=rtcp line", 32 32 pjsua_args=args, sdp=sdp, resp_code=200, 33 resp_inc=include, resp_exc=exclude, 34 enable_buffer = True) 33 resp_inc=include, resp_exc=exclude) 35 34 -
pjproject/trunk/tests/pjsua/scripts-sendto/200_ice_success_4.py
r2376 r5065 31 31 sendto_cfg = sip.SendtoCfg( "pjsua with --ice-no-rtcp ignores RTCP things in the SDP", 32 32 pjsua_args=args, sdp=sdp, resp_code=200, 33 resp_inc=include, resp_exc=exclude, 34 enable_buffer = True) 33 resp_inc=include, resp_exc=exclude) 35 34
Note: See TracChangeset
for help on using the changeset viewer.