当前位置: 首页>>代码示例>>Java>>正文


Java AgiServerThread类代码示例

本文整理汇总了Java中org.asteriskjava.fastagi.AgiServerThread的典型用法代码示例。如果您正苦于以下问题:Java AgiServerThread类的具体用法?Java AgiServerThread怎么用?Java AgiServerThread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AgiServerThread类属于org.asteriskjava.fastagi包,在下文中一共展示了AgiServerThread类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onInit

import org.asteriskjava.fastagi.AgiServerThread; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void onInit() {
    int port = Integer.getInteger("org.opennms.netmgt.asterisk.agi.listenPort", m_port);
    int maxPoolSize = Integer.getInteger("org.opennms.netmgt.asterisk.agi.maxPoolSize", m_maxPoolSize);
    
    DefaultAgiServer agiServer = new DefaultAgiServer(new ClassNameMappingStrategy(false));
    
    agiServer.setPort(port);
    agiServer.setMaximumPoolSize(maxPoolSize);
    
    m_agiServerThread = new AgiServerThread(agiServer);
    
    // This is the default, but be explicit
    m_agiServerThread.setDaemon(true);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:17,代码来源:AsteriskGateway.java

示例2: AgiServer

import org.asteriskjava.fastagi.AgiServerThread; //导入依赖的package包/类
private AgiServer() {
	DefaultAgiServer server = new DefaultAgiServer();
	ClassNameMappingStrategy strategy = new ClassNameMappingStrategy();
	server.setMappingStrategy(strategy);
	AgiServerThread thread = new AgiServerThread(server);
	thread.startup();
	BrokerFactory.getLoggingBroker().logDebug("AGI Server started");
}
 
开发者ID:davidrudder23,项目名称:OpenNotification,代码行数:9,代码来源:AgiServer.java

示例3: main

import org.asteriskjava.fastagi.AgiServerThread; //导入依赖的package包/类
public static void main (String[] args) throws Exception {
	DefaultAgiServer server = new DefaultAgiServer();
	//server.setPort(5060);
	ClassNameMappingStrategy strategy = new ClassNameMappingStrategy();
	server.setMappingStrategy(strategy);
	AgiServerThread thread = new AgiServerThread(server);
	thread.startup();
	System.out.println ("Server started");
	
	
	// Do the outbound
	ManagerConnection con = new ManagerConnectionFactory("10.10.10.1", "reliable", "reliable").createManagerConnection();
	con.login();
	OriginateAction origAction = new OriginateAction();
	origAction.setChannel("SIP/[email protected]");
	origAction.setContext("outgoing");
	origAction.setExten("999");
	origAction.setPriority(new Integer(1));
	ManagerResponse origResponse = con.sendAction(origAction);
	if (origResponse.getResponse().toLowerCase().indexOf("error") >= 0) {
		System.out.println ("Error: "+origResponse.getMessage());
	}
	System.out.println ("Originate Response = "+origResponse);
	con.logoff();
	
	while (true) {
		Thread.sleep(100000);
		System.out.println(".");
	}
}
 
开发者ID:davidrudder23,项目名称:OpenNotification,代码行数:31,代码来源:SimpleAsteriskTest.java


注:本文中的org.asteriskjava.fastagi.AgiServerThread类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。