def print_acc_buddy_list(): global g_acc_id acc_ids = py_pjsua.enum_accs() print "Account list:" for acc_id in acc_ids: acc_info = py_pjsua.acc_get_info(acc_id) if acc_info.has_registration == 0: acc_status = acc_info.status_text else: acc_status = `acc_info.status` + "/" + acc_info.status_text + " (expires=" + `acc_info.expires` + ")" if acc_id == g_acc_id: print " *", else: print " ", print "[" + `acc_id` + "] " + acc_info.acc_uri + ": " + acc_status print " Presence status: ", if acc_info.online_status != 0: print "Online" else: print "Invisible" if py_pjsua.get_buddy_count() > 0: print "" print "Buddy list:" buddy_ids = py_pjsua.enum_buddies() for buddy_id in buddy_ids: bi = py_pjsua.buddy_get_info(buddy_id) print " [" + `buddy_id` + "] " + bi.status_text + " " + bi.uri
accid = py_pjsua.acc_get_default() print "acc id default " + ` accid ` # end of lib account #lib buddy bcfg = py_pjsua.Buddy_Config() status, id = py_pjsua.buddy_add(bcfg) acc_id = id print "py buddy add status " + ` status ` + " id " + ` id ` bool = py_pjsua.buddy_is_valid(id) print "py buddy is valid " + ` bool ` count = py_pjsua.get_buddy_count() print "buddy count " + ` count ` binfo = py_pjsua.buddy_get_info(id) ids = py_pjsua.enum_buddies() status = py_pjsua.buddy_del(id) print "py buddy del status " + ` status ` status = py_pjsua.buddy_subscribe_pres(id, 1) print "py buddy subscribe pres status " + ` status ` py_pjsua.pres_dump(1) status = py_pjsua.im_send(accid, "*****@*****.**", "", "hallo", message, 0) print "py im send status " + ` status ` status = py_pjsua.im_typing(accid, "*****@*****.**", 1, message) print "py im typing status " + ` status ` #print "binfo " + `binfo` #end of lib buddy
accid = py_pjsua.acc_get_default() print "acc id default " + `accid` # end of lib account #lib buddy bcfg = py_pjsua.Buddy_Config() status, id = py_pjsua.buddy_add(bcfg) acc_id = id print "py buddy add status " + `status` + " id " + `id` bool = py_pjsua.buddy_is_valid(id) print "py buddy is valid " + `bool` count = py_pjsua.get_buddy_count() print "buddy count " + `count` binfo = py_pjsua.buddy_get_info(id) ids = py_pjsua.enum_buddies() status = py_pjsua.buddy_del(id) print "py buddy del status " + `status` status = py_pjsua.buddy_subscribe_pres(id, 1) print "py buddy subscribe pres status " + `status` py_pjsua.pres_dump(1) status = py_pjsua.im_send(accid, "*****@*****.**", "", "hallo", message, 0) print "py im send status " + `status` status = py_pjsua.im_typing(accid, "*****@*****.**", 1, message) print "py im typing status " + `status` #print "binfo " + `binfo` #end of lib buddy