Changeset 851 for pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua.py
- Timestamp:
- Dec 9, 2006 12:39:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua.py
r845 r851 8 8 # Create configuration objects 9 9 # 10 ua_cfg = py_pjsua. Config()11 log_cfg = py_pjsua. Logging_Config()12 media_cfg = py_pjsua. Media_Config()10 ua_cfg = py_pjsua.config_default() 11 log_cfg = py_pjsua.logging_config_default() 12 media_cfg = py_pjsua.media_config_default() 13 13 14 14 # … … 18 18 print str, 19 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 20 28 21 # … … 47 40 48 41 49 message = py_pjsua. Msg_Data()50 py_pjsua.msg_data_init(message) 42 message = py_pjsua.msg_data_init() 43 51 44 print "identitas object message data :" + `message` 52 45 … … 76 69 77 70 # lib transport 78 stunc = py_pjsua.STUN_Config(); 79 py_pjsua.stun_config_default(stunc); 71 stunc = py_pjsua.stun_config_default(); 80 72 81 tc = py_pjsua.Transport_Config(); 82 py_pjsua.transport_config_default(tc); 73 74 tc = py_pjsua.transport_config_default(); 75 83 76 84 77 py_pjsua.normalize_stun_config(stunc); 85 78 86 id = py_pjsua.Transport_ID(); 87 status = py_pjsua.transport_create(1, tc, id);79 80 status, id = py_pjsua.transport_create(1, tc); 88 81 print "py transport create status " + `status` 89 82 90 t_id = id.transport_id;91 83 ti = py_pjsua.Transport_Info(); 92 status = py_pjsua.transport_get_info(t_id,ti)84 ti = py_pjsua.transport_get_info(id) 93 85 print "py transport get info status " + `status` 94 86 95 status = py_pjsua.transport_set_enable( t_id,1)87 status = py_pjsua.transport_set_enable(id,1) 96 88 print "py transport set enable status " + `status` 97 89 if status != 0 : … … 99 91 100 92 101 status = py_pjsua.transport_close( t_id,1)93 status = py_pjsua.transport_close(id,1) 102 94 print "py transport close status " + `status` 103 95 if status != 0 : … … 108 100 # lib account 109 101 110 accfg = py_pjsua.Acc_Config() 111 py_pjsua.acc_config_default(accfg) 112 accid = py_pjsua.Acc_ID() 113 status = py_pjsua.acc_add(accfg, 1, accid) 102 accfg = py_pjsua.acc_config_default() 103 status, accid = py_pjsua.acc_add(accfg, 1) 114 104 print "py acc add status " + `status` 115 105 if status != 0 : … … 118 108 print "acc count " + `count` 119 109 120 accid .acc_id= py_pjsua.acc_get_default()110 accid = py_pjsua.acc_get_default() 121 111 122 print "acc id default " + `accid .acc_id`112 print "acc id default " + `accid` 123 113 124 114 # end of lib account 115 116 #lib buddy 117 118 bcfg = py_pjsua.Buddy_Config() 119 status, id = py_pjsua.buddy_add(bcfg) 120 print "py buddy add status " + `status` + " id " + `id` 121 bool = py_pjsua.buddy_is_valid(id) 122 print "py buddy is valid " + `bool` 123 count = py_pjsua.get_buddy_count() 124 print "buddy count " + `count` 125 binfo = py_pjsua.buddy_get_info(id) 126 ids = py_pjsua.enum_buddies(3) 127 status = py_pjsua.buddy_del(id) 128 print "py buddy del status " + `status` 129 status = py_pjsua.buddy_subscribe_pres(id, 1) 130 print "py buddy subscribe pres status " + `status` 131 py_pjsua.pres_dump(1) 132 status = py_pjsua.im_send(accid, "fahris@divusi.com", "", "hallo", message, 0) 133 print "py im send status " + `status` 134 status = py_pjsua.im_typing(accid, "fahris@divusi.com", 1, message) 135 print "py im typing status " + `status` 136 #print "binfo " + `binfo` 137 138 #end of lib buddy 125 139 126 140 py_pjsua.perror("saya","hallo",70006)
Note: See TracChangeset
for help on using the changeset viewer.