Changeset 824 for pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua.py
- Timestamp:
- Nov 23, 2006 9:50:02 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua.py
r803 r824 1 # import module py_pjsua2 1 import py_pjsua 3 2 4 print '''Testing py_pjsua.create : '''5 3 status = py_pjsua.create() 6 4 print "py status " + `status` 7 5 8 # perror9 print '''Testing error code 70006 : '''10 py_pjsua.perror("py_pjsua","hello",70006)11 6 12 # test py_pjsua.destroy 13 print '''Testing py_pjsua.destroy : ''' 7 # 8 # Create configuration objects 9 # 10 ua_cfg = py_pjsua.Config() 11 log_cfg = py_pjsua.Logging_Config() 12 media_cfg = py_pjsua.Media_Config() 13 14 # 15 # Logging callback. 16 # 17 def logging_cb1(level, str, len): 18 print str, 19 20 21 # 22 # Initialize configs with default values. 23 # 24 py_pjsua.config_default(ua_cfg) 25 py_pjsua.logging_config_default(log_cfg) 26 py_pjsua.media_config_default(media_cfg) 27 28 # 29 # Configure logging 30 # 31 log_cfg.cb = logging_cb1 32 log_cfg.console_level = 4 33 34 # 35 # Initialize pjsua! 36 # 37 status = py_pjsua.init(ua_cfg, log_cfg, media_cfg); 38 print "py status after initialization :" + `status` 39 40 41 # 42 # Start pjsua! 43 # 44 status = py_pjsua.start() 45 if status != 0: 46 exit(1) 47 48 49 message = py_pjsua.Msg_Data() 50 py_pjsua.msg_data_init(message) 51 print "identitas object message data :" + `message` 52 53 sipaddr = 'sip:167.205.34.99' 54 print "checking sip address [%s] : %d" % (sipaddr, py_pjsua.verify_sip_url(sipaddr)) 55 56 sipaddr = '167.205.34.99' 57 print "checking invalid sip address [%s] : %d" % (sipaddr, py_pjsua.verify_sip_url(sipaddr)) 58 59 object = py_pjsua.get_pjsip_endpt() 60 print "identitas Endpoint :" + `object` + "" 61 62 mediaend = py_pjsua.get_pjmedia_endpt() 63 print "identitas Media Endpoint :" + `mediaend` + "" 64 65 pool = py_pjsua.get_pool_factory() 66 print "identitas pool factory :" + `pool` + "" 67 68 status = py_pjsua.handle_events(3000) 69 print "py status after 3 second of blocking wait :" + `status` 70 71 72 73 # end of new testrun 74 75 # 76 77 py_pjsua.perror("saya","hallo",70006) 78 14 79 status = py_pjsua.destroy() 15 80 print "py status " + `status` 16 81 17 print '''End Of py_pjsua''' 82
Note: See TracChangeset
for help on using the changeset viewer.