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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? smssvr.java

?? 短線收發(fā)
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
// SMSLib for Java v3
// A Java API library for sending and receiving SMS via a GSM modem
// or other supported gateways.
// Web Site: http://www.smslib.org
//
// Copyright (C) 2002-2008, Thanasis Delenikas, Athens/GREECE.
// SMSLib is distributed under the terms of the Apache License version 2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.smslib.smssvr;

import java.io.*;
import java.util.*;
import java.sql.*;
import org.smslib.*;
import org.smslib.modem.*;
import org.smslib.test.*;

/**
 * <b>SMSSvr Application</b><br>
 * SMSSvr is a simple, configurable application which serves as an interface
 * between your modems and a two-table database, one table for the inbound
 * messages and one for the outbound messages. SMSSvr will read inbound messages
 * from your modems and store them in the database and will look in the database
 * for outbound messages and will forward them via your modems.<br>
 * <br>
 * <b>Configuration File.</b><br>
 * Please review the <b>SMSSvr.conf</b> configuration file. The inline comments
 * will help you setup your configuration.<br>
 * <br>
 * The most recent documentation for SMSSvr can be found here:
 * <a href="http://smslib.org/index.php?page=smssvr">http://smslib.org/index.php?page=smssvr</a>
 */
public class SMSSvr
{
	private Service srv;
	private Properties props;
	private OutboundNotification outboundNotification;
	private CallNotification callNotification;
	private boolean shutdown = false;

	public boolean optRunOnce = false;

	public SMSSvr()
	{
		srv = new Service();
		srv.setLoadBalancer(new RoundRobinLoadBalancer(srv));
		outboundNotification = new OutboundNotification();
		callNotification = new CallNotification();
		Runtime.getRuntime().addShutdownHook(new Shutdown());
	}

	private void initialize() throws Exception
	{
		int i;
		String propName;
		FileInputStream f;

		props = new Properties();
		if (System.getProperty("smssvr.configdir") != null) f = new FileInputStream(System.getProperty("smssvr.configdir") + "SMSSvr.conf");
		else if (System.getProperty("smssvr.configfile") != null) f = new FileInputStream(System.getProperty("smssvr.configfile"));
		else throw new org.smslib.SMSLibException("Cannot find SMSSvr configuration file!");
		props.load(f);
		f.close();
		i = 0;
		propName = "gateway." + i + ".";
		while (props.getProperty(propName + "type", "").length() > 0)
		{
			if (props.getProperty(propName + "type").equalsIgnoreCase("serial_modem"))
			{
				SerialModemGateway gateway = new SerialModemGateway(props.getProperty(propName + "id"), props.getProperty(propName + "comport"), Integer.parseInt(props.getProperty(propName + "baudrate")), props.getProperty(propName + "manufacturer"), props.getProperty(propName + "model"));
				if (props.getProperty(propName + "protocol").equalsIgnoreCase("PDU")) gateway.setProtocol(MessageProtocols.PDU);
				else if (props.getProperty(propName + "protocol").equalsIgnoreCase("TEXT")) gateway.setProtocol(MessageProtocols.TEXT);
				else throw new Exception("Incorrect parameter: " + propName + "protocol");
				gateway.setSimPin(props.getProperty(propName + "pin"));
				if (props.getProperty(propName + "inbound").equalsIgnoreCase("YES")) gateway.setInbound(true);
				else if (props.getProperty(propName + "inbound").equalsIgnoreCase("NO")) gateway.setInbound(false);
				else throw new Exception("Incorrect parameter: " + propName + "inbound");
				if (props.getProperty(propName + "outbound").equalsIgnoreCase("YES")) gateway.setOutbound(true);
				else if (props.getProperty(propName + "outbound").equalsIgnoreCase("NO")) gateway.setOutbound(false);
				else throw new Exception("Incorrect parameter: " + propName + "outbound");
				gateway.setOutboundNotification(outboundNotification);
				gateway.setCallNotification(callNotification);
				srv.getLogger().info("Adding " + props.getProperty(propName + "id"));
				srv.addGateway(gateway);
			}
			else if (props.getProperty(propName + "type").equalsIgnoreCase("test"))
			{
				TestGateway gateway = new TestGateway(props.getProperty(propName + "id"));
				gateway.setOutboundNotification(outboundNotification);
				gateway.setFailCycle(5);
				srv.getLogger().info("Adding " + props.getProperty(propName + "id"));
				srv.addGateway(gateway);
			}
			i++;
			propName = "gateway." + i + ".";
		}
		Class.forName(props.getProperty("database.driver"));
	}

	private void resetQueuedMessages() throws Exception
	{
		Connection con;
		Statement cmd;

		con = getDbConnection();
		if (con == null) return;
		cmd = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
		cmd.executeUpdate("update " + props.getProperty("database.tables.sms_out", "smssvr_out") + " set status = 'U' where status = 'Q'");
		con.commit();
		cmd.close();
		con.close();
	}

	private class Shutdown extends Thread
	{
		public void run()
		{
			srv.getLogger().info("Shutting down, please wait...");
			shutdown = true;
			try
			{
				srv.stopService();
			}
			catch (Exception e)
			{
				srv.getLogger().error(e);
			}
		}
	}

	private void saveToDatabase(List msgList) throws Exception
	{
		InboundMessage msg;
		Connection con;
		Statement cmd;
		ResultSet rs;
		int readCount;

		readCount = 0;
		con = getDbConnection();
		if (con == null) return;
		cmd = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
		rs = cmd.executeQuery("select * from " + props.getProperty("database.tables.sms_in", "smssvr_in") + " where id = -1");
		for (int i = 0; i < msgList.size(); i++)
		{
			readCount++;
			if (readCount > Integer.parseInt(props.getProperty("settings.max_in"))) break;
			msg = (InboundMessage) msgList.get(i);
			if ((msg.getType() == MessageTypes.INBOUND) || (msg.getType() == MessageTypes.STATUSREPORT))
			{
				rs.moveToInsertRow();
				rs.updateInt("process", 0);
				rs.updateString("originator", msg.getOriginator());
				if (msg.getType() == MessageTypes.INBOUND) rs.updateString("type", "I");
				else if (msg.getType() == MessageTypes.STATUSREPORT) rs.updateString("type", "S");
				if (msg.getEncoding() == MessageEncodings.ENC7BIT) rs.updateString("encoding", "7");
				else if (msg.getEncoding() == MessageEncodings.ENC8BIT) rs.updateString("encoding", "8");
				else if (msg.getEncoding() == MessageEncodings.ENCUCS2) rs.updateString("encoding", "U");
				if (msg.getDate() != null) rs.updateTimestamp("message_date", new Timestamp(msg.getDate().getTime()));
				rs.updateTimestamp("receive_date", new Timestamp(new java.util.Date().getTime()));
				rs.updateString("text", msg.getText().replaceAll("'", "''"));
				rs.updateString("gateway_id", msg.getGatewayId());
				rs.insertRow();
				srv.getLogger().info("<<< From: " + msg.getGatewayId() + " : " + msg.getOriginator());
			}
		}
		rs.close();
		cmd.close();
		con.commit();
		con.close();
	}

	private void sendMessages() throws Exception
	{
		OutboundMessage msg;
		Connection con;
		Statement cmd;
		ResultSet rs;
		int sendCount;

		sendCount = 0;
		con = getDbConnection();
		if (con == null) return;
		cmd = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
		if (props.getProperty("database.type").equalsIgnoreCase("mysql"))
			rs = cmd.executeQuery("select * from " + props.getProperty("database.tables.sms_out", "smssvr_out") + " where status = 'U' order by priority, id");
		else
			rs = cmd.executeQuery("select *, case when priority = 'H' then 1 when priority = 'N' then 2 when priority = 'L' then 3 else 4 end as prioritynum from " + props.getProperty("database.tables.sms_out", "smssvr_out") + " where status = 'U' order by prioritynum, id");
		while (rs.next())
		{
			if (checkTimeFrame(rs.getString("priority")))
			{
				sendCount++;
				if (sendCount > Integer.parseInt(props.getProperty("settings.max_out"))) break;
				msg = new OutboundMessage(rs.getString("recipient"), rs.getString("text"));
				if (rs.getString("priority").equalsIgnoreCase("L")) msg.setPriority(MessagePriorities.LOW);
				else if (rs.getString("priority").equalsIgnoreCase("N")) msg.setPriority(MessagePriorities.NORMAL);
				else if (rs.getString("priority").equalsIgnoreCase("H")) msg.setPriority(MessagePriorities.HIGH);
				msg.setId("" + rs.getString("id"));
				if (rs.getString("encoding").equals("7")) msg.setEncoding(MessageEncodings.ENC7BIT);
				else if (rs.getString("encoding").equals("8")) msg.setEncoding(MessageEncodings.ENC8BIT);
				else msg.setEncoding(MessageEncodings.ENCUCS2);
				if (rs.getInt("status_report") == 1) msg.setStatusReport(true);
				if (rs.getInt("flash_sms") == 1) msg.setFlashSms(true);
				if (rs.getInt("src_port") != -1)
				{
					msg.setSrcPort(rs.getInt("src_port"));
					msg.setDstPort(rs.getInt("dst_port"));
				}
				if (rs.getString("originator") != null) msg.setFrom(rs.getString("originator"));
				rs.updateString("status", "Q"); 
				rs.updateRow();
				con.commit();
				if (props.getProperty("settings.send_mode", "sync").equalsIgnoreCase(("sync")))
				{
					if (!rs.getString("gateway_id").equals("*")) srv.sendMessage(msg, rs.getString("gateway_id"));
					else srv.sendMessage(msg);
					updateOutboundDatabase(msg);
					srv.getLogger().info(">>> SEND TO: " + msg.getGatewayId() + " : " + msg.getRecipient());
				}
				else
				{
					if (!rs.getString("gateway_id").equals("*")) srv.queueMessage(msg, rs.getString("gateway_id"));
					else srv.queueMessage(msg);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区av电影 | 91福利精品视频| 欧美成人欧美edvon| 日本欧美在线观看| 91国产精品成人| 国产精品久久久一本精品| 国产+成+人+亚洲欧洲自线| 久久九九国产精品| 麻豆91在线看| 2023国产精品| 91一区二区三区在线观看| 亚洲人成7777| 91极品美女在线| 亚洲国产成人tv| 日韩欧美一级二级| 毛片av一区二区三区| 欧美日韩精品专区| 免费看日韩精品| 欧美一级xxx| 国产制服丝袜一区| 国产精品久线观看视频| 91色porny蝌蚪| 日韩在线播放一区二区| 久久综合久久鬼色中文字| 美女国产一区二区三区| 国产欧美一区二区在线观看| 成人性生交大片免费看在线播放 | 免费看欧美美女黄的网站| 精品日韩一区二区三区免费视频| 激情都市一区二区| 中文字幕精品一区二区精品绿巨人 | 日韩avvvv在线播放| 精品国内片67194| 福利一区福利二区| 亚洲图片欧美综合| 久久精品视频在线免费观看| 色成年激情久久综合| 日本中文字幕一区| 欧美国产欧美亚州国产日韩mv天天看完整| 9人人澡人人爽人人精品| 亚洲国产欧美日韩另类综合 | 色婷婷综合久久久中文一区二区| 免费人成精品欧美精品| 亚洲精品中文在线观看| 国产欧美日本一区视频| 日韩欧美中文字幕制服| 欧美午夜影院一区| 99精品一区二区三区| 狠狠狠色丁香婷婷综合激情 | 欧美乱妇20p| 91在线视频在线| 成人免费视频播放| 久久99国产精品成人| 日韩成人av影视| 亚洲高清三级视频| 一区二区激情视频| 日韩毛片在线免费观看| 欧美国产日韩精品免费观看| 精品国产一区二区三区不卡| 91精品国产一区二区三区香蕉| 欧美在线综合视频| 91一区一区三区| 99在线精品观看| 成人美女在线观看| 国产一区二区三区免费看| 免费三级欧美电影| 美女www一区二区| 亚洲一区二区综合| 亚洲自拍偷拍网站| 一二三区精品福利视频| 亚洲美女精品一区| 亚洲欧美一区二区三区孕妇| 日韩美女精品在线| 亚洲美女屁股眼交3| 亚洲免费观看高清完整版在线观看熊 | 亚洲欧美日韩在线| 国产精品久久久久久久久动漫 | 日韩三级中文字幕| 91精品久久久久久久91蜜桃| 制服.丝袜.亚洲.中文.综合| 欧美一区午夜精品| 精品乱码亚洲一区二区不卡| 精品日韩在线观看| 国产日韩欧美电影| 综合婷婷亚洲小说| 亚洲二区在线观看| 青青草成人在线观看| 麻豆成人久久精品二区三区小说| 美女免费视频一区| 精一区二区三区| 丁香五精品蜜臀久久久久99网站| 国产99久久久久久免费看农村| 丁香婷婷综合五月| 色偷偷久久一区二区三区| 欧美日韩和欧美的一区二区| 5566中文字幕一区二区电影| 3atv一区二区三区| 久久久午夜精品理论片中文字幕| 国产亲近乱来精品视频| 亚洲免费看黄网站| 男人操女人的视频在线观看欧美| 国内成人精品2018免费看| 国产精品888| 色中色一区二区| 3d成人动漫网站| 欧美国产精品一区| 亚洲成人av福利| 国产精品中文字幕日韩精品| 色综合天天综合| 日韩女同互慰一区二区| 国产精品免费视频一区| 亚洲成人免费观看| 国产成人综合精品三级| 在线看日韩精品电影| 精品成人a区在线观看| 亚洲三级在线播放| 韩国在线一区二区| 欧美三级中文字幕在线观看| 亚洲精品一区二区三区福利| 1024亚洲合集| 国内偷窥港台综合视频在线播放| aaa欧美大片| 久久综合中文字幕| 亚洲国产精品欧美一二99| 懂色av中文一区二区三区| 欧美高清一级片在线| 亚洲欧洲在线观看av| 激情六月婷婷久久| 在线不卡一区二区| 亚洲麻豆国产自偷在线| 国产一区二区三区四区五区入口| 在线精品亚洲一区二区不卡| 久久九九久精品国产免费直播| 午夜精品福利久久久| www.日韩在线| 久久综合中文字幕| 日本在线观看不卡视频| 欧美三级视频在线观看| 国产精品国模大尺度视频| 久久99久国产精品黄毛片色诱| 欧美日韩日日夜夜| 亚洲精品乱码久久久久| 成人午夜视频在线| 久久蜜臀中文字幕| 国产在线播放一区三区四| 欧美裸体bbwbbwbbw| 一区二区三区日韩| 色老汉av一区二区三区| 国产精品欧美久久久久无广告| 久久99精品久久久| 欧美一区二区三区精品| 无码av中文一区二区三区桃花岛| 在线观看www91| 亚洲综合一区在线| 91毛片在线观看| 最新热久久免费视频| 成人a区在线观看| 国产精品日日摸夜夜摸av| 国产成人aaa| 欧美激情一区在线观看| 国产成人午夜99999| 国产日韩高清在线| 国产69精品一区二区亚洲孕妇| 久久精品亚洲一区二区三区浴池| 国内精品写真在线观看| 日韩美女主播在线视频一区二区三区| 日本少妇一区二区| 精品国产一区二区三区久久久蜜月| 久久99久久久久| 精品成人私密视频| 国产69精品久久久久毛片| 国产精品欧美一区二区三区| av高清不卡在线| 一区二区三区小说| 欧美伦理影视网| 久久精品国产亚洲5555| 久久久久免费观看| 99九九99九九九视频精品| 一区二区三区精品久久久| 欧美撒尿777hd撒尿| 日韩电影在线看| 久久免费视频色| 色婷婷综合久色| 日本欧美一区二区| 久久综合久久综合亚洲| av福利精品导航| 日韩精品五月天| 久久久蜜臀国产一区二区| 不卡电影一区二区三区| 夜夜揉揉日日人人青青一国产精品 | 91精品国产欧美一区二区18| 奇米亚洲午夜久久精品| 久久精品亚洲一区二区三区浴池 | 日韩视频免费直播| 国产精品自拍网站| 国产精品成人一区二区三区夜夜夜| 欧美日韩午夜影院| 国产又黄又大久久| 夜夜操天天操亚洲| 日韩女同互慰一区二区|