Changeset 869 for pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua.py
- Timestamp:
- Dec 28, 2006 3:13:48 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua.py
- Property svn:eol-style deleted
r851 r869 118 118 bcfg = py_pjsua.Buddy_Config() 119 119 status, id = py_pjsua.buddy_add(bcfg) 120 acc_id = id 120 121 print "py buddy add status " + `status` + " id " + `id` 121 122 bool = py_pjsua.buddy_is_valid(id) … … 124 125 print "buddy count " + `count` 125 126 binfo = py_pjsua.buddy_get_info(id) 126 ids = py_pjsua.enum_buddies( 3)127 ids = py_pjsua.enum_buddies() 127 128 status = py_pjsua.buddy_del(id) 128 129 print "py buddy del status " + `status` … … 138 139 #end of lib buddy 139 140 141 #lib media 142 count = py_pjsua.conf_get_max_ports() 143 print "py media conf get max ports " + `count` 144 count = py_pjsua.conf_get_active_ports() 145 print "py media conf get active ports " + `count` 146 ids = py_pjsua.enum_conf_ports() 147 for id in ids: 148 print "py media conf ports " + `id` 149 cp_info = py_pjsua.conf_get_port_info(id) 150 print "port info name " + cp_info.name 151 pool = py_pjsua.PJ_Pool() 152 port = py_pjsua.PJMedia_Port() 153 status, id = py_pjsua.conf_add_port(pool,port) 154 print "py media conf add port status " + `status` + " id " + `id` 155 if status != 0 : 156 py_pjsua.perror("py_pjsua","add port",status) 157 status = py_pjsua.conf_remove_port(id) 158 print "py media conf remove port status " + `status` 159 if status != 0 : 160 py_pjsua.perror("py_pjsua","remove port",status) 161 status = py_pjsua.conf_connect(id, id) 162 print "py media conf connect status " + `status` 163 if status != 0 : 164 py_pjsua.perror("py_pjsua","connect",status) 165 status = py_pjsua.conf_disconnect(id, id) 166 print "py media conf disconnect status " + `status` 167 if status != 0 : 168 py_pjsua.perror("py_pjsua","disconnect",status) 169 status, id = py_pjsua.player_create("test.wav", 0) 170 print "py media player create status " + `status` + " id " + `id` 171 if status != 0 : 172 py_pjsua.perror("py_pjsua","player create",status) 173 c_id = py_pjsua.player_get_conf_port(id) 174 print "py media player get conf port id " + `c_id` 175 status = py_pjsua.player_set_pos(id, 10) 176 if status != 0 : 177 py_pjsua.perror("py_pjsua","player set pos",status) 178 status = py_pjsua.player_destroy(id) 179 if status != 0 : 180 py_pjsua.perror("py_pjsua","player destroy",status) 181 status, id = py_pjsua.recorder_create("rec.wav", 0, "None", 1000, 0) 182 print "py media recorder create status " + `status` + " id " + `id` 183 if status != 0 : 184 py_pjsua.perror("py_pjsua","recorder create",status) 185 status = py_pjsua.recorder_get_conf_port(id) 186 print "py media recorder get conf port status " + `status` 187 if status != 0 : 188 py_pjsua.perror("py_pjsua","recorder get conf port",status) 189 status = py_pjsua.recorder_destroy(id) 190 print "py media recorder destroy status " + `status` 191 if status != 0 : 192 py_pjsua.perror("py_pjsua","recorder destroy",status) 193 #cdev, pdev = py_pjsua.get_snd_dev() 194 #print "py media get snd dev capture dev " + `cdev` + " playback dev " + `pdev` 195 status = py_pjsua.set_snd_dev(0,1) 196 print "py media set snd dev status " + `status` 197 if status != 0 : 198 py_pjsua.perror("py_pjsua","set snd dev",status) 199 status = py_pjsua.set_null_snd_dev() 200 print "py media set null snd dev status " + `status` 201 if status != 0 : 202 py_pjsua.perror("py_pjsua","set null snd dev",status) 203 port = py_pjsua.set_no_snd_dev() 204 status = py_pjsua.set_ec(0,0) 205 print "py media set ec status " + `status` 206 if status != 0 : 207 py_pjsua.perror("py_pjsua","set ec",status) 208 tail = py_pjsua.get_ec_tail() 209 print "py media get ec tail " + `tail` 210 infos = py_pjsua.enum_codecs() 211 for info in infos: 212 print "py media enum codecs " + `info` 213 status = py_pjsua.codec_set_priority("coba", 0) 214 print "py media codec set priority " + `status` 215 if status != 0 : 216 py_pjsua.perror("py_pjsua","codec set priority",status) 217 c_param = py_pjsua.codec_get_param("coba") 218 status = py_pjsua.codec_set_param("coba", c_param) 219 print "py media codec set param " + `status` 220 if status != 0 : 221 py_pjsua.perror("py_pjsua","codec set param",status) 222 223 #end of lib media 224 225 #lib call 226 227 count = py_pjsua.call_get_max_count() 228 print "py call get max count " + `count` 229 count = py_pjsua.call_get_count() 230 print "py call get count " + `count` 231 ids = py_pjsua.enum_calls() 232 for id in ids: 233 print "py enum calls id " + `id` 234 msg_data = py_pjsua.Msg_Data() 235 status, id = py_pjsua.call_make_call(-1, "sip:bulukucing1@iptel.org", 0, 0, msg_data) 236 print "py call make call " + `status` + " id " + `id` 237 if status != 0 : 238 py_pjsua.perror("py_pjsua","call make call",status) 239 bool = py_pjsua.call_is_active(id) 240 print "py call is active " + `bool` 241 bool = py_pjsua.call_has_media(id) 242 print "py call has media " + `bool` 243 cp_id = py_pjsua.call_get_conf_port(id) 244 print "py call get conf port " + `cp_id` 245 info = py_pjsua.call_get_info(id) 246 if info != None : 247 print "py info id " + `info.id` 248 status = py_pjsua.call_set_user_data(id, 0) 249 print "py call set user data status " + `status` 250 if status != 0 : 251 py_pjsua.perror("py_pjsua","set user data",status) 252 user_data = py_pjsua.call_get_user_data(id) 253 print "py call get user data " + `user_data` 254 255 256 257 #end of lib call 258 140 259 py_pjsua.perror("saya","hallo",70006) 141 260
Note: See TracChangeset
for help on using the changeset viewer.