def print_menu(): print "" print ">>>" print_acc_buddy_list() print """ +============================================================================+ | Call Commands : | Buddy, IM & Presence: | Account: | | | | | | m Make call | +b Add buddy | +a Add account | | a Answer current call | -b Delete buddy | -a Delete accnt | | h Hangup current call | | | | H Hold call | i Send instant message | rr register | | v re-inVite (release Hold) | s Subscribe presence | ru Unregister | | # Send DTMF string | u Unsubscribe presence | | | dq Dump curr. call quality | t ToGgle Online status | | | +--------------------------+------------------+ | x Xfer call | Media Commands: | Status: | | X Xfer with Replaces | | | | | cl List ports | d Dump status | | | cc Connect port | dd Dump detail | | | cd Disconnect port | | | | +p Add file player | | |------------------------------+ +r Add file recorder | | | q Quit application | | | +============================================================================+""" print "You have " + `py_pjsua.call_get_count()` + " active call(s)" print ">>>",
print "py media codec set priority " + ` status ` if status != 0: py_pjsua.perror("py_pjsua", "codec set priority", status) c_param = py_pjsua.codec_get_param("coba") status = py_pjsua.codec_set_param("coba", c_param) print "py media codec set param " + ` status ` if status != 0: py_pjsua.perror("py_pjsua", "codec set param", status) #end of lib media #lib call count = py_pjsua.call_get_max_count() print "py call get max count " + ` count ` count = py_pjsua.call_get_count() print "py call get count " + ` count ` ids = py_pjsua.enum_calls() for id in ids: print "py enum calls id " + ` id ` msg_data = py_pjsua.Msg_Data() status, id = py_pjsua.call_make_call(-1, "sip:[email protected]", 0, 0, msg_data) print "py call make call " + ` status ` + " id " + ` id ` if status != 0: py_pjsua.perror("py_pjsua", "call make call", status) bool = py_pjsua.call_is_active(id) print "py call is active " + ` bool ` bool = py_pjsua.call_has_media(id) print "py call has media " + ` bool ` cp_id = py_pjsua.call_get_conf_port(id)
print "py media codec set priority " + `status` if status != 0 : py_pjsua.perror("py_pjsua","codec set priority",status) c_param = py_pjsua.codec_get_param("coba") status = py_pjsua.codec_set_param("coba", c_param) print "py media codec set param " + `status` if status != 0 : py_pjsua.perror("py_pjsua","codec set param",status) #end of lib media #lib call count = py_pjsua.call_get_max_count() print "py call get max count " + `count` count = py_pjsua.call_get_count() print "py call get count " + `count` ids = py_pjsua.enum_calls() for id in ids: print "py enum calls id " + `id` msg_data = py_pjsua.Msg_Data() status, id = py_pjsua.call_make_call(-1, "sip:[email protected]", 0, 0, msg_data) print "py call make call " + `status` + " id " + `id` if status != 0 : py_pjsua.perror("py_pjsua","call make call",status) bool = py_pjsua.call_is_active(id) print "py call is active " + `bool` bool = py_pjsua.call_has_media(id) print "py call has media " + `bool` cp_id = py_pjsua.call_get_conf_port(id) print "py call get conf port " + `cp_id`