本文整理汇总了Java中org.asteriskjava.fastagi.ClassNameMappingStrategy类的典型用法代码示例。如果您正苦于以下问题:Java ClassNameMappingStrategy类的具体用法?Java ClassNameMappingStrategy怎么用?Java ClassNameMappingStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClassNameMappingStrategy类属于org.asteriskjava.fastagi包,在下文中一共展示了ClassNameMappingStrategy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInit
import org.asteriskjava.fastagi.ClassNameMappingStrategy; //导入依赖的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);
}
示例2: AgiServer
import org.asteriskjava.fastagi.ClassNameMappingStrategy; //导入依赖的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");
}
示例3: main
import org.asteriskjava.fastagi.ClassNameMappingStrategy; //导入依赖的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(".");
}
}