Changeset 4845 for pjproject/trunk/pjsip-apps/src/swig/python/test.py
- Timestamp:
- May 19, 2014 5:51:10 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/swig/python/test.py
r4704 r4845 1 1 import pjsua2 as pj 2 2 import sys 3 import time 3 4 4 5 # … … 101 102 102 103 # 104 # Tone generator 105 # 106 def ua_tonegen_test(): 107 print "UA tonegen test.." 108 ep_cfg = pj.EpConfig() 109 110 ep = pj.Endpoint() 111 ep.libCreate() 112 ep.libInit(ep_cfg) 113 ep.libStart() 114 115 tonegen = pj.ToneGenerator() 116 tonegen.createToneGenerator() 117 118 tone = pj.ToneDesc() 119 tone.freq1 = 400 120 tone.freq2 = 600 121 tone.on_msec = 1000 122 tone.off_msec = 1000 123 tones = pj.ToneDescVector() 124 tones.append(tone) 125 126 digit = pj.ToneDigit() 127 digit.digit = '0' 128 digit.on_msec = 1000 129 digit.off_msec = 1000 130 digits = pj.ToneDigitVector() 131 digits.append(digit) 132 133 adm = ep.audDevManager() 134 spk = adm.getPlaybackDevMedia() 135 136 tonegen.play(tones, True) 137 tonegen.startTransmit(spk) 138 time.sleep(5) 139 140 tonegen.stop() 141 tonegen.playDigits(digits, True) 142 time.sleep(5) 143 144 dm = tonegen.getDigitMap() 145 print dm[0].digit 146 dm[0].freq1 = 400 147 dm[0].freq2 = 600 148 tonegen.setDigitMap(dm) 149 150 tonegen.stop() 151 tonegen.playDigits(digits, True) 152 time.sleep(5) 153 154 tonegen = None 155 156 ep.libDestroy() 157 158 # 103 159 # main() 104 160 # … … 108 164 ua_run_log_test() 109 165 ua_run_ua_test() 166 ua_tonegen_test() 110 167 sys.exit(0) 111 168
Note: See TracChangeset
for help on using the changeset viewer.