Пример #1
0
def disconnect_port():
	src_port = 0
	dst_port = 0
	
	print "Disconnect src port # (empty to cancel): "
	src_port = sys.stdin.readline()
	if src_port == "\n": 
		return
	src_port = src_port.replace("\n", "")
	src_port = int(src_port)
	print "From dst port # (empty to cancel): "
	dst_port = sys.stdin.readline()
	if dst_port == "\n": 
		return
	dst_port = dst_port.replace("\n", "")
	dst_port = int(dst_port)
	status = py_pjsua.conf_disconnect(src_port, dst_port)
	if status != 0:
		py_pjsua.perror(THIS_FILE, "Error disconnecting port ", status)
	else:		
		write_log(3, "Port disconnected " + `src_port` + " from " + `dst_port`)
Пример #2
0
    print "port info name " + cp_info.name
pool = py_pjsua.PJ_Pool()
port = py_pjsua.PJMedia_Port()
status, id = py_pjsua.conf_add_port(pool, port)
print "py media conf add port status " + ` status ` + " id " + ` id `
if status != 0:
    py_pjsua.perror("py_pjsua", "add port", status)
status = py_pjsua.conf_remove_port(id)
print "py media conf remove port status " + ` status `
if status != 0:
    py_pjsua.perror("py_pjsua", "remove port", status)
status = py_pjsua.conf_connect(id, id)
print "py media conf connect status " + ` status `
if status != 0:
    py_pjsua.perror("py_pjsua", "connect", status)
status = py_pjsua.conf_disconnect(id, id)
print "py media conf disconnect status " + ` status `
if status != 0:
    py_pjsua.perror("py_pjsua", "disconnect", status)
status, id = py_pjsua.player_create("test.wav", 0)
print "py media player create status " + ` status ` + " id " + ` id `
if status != 0:
    py_pjsua.perror("py_pjsua", "player create", status)
c_id = py_pjsua.player_get_conf_port(id)
print "py media player get conf port id " + ` c_id `
status = py_pjsua.player_set_pos(id, 10)
if status != 0:
    py_pjsua.perror("py_pjsua", "player set pos", status)
status = py_pjsua.player_destroy(id)
if status != 0:
    py_pjsua.perror("py_pjsua", "player destroy", status)
Пример #3
0
	print "port info name " + cp_info.name
pool = py_pjsua.PJ_Pool()
port = py_pjsua.PJMedia_Port()
status, id = py_pjsua.conf_add_port(pool,port)
print "py media conf add port status " + `status` + " id " + `id`
if status != 0 :
	py_pjsua.perror("py_pjsua","add port",status)
status = py_pjsua.conf_remove_port(id)
print "py media conf remove port status " + `status`
if status != 0 :
	py_pjsua.perror("py_pjsua","remove port",status)
status = py_pjsua.conf_connect(id, id)
print "py media conf connect status " + `status`
if status != 0 :
	py_pjsua.perror("py_pjsua","connect",status)
status = py_pjsua.conf_disconnect(id, id)
print "py media conf disconnect status " + `status`
if status != 0 :
	py_pjsua.perror("py_pjsua","disconnect",status)
status, id = py_pjsua.player_create("test.wav", 0)
print "py media player create status " + `status` + " id " + `id`
if status != 0 :
	py_pjsua.perror("py_pjsua","player create",status)
c_id = py_pjsua.player_get_conf_port(id)
print "py media player get conf port id " + `c_id`
status = py_pjsua.player_set_pos(id, 10)
if status != 0 :
	py_pjsua.perror("py_pjsua","player set pos",status)
status = py_pjsua.player_destroy(id)
if status != 0 :
	py_pjsua.perror("py_pjsua","player destroy",status)