本文整理汇总了Java中javax.sip.SipStack类的典型用法代码示例。如果您正苦于以下问题:Java SipStack类的具体用法?Java SipStack怎么用?Java SipStack使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SipStack类属于javax.sip包,在下文中一共展示了SipStack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopSipStack
import javax.sip.SipStack; //导入依赖的package包/类
public static void stopSipStack(SipStack sipStack, SipListener listener) {
Iterator<SipProvider> sipProviderIterator = sipStack.getSipProviders();
try{
while (sipProviderIterator.hasNext()) {
SipProvider sipProvider = sipProviderIterator.next();
ListeningPoint[] listeningPoints = sipProvider.getListeningPoints();
for (ListeningPoint listeningPoint : listeningPoints) {
sipProvider.removeListeningPoint(listeningPoint);
sipStack.deleteListeningPoint(listeningPoint);
listeningPoints = sipProvider.getListeningPoints();
}
sipProvider.removeSipListener(listener);
sipStack.deleteSipProvider(sipProvider);
sipProviderIterator = sipStack.getSipProviders();
}
} catch (Exception e) {
throw new IllegalStateException("Cant remove the listening points or sip providers", e);
}
sipStack.stop();
sipStack = null;
}
示例2: setSipStack
import javax.sip.SipStack; //导入依赖的package包/类
public void setSipStack(SipStack sipStack) {
if(sipStack instanceof SIPTransactionStack) {
this.sipStack = (SIPTransactionStack)sipStack;
this.stackLogger = this.sipStack.getStackLogger();
}
else
throw new IllegalArgumentException("sipStack must be a SIPTransactionStack");
}
示例3: init
import javax.sip.SipStack; //导入依赖的package包/类
public void init(SipStack stack) {
callAnalyzer = new CallAnalyzer(((SipStackImpl) stack));
Properties props = ((SipStackImpl) stack).getConfigurationProperties();
Long checkingInterval = Long.parseLong(
props.getProperty(CallAnalysisInterceptor.class.getName() + ".checkingInterval", "1000"));
Long minStuckTime = Long.parseLong(
props.getProperty(CallAnalysisInterceptor.class.getName() + ".minStuckTIme", "4000"));
Long minTimeBetweenDumps = Long.parseLong(
props.getProperty(CallAnalysisInterceptor.class.getName() + ".minTimeBetweenDumps", "2000"));
MetricAnalysisConfiguration config = new MetricAnalysisConfiguration(
checkingInterval, minTimeBetweenDumps, minStuckTime);
callAnalyzer.configure(interceptorCheckpoint, config);
}
示例4: init
import javax.sip.SipStack; //导入依赖的package包/类
public void init(SipStack stack) {
sipStack = (SipStackImpl) stack;
logger.logInfo("Initializing congestion control valve");
String serverTransactionsString = sipStack.getConfigurationProperties().getProperty("gov.nist.javax.sip.MAX_SERVER_TRANSACTIONS", "10000");
serverTransactionTableHighwaterMark = new Integer(serverTransactionsString);
String dropResponseStatusString = sipStack.getConfigurationProperties().getProperty("DROP_RESPONSE_STATUS", "503");
dropResponseStatus = new Integer(dropResponseStatusString);
}
示例5: BackToBackUserAgent
import javax.sip.SipStack; //导入依赖的package包/类
public BackToBackUserAgent(int port1, int port2) {
SipFactory sipFactory = null;
sipFactory = SipFactory.getInstance();
sipFactory.setPathName("gov.nist");
Properties properties = new Properties();
this.protocolObjects = new ProtocolObjects("backtobackua","gov.nist","udp",true,true, false);
try {
headerFactory = protocolObjects.headerFactory;
addressFactory = protocolObjects.addressFactory;
messageFactory = protocolObjects.messageFactory;
SipStack sipStack = protocolObjects.sipStack;
ListeningPoint lp1 = sipStack.createListeningPoint("127.0.0.1", port1, "udp");
ListeningPoint lp2 = sipStack.createListeningPoint("127.0.0.1", port2, "udp");
SipProvider sp1 = sipStack.createSipProvider(lp1);
SipProvider sp2 = sipStack.createSipProvider(lp2);
this.listeningPoints[0] = lp1;
this.listeningPoints[1] = lp2;
this.providers[0] = sp1;
this.providers[1] = sp2;
sp1.addSipListener(this);
sp2.addSipListener(this);
} catch (Exception ex) {
}
}
示例6: init
import javax.sip.SipStack; //导入依赖的package包/类
public synchronized boolean init()
{
if (initialized == true)
return true;
initialized = true;
logger.info("Starting the collector stack...");
try {
SipStack sipStack;
Configuration configuration;
configuration = new Configuration();
configuration.setStackName(STACK_NAME);
SipFactory.getInstance().setPathName("gov.nist");
sipStack = SipFactory.getInstance().createSipStack(configuration);
RequestMessage.initFactory(SipFactory.getInstance(), configuration);
ListeningPoint reaperUdp = sipStack.createListeningPoint(configuration.getWriteInterface(), configuration.getWritePort(), "udp");
collectorProvider = sipStack.createSipProvider(reaperUdp);
collectorProvider.addSipListener(new CollectorListener());
collectorProvider.setAutomaticDialogSupportEnabled(false);
logger.info("Collector SIP stack initialized successfully");
}
catch (Exception e)
{
logger.error("Error initializing stack: ", e);
return false;
}
return true;
}
示例7: init
import javax.sip.SipStack; //导入依赖的package包/类
public synchronized boolean init()
{
if (initialized == true)
return true;
initialized = true;
logger.info("Starting the reaper stack...");
try {
SipStack sipStack;
Configuration configuration;
configuration = new Configuration();
configuration.setStackName(STACK_NAME);
SipFactory.getInstance().setPathName("gov.nist");
sipStack = SipFactory.getInstance().createSipStack(configuration);
RequestMessage.initFactory(SipFactory.getInstance(), configuration);
ListeningPoint reaperTcp = sipStack.createListeningPoint("127.0.0.1", configuration.getReadPort(), "tcp");
reaperProvider = sipStack.createSipProvider(reaperTcp);
reaperProvider.addSipListener(new ReaperListener());
reaperProvider.setAutomaticDialogSupportEnabled(false);
logger.info("Reaper SIP stack initialized successfully");
}
catch (Exception e)
{
logger.error("Error initializing stack: ", e);
return false;
}
return true;
}
示例8: SipCommRouter
import javax.sip.SipStack; //导入依赖的package包/类
public SipCommRouter(SipStack sipStack, String outboundProxy) {
outboundProxy = SIPConfig.getOutboundProxy();
this.myStack = sipStack;
if (outboundProxy != null && outboundProxy.length() > 0) {
this.outboundProxy = new SipCommHop(outboundProxy);
}
}
示例9: getSipStack
import javax.sip.SipStack; //导入依赖的package包/类
public SipStack getSipStack() {
return (SipStack) this.sipStack;
}
示例10: init
import javax.sip.SipStack; //导入依赖的package包/类
public void init(SipStack stack) {
SipStackImpl s = (SipStackImpl) stack;
s.getConfigurationProperties();
System.out.println("SIP Message Valve initialized");
}
示例11: init
import javax.sip.SipStack; //导入依赖的package包/类
public void init(SipStack stack) {
SipStackImpl impl = (SipStackImpl) stack;
impl.getConfigurationProperties().getProperty("keee");
impl.getActiveClientTransactionCount();
inited = true;
}
示例12: getSipStack
import javax.sip.SipStack; //导入依赖的package包/类
public SipStack getSipStack() {
return sipStack;
}
示例13: setSipStack
import javax.sip.SipStack; //导入依赖的package包/类
/**
* To use a custom SipStack
*/
public void setSipStack(SipStack sipStack) {
this.sipStack = sipStack;
}
示例14: setSipStack
import javax.sip.SipStack; //导入依赖的package包/类
public void setSipStack(SipStack sipStack) {
this.sipStack = sipStack;
}
示例15: SipHandler
import javax.sip.SipStack; //导入依赖的package包/类
public SipHandler(SipStack sipStack, String defaultRoute) {
}