Example #1
0
def xfer_call():
	global g_current_call
	
	if g_current_call == -1:
		
		write_log(3, "No current call")

	else:
		call = g_current_call		
		ci = py_pjsua.call_get_info(g_current_call)
		print "Transfering current call ["+ `g_current_call` + "] " + ci.remote_info
		print "Enter sip url : "
		url = sys.stdin.readline()
		if url == "\n": 
			return
		url = url.replace("\n", "")
		if call != g_current_call:
			print "Call has been disconnected"
			return
		msg_data = py_pjsua.msg_data_init()
		status = py_pjsua.call_xfer(g_current_call, url, msg_data);
		if status != 0:
			py_pjsua.perror(THIS_FILE, "Error transfering call ", status)
		else:		
			write_log(3, "Call transfered to " + url)
Example #2
0
log_cfg.console_level = 4

#
# Initialize pjsua!
#
status = py_pjsua.init(ua_cfg, log_cfg, media_cfg)
print "py status after initialization :" + ` status `

#
# Start pjsua!
#
status = py_pjsua.start()
if status != 0:
    exit(1)

message = py_pjsua.msg_data_init()

print "identitas object message data :" + ` message `

sipaddr = 'sip:167.205.34.99'
print "checking sip address [%s] : %d" % (sipaddr,
                                          py_pjsua.verify_sip_url(sipaddr))

sipaddr = '167.205.34.99'
print "checking invalid sip address [%s] : %d" % (
    sipaddr, py_pjsua.verify_sip_url(sipaddr))

object = py_pjsua.get_pjsip_endpt()
print "identitas Endpoint :" + ` object ` + ""

mediaend = py_pjsua.get_pjmedia_endpt()
Example #3
0
#
# Initialize pjsua!
#
status = py_pjsua.init(ua_cfg, log_cfg, media_cfg);
print "py status after initialization :" + `status`


#
# Start pjsua!
#
status = py_pjsua.start()
if status != 0:
    exit(1)


message = py_pjsua.msg_data_init()

print "identitas object message data :" + `message`

sipaddr = 'sip:167.205.34.99'
print "checking sip address [%s] : %d" % (sipaddr, py_pjsua.verify_sip_url(sipaddr))

sipaddr = '167.205.34.99'
print "checking invalid sip address [%s] : %d" % (sipaddr, py_pjsua.verify_sip_url(sipaddr))

object = py_pjsua.get_pjsip_endpt()
print "identitas Endpoint :" + `object` + ""

mediaend = py_pjsua.get_pjmedia_endpt()
print "identitas Media Endpoint :" + `mediaend` + ""