亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pjsua_app.py

?? 基于sip協議的網絡電話源碼
?? PY
?? 第 1 頁 / 共 2 頁
字號:
def dump_call_quality():	global g_current_call		buf = ""	if g_current_call != -1:		buf = py_pjsua.call_dump(g_current_call, 1, 1024, "  ")		write_log(3, "\n" + buf)	else:		write_log(3, "No current call")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)		def xfer_call_replaces():	if g_current_call == -1:		write_log(3, "No current call")	else:		call = g_current_call				ids = py_pjsua.enum_calls()		if len(ids) <= 1:			print "There are no other calls"			return				ci = py_pjsua.call_get_info(g_current_call)		print "Transfer call [" + `g_current_call` + "] " + ci.remote_info + " to one of the following:"		for i in range(0, len(ids)):		    			if ids[i] == call:				continue			call_info = py_pjsua.call_get_info(ids[i])			print `ids[i]` + "  " +  call_info.remote_info + "  [" + call_info.state_text + "]"				print "Enter call number to be replaced : "		buf = sys.stdin.readline()		buf = buf.replace("\n","")		if buf == "":			return		dst_call = int(buf)				if call != g_current_call:			print "Call has been disconnected"			return						if dst_call == call:			print "Destination call number must not be the same as the call being transfered"			return				if dst_call >= py_pjsua.PJSUA_MAX_CALLS:			print "Invalid destination call number"			return			if py_pjsua.call_is_active(dst_call) == 0:			print "Invalid destination call number"			return				py_pjsua.call_xfer_replaces(call, dst_call, 0, None)		## Worker thread function.# Python doesn't like it when it's called from an alien thread# (pjsua's worker thread, in this case), so for Python we must# disable worker thread in pjsua and poll pjsua from Python instead.#def worker_thread_main(arg):	global C_QUIT	thread_desc = 0;	status = py_pjsua.thread_register("python worker", thread_desc)	if status != 0:		py_pjsua.perror(THIS_FILE, "Error registering thread", status)	else:		while C_QUIT == 0:			py_pjsua.handle_events(50)		print "Worker thread quitting.."		C_QUIT = 2# Start pjsua#def app_start():	# Done with initialization, start pjsua!!	#	status = py_pjsua.start()	if status != 0:		py_pjsua.destroy()		err_exit("Error starting pjsua!", status)	# Start worker thread	thr = thread.start_new(worker_thread_main, (0,))    	print "PJSUA Started!!"# Print account and buddy listdef 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			# Print application menu#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 ">>>", # Menu#def app_menu():	global g_acc_id	global g_current_call	quit = 0	while quit == 0:		print_menu()		choice = sys.stdin.readline()		if choice[0] == "q":			quit = 1		elif choice[0] == "i":			# Sending IM				print "Send IM to SIP URL: ",			url = sys.stdin.readline()			if url == "\n":				continue			# Send typing indication			py_pjsua.im_typing(g_acc_id, url, 1, None) 			print "The content: ",			message = sys.stdin.readline()			if message == "\n":				py_pjsua.im_typing(g_acc_id, url, 0, None) 						continue			# Send the IM!			py_pjsua.im_send(g_acc_id, url, None, message, None, 0)		elif choice[0] == "m":			# Make call 			print "Using account ", g_acc_id			print "Make call to SIP URL: ",			url = sys.stdin.readline()			url = url.replace("\n", "")			if url == "":				continue			# Initiate the call!			status, call_id = py_pjsua.call_make_call(g_acc_id, url, 0, 0, None)            			if status != 0:				py_pjsua.perror(THIS_FILE, "Error making call", status)			else:				g_current_call = call_id		elif choice[0] == "+" and choice[1] == "b":			# Add new buddy			bc = py_pjsua.Buddy_Config()			print "Buddy URL: ",			bc.uri = sys.stdin.readline()			if bc.uri == "\n":				continue            			bc.uri = bc.uri.replace("\n", "")			bc.subscribe = 1			status, buddy_id = py_pjsua.buddy_add(bc)			if status != 0:				py_pjsua.perror(THIS_FILE, "Error adding buddy", status)		elif choice[0] == "-" and choice[1] == "b":			print "Enter buddy ID to delete : "			buf = sys.stdin.readline()			buf = buf.replace("\n","")			if buf == "":				continue			i = int(buf)			if py_pjsua.buddy_is_valid(i) == 0:				print "Invalid buddy id " + `i`			else:				py_pjsua.buddy_del(i)				print "Buddy " + `i` + " deleted"				elif choice[0] == "+" and choice[1] == "a":			# Add account			add_account()		elif choice[0] == "-" and choice[1] == "a":			print "Enter account ID to delete : "			buf = sys.stdin.readline()			buf = buf.replace("\n","")			if buf == "":				continue			i = int(buf)			if py_pjsua.acc_is_valid(i) == 0:				print "Invalid account id " + `i`			else:				py_pjsua.acc_del(i)				print "Account " + `i` + " deleted"	    		elif choice[0] == "+" and choice[1] == "p":			add_player()		elif choice[0] == "+" and choice[1] == "r":			add_recorder()		elif choice[0] == "c" and choice[1] == "l":			conf_list()		elif choice[0] == "c" and choice[1] == "c":			connect_port()		elif choice[0] == "c" and choice[1] == "d":			disconnect_port()		elif choice[0] == "d" and choice[1] == "q":			dump_call_quality()		elif choice[0] == "x":			xfer_call()		elif choice[0] == "X":			xfer_call_replaces()		elif choice[0] == "h":			if g_current_call != py_pjsua.PJSUA_INVALID_ID:				py_pjsua.call_hangup(g_current_call, 603, None, None)			else:				print "No current call"		elif choice[0] == "H":			if g_current_call != py_pjsua.PJSUA_INVALID_ID:				py_pjsua.call_set_hold(g_current_call, None)					else:				print "No current call"		elif choice[0] == "v":			if g_current_call != py_pjsua.PJSUA_INVALID_ID:						py_pjsua.call_reinvite(g_current_call, 1, None);			else:				print "No current call"		elif choice[0] == "#":			if g_current_call == py_pjsua.PJSUA_INVALID_ID:						print "No current call"			elif py_pjsua.call_has_media(g_current_call) == 0:				print "Media is not established yet!"			else:				call = g_current_call				print "DTMF strings to send (0-9*#A-B)"				buf = sys.stdin.readline()				buf = buf.replace("\n", "")				if buf == "":					continue				if call != g_current_call:					print "Call has been disconnected"					continue				status = py_pjsua.call_dial_dtmf(g_current_call, buf)				if status != 0:					py_pjsua.perror(THIS_FILE, "Unable to send DTMF", status);				else:					print "DTMF digits enqueued for transmission"		elif choice[0] == "s":			print "Subscribe presence of (buddy id) : "			buf = sys.stdin.readline()			buf = buf.replace("\n","")			if buf == "":				continue			i = int(buf)			py_pjsua.buddy_subscribe_pres(i, 1)		elif choice[0] == "u":			print "Unsubscribe presence of (buddy id) : "			buf = sys.stdin.readline()			buf = buf.replace("\n","")			if buf == "":				continue			i = int(buf)			py_pjsua.buddy_subscribe_pres(i, 0)		elif choice[0] == "t":			acc_info = py_pjsua.acc_get_info(g_acc_id)			if acc_info.online_status == 0:				acc_info.online_status = 1			else:				acc_info.online_status = 0			py_pjsua.acc_set_online_status(g_acc_id, acc_info.online_status)			st = ""			if acc_info.online_status == 0:				st = "offline"			else:				st = "online"			print "Setting " + acc_info.acc_uri + " online status to " + st		elif choice[0] == "r":			if choice[1] == "r":	    				py_pjsua.acc_set_registration(g_acc_id, 1)			elif choice[1] == "u":				py_pjsua.acc_set_registration(g_acc_id, 0)		elif choice[0] == "d":			py_pjsua.dump(choice[1] == "d")		elif choice[0] == "a":			if g_current_call != py_pjsua.PJSUA_INVALID_ID:												py_pjsua.call_answer(g_current_call, 200, None, None)			else:				print "No current call"## main#app_init()app_start()app_menu()## Done, quitting..#print "PJSUA shutting down.."C_QUIT = 1# Give the worker thread chance to quit itselfwhile C_QUIT != 2:    py_pjsua.handle_events(50)print "PJSUA destroying.."py_pjsua.destroy()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情一二三区| 一区二区欧美在线观看| 欧美亚州韩日在线看免费版国语版| 亚洲成人动漫av| 国产欧美日韩综合| 日韩一级视频免费观看在线| 91在线观看免费视频| 日本亚洲欧美天堂免费| 亚洲男人的天堂在线观看| 久久婷婷久久一区二区三区| 欧美人伦禁忌dvd放荡欲情| 成人精品国产福利| 国产又粗又猛又爽又黄91精品| 亚洲国产精品一区二区久久 | 成人午夜看片网址| 丝瓜av网站精品一区二区| 亚洲日本一区二区三区| 国产目拍亚洲精品99久久精品| 在线播放中文字幕一区| 91成人免费在线| 99视频在线观看一区三区| 国模套图日韩精品一区二区 | 国产精品水嫩水嫩| 欧美第一区第二区| 制服丝袜一区二区三区| 欧美午夜一区二区| 日本精品一区二区三区高清| av亚洲产国偷v产偷v自拍| 成人午夜激情影院| 国产成人aaa| 国产成人精品三级麻豆| 国产精品18久久久久久vr| 奇米精品一区二区三区四区 | 国产精品久久久久久久久免费樱桃 | 欧美视频一区二区三区在线观看| 91亚洲国产成人精品一区二三| 国产成人免费在线| 成人午夜在线免费| 99这里只有精品| 成人91在线观看| 色综合久久久网| 在线观看免费视频综合| 欧美日韩国产一二三| 欧美久久久久免费| 日韩欧美一二区| 最近日韩中文字幕| 国产欧美一区二区精品久导航| 欧美国产日韩亚洲一区| 18涩涩午夜精品.www| 亚洲女爱视频在线| 亚洲123区在线观看| 久久99精品国产麻豆婷婷洗澡| 国内精品视频666| 成人精品视频一区二区三区| 91麻豆swag| 欧美美女喷水视频| 亚洲男人电影天堂| 一区二区国产视频| 蜜桃一区二区三区四区| 精品在线视频一区| 成人一区二区三区中文字幕| 91亚洲男人天堂| 91精品国产综合久久福利| 亚洲精品一区二区在线观看| 国产精品免费久久| 亚洲精品视频免费看| 六月丁香综合在线视频| 99天天综合性| 91精品国产一区二区三区香蕉 | 欧美成人一级视频| 国产精品午夜在线观看| 午夜精品一区在线观看| 激情综合色综合久久综合| 成人av在线资源网| 欧美精品免费视频| 国产精品美女久久久久久久久 | 自拍偷拍国产亚洲| 婷婷激情综合网| 国产a区久久久| 欧美乱熟臀69xxxxxx| 国产欧美一区二区三区在线看蜜臀| 亚洲欧美日韩精品久久久久| 欧美a级理论片| 99国产精品久久久久久久久久| 欧美一区午夜视频在线观看| 国产精品毛片a∨一区二区三区| 亚洲高清免费视频| 国产福利一区二区三区在线视频| 色综合天天综合网天天狠天天 | 国产精品白丝av| 色天使久久综合网天天| 26uuu国产电影一区二区| 一级特黄大欧美久久久| 国产精品中文字幕日韩精品| 欧美在线影院一区二区| 久久久久久亚洲综合影院红桃| 一区二区三区波多野结衣在线观看| 蜜桃视频一区二区三区| 91久久精品网| 国产精品免费网站在线观看| 久久99精品一区二区三区| 色综合激情五月| 久久久精品蜜桃| 日本欧美一区二区三区| 91国偷自产一区二区开放时间| 91精品国产综合久久婷婷香蕉| 亚洲色大成网站www久久九九| 韩国理伦片一区二区三区在线播放| 一本在线高清不卡dvd| 亚洲国产精品精华液2区45| 毛片av一区二区| 欧美三级韩国三级日本三斤| 一色屋精品亚洲香蕉网站| 国产美女视频91| 欧美www视频| 蜜臀av一区二区在线免费观看| 欧美艳星brazzers| 亚洲欧美日韩在线不卡| 成人午夜在线视频| 国产欧美中文在线| 精品一区二区在线观看| 日韩欧美高清dvd碟片| 亚洲成a人片综合在线| 在线观看91精品国产入口| 亚洲色图19p| 99视频在线精品| 一区在线观看免费| 99视频一区二区| 综合久久久久久久| 国产成人夜色高潮福利影视| 国产福利一区二区三区| 日本韩国一区二区| 日韩精品一区二区三区四区| 亚洲最新在线观看| 91久久精品一区二区三| 一区二区成人在线视频 | 色综合久久久久综合体桃花网| 国产精品久久久久精k8| 93久久精品日日躁夜夜躁欧美| 国产精品国产三级国产三级人妇| 国产成人精品免费一区二区| 亚洲国产高清在线观看视频| 成人国产电影网| 亚洲欧洲日韩在线| 色94色欧美sute亚洲13| 亚洲尤物在线视频观看| 欧美日韩久久一区二区| 蜜臀精品一区二区三区在线观看| 精品国产乱码久久久久久久| 国产成人综合亚洲91猫咪| 中文字幕在线不卡一区| 日本伦理一区二区| 无码av免费一区二区三区试看| 欧美一区二区三区婷婷月色| 国产一区二区三区四区五区入口| 久久久久久久久久久久久夜| 国产91在线观看| 一区二区三区免费在线观看| 在线观看91精品国产麻豆| 麻豆国产91在线播放| 国产亚洲精品福利| 99久久99久久久精品齐齐| 亚瑟在线精品视频| 2024国产精品| 成人黄色在线视频| 午夜精品福利在线| 国产视频亚洲色图| 欧美午夜不卡在线观看免费| 久久草av在线| 亚洲少妇最新在线视频| 宅男噜噜噜66一区二区66| 国产成人精品亚洲日本在线桃色| 亚洲精品欧美专区| 精品国产一区二区三区久久影院| 99精品久久只有精品| 日本在线不卡视频| 中文字幕日韩av资源站| 91精品国产综合久久久久久| 国产成人在线影院| 亚洲国产一区二区a毛片| 久久伊99综合婷婷久久伊| 色八戒一区二区三区| 黄网站免费久久| 一区二区理论电影在线观看| 国产一区二区三区av电影| 91精品国产一区二区三区香蕉| 日韩精品专区在线影院重磅| 一级做a爱片久久| 亚洲已满18点击进入久久| 国产一区日韩二区欧美三区| 本田岬高潮一区二区三区| 欧美无人高清视频在线观看| 欧美一区二区三区视频免费 | 一区二区三区中文在线观看| 亚洲自拍偷拍九九九| 国产乱码精品一区二区三区忘忧草 | 久久综合色8888| 欧美三级日韩三级| av在线播放一区二区三区| 国产在线看一区|