本文整理汇总了Java中javax.sip.ListeningPoint类的典型用法代码示例。如果您正苦于以下问题:Java ListeningPoint类的具体用法?Java ListeningPoint怎么用?Java ListeningPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListeningPoint类属于javax.sip包,在下文中一共展示了ListeningPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addListeningPoint
import javax.sip.ListeningPoint; //导入依赖的package包/类
public synchronized void addListeningPoint(ListeningPoint listeningPoint)
throws ObjectInUseException {
ListeningPointImpl lp = (ListeningPointImpl) listeningPoint;
if (lp.sipProvider != null && lp.sipProvider != this)
throw new ObjectInUseException(
"Listening point assigned to another provider");
String transport = lp.getTransport().toUpperCase();
if (this.listeningPoints.containsKey(transport)
&& this.listeningPoints.get(transport) != listeningPoint)
throw new ObjectInUseException(
"Listening point already assigned for transport!");
// This is for backwards compatibility.
lp.sipProvider = this;
this.listeningPoints.put(transport, lp);
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:21,代码来源:SipProviderImpl.java
示例2: createSipProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createSipProvider(ListeningPoint listeningPoint)
throws ObjectInUseException {
if (listeningPoint == null)
throw new NullPointerException("null listeningPoint");
if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG))
this.logger.logDebug(
"createSipProvider: " + listeningPoint);
ListeningPointImpl listeningPointImpl = (ListeningPointImpl) listeningPoint;
if (listeningPointImpl.sipProvider != null)
throw new ObjectInUseException("Provider already attached!");
SipProviderImpl provider = new SipProviderImpl(this);
provider.setListeningPoint(listeningPointImpl);
listeningPointImpl.sipProvider = provider;
this.sipProviders.add(provider);
return provider;
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:19,代码来源:SipStackImpl.java
示例3: Server
import javax.sip.ListeningPoint; //导入依赖的package包/类
public Server() {
try {
final Properties defaultProperties = new Properties();
host = "127.0.0.1";
defaultProperties.setProperty("javax.sip.STACK_NAME", "server");
defaultProperties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG");
defaultProperties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "server_debug_ViaRPortTest.txt");
defaultProperties.setProperty("gov.nist.javax.sip.SERVER_LOG", "server_log_ViaRPortTest.txt");
defaultProperties.setProperty("gov.nist.javax.sip.TCP_POST_PARSING_THREAD_POOL_SIZE", "64");
defaultProperties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
this.sipFactory = SipFactory.getInstance();
this.sipFactory.setPathName("gov.nist");
this.sipStack = this.sipFactory.createSipStack(defaultProperties);
this.sipStack.start();
ListeningPoint lp2 = this.sipStack.createListeningPoint(host, SERVER_PORT, testProtocol);
this.provider2 = this.sipStack.createSipProvider(lp2);
this.provider2.addSipListener(this);
} catch (Exception e) {
e.printStackTrace();
Assert.fail("unexpected exception ");
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:NIOParsingTest.java
示例4: createProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress,
myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("provider " + sipProvider);
logger.info("sipStack = " + sipStack);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
TestCase.fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:19,代码来源:Shootme.java
示例5: processResponse
import javax.sip.ListeningPoint; //导入依赖的package包/类
public void processResponse(ResponseEvent responseEvent) {
try {
Response response = responseEvent.getResponse();
Dialog dialog = responseEvent.getDialog();
this.lastResponseTable.put(dialog, response);
ServerTransaction serverTransaction = (ServerTransaction)responseEvent.getClientTransaction().getApplicationData();
Request stRequest = serverTransaction.getRequest();
Response newResponse = this.messageFactory.createResponse(response.getStatusCode(),stRequest);
SipProvider provider = (SipProvider)responseEvent.getSource();
SipProvider peerProvider = this.getPeerProvider(provider);
ListeningPoint peerListeningPoint = peerProvider.getListeningPoint("udp");
ContactHeader peerContactHeader = ((ListeningPointExt)peerListeningPoint).createContactHeader();
newResponse.setHeader(peerContactHeader);
serverTransaction.sendResponse(newResponse);
} catch (Exception ex) {
ex.printStackTrace();
BackToBackUserAgentTest.fail("Unexpected exception");
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:20,代码来源:BackToBackUserAgent.java
示例6: createProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress, myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("provider " + sipProvider);
logger.info("sipStack = " + sipStack);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
TestCase.fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:18,代码来源:Shootme.java
示例7: createProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress,
myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("provider " + sipProvider);
logger.info("sipStack = " + sipStack);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
TestCase.fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:20,代码来源:Shootme.java
示例8: createSipProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createSipProvider() {
try {
ListeningPoint listeningPoint = sipStack.createListeningPoint(
host, port, transport);
if (sipProvider != null ) return sipProvider;
logger.info("listening point = " + host + " port = " + port);
logger.info("listening point = " + listeningPoint);
sipProvider = sipStack
.createSipProvider(listeningPoint);
return sipProvider;
} catch (Exception ex) {
logger.error(unexpectedException, ex);
TestCase.fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:22,代码来源:Shootist.java
示例9: createProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress,
myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("udp provider " + sipProvider);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:18,代码来源:CancelEventTest.java
示例10: stopSipStack
import javax.sip.ListeningPoint; //导入依赖的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;
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:NoToTagOn1xxDialogLeakTest.java
示例11: createProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createProvider(int newPort) {
try {
port = newPort;
ListeningPoint lp = sipStack.createListeningPoint("127.0.0.1",
this.port, transport);
this.sipProvider = sipStack.createSipProvider(lp);
logger.info("udp provider " + sipProvider);
} catch (Exception ex) {
logger.info(ex.getMessage(), ex);
sipProvider = null;
TestHarness.fail("Failed to create SIP Provider on port " + newPort + ", because of " + ex.getMessage());
}
return sipProvider;
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:21,代码来源:Notifier.java
示例12: createSipProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createSipProvider() {
try {
ListeningPoint listeningPoint = protocolObjects.sipStack
.createListeningPoint(host, port, protocolObjects.transport);
sipProvider = protocolObjects.sipStack
.createSipProvider(listeningPoint);
// sipProvider.setAutomaticDialogSupportEnabled(false);
return sipProvider;
} catch (Exception ex) {
logger.error(unexpectedException, ex);
fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:17,代码来源:Proxy.java
示例13: createSipProvider
import javax.sip.ListeningPoint; //导入依赖的package包/类
public SipProvider createSipProvider() {
try {
ListeningPoint listeningPoint = protocolObjects.sipStack
.createListeningPoint(host, port, protocolObjects.transport);
sipProvider = protocolObjects.sipStack
.createSipProvider(listeningPoint);
sipProvider.setAutomaticDialogSupportEnabled(false);
return sipProvider;
} catch (Exception ex) {
logger.error(unexpectedException, ex);
fail(unexpectedException);
return null;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:17,代码来源:Proxy.java
示例14: createTiContact
import javax.sip.ListeningPoint; //导入依赖的package包/类
/**
* Add a contact for the TI.
*/
public ContactHeader createTiContact() throws Exception {
try {
ContactHeader contact = tiHeaderFactory.createContactHeader();
// JvB: getIPAddress may return null!
String ip = tiSipProvider.getSipStack().getIPAddress();
if (ip == null) {
ListeningPoint lp = (ListeningPoint) tiSipProvider
.getSipStack().getListeningPoints().next();
ip = lp.getIPAddress();
}
SipURI srcSipURI = tiAddressFactory.createSipURI(null, ip);
srcSipURI.setPort(tiSipProvider.getListeningPoint("udp").getPort());
srcSipURI.setTransportParam("udp");
Address address = tiAddressFactory.createAddress(srcSipURI);
address.setDisplayName("TI Contact");
contact.setAddress(address);
return contact;
} catch (Exception ex) {
ex.printStackTrace();
assertTrue(false);
throw ex;
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:29,代码来源:MessageFlowHarness.java
示例15: createRiContact
import javax.sip.ListeningPoint; //导入依赖的package包/类
/**
* Add a contact for the TI.
*/
public ContactHeader createRiContact() throws TckInternalError {
try {
ContactHeader contact = riHeaderFactory.createContactHeader();
// BUG reported by Ben Evans (Open Cloud):
// Should be using RI's address factory here, not TI's.
ListeningPoint lp = riSipProvider.getListeningPoints()[0];
SipURI srcSipURI = riAddressFactory.createSipURI(null, lp
.getIPAddress());
srcSipURI.setPort(lp.getPort());
srcSipURI.setTransportParam(lp.getTransport());
Address address = riAddressFactory.createAddress(srcSipURI);
address.setDisplayName("RI Contact");
contact.setAddress(address);
return contact;
} catch (Exception ex) {
throw new TckInternalError(ex.getMessage());
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:MessageFlowHarness.java
示例16: SipSubscription
import javax.sip.ListeningPoint; //导入依赖的package包/类
SipSubscription(String from, String to) throws ParseException
{
this.localParty = SipService.addressFactory.createAddress("sip:" + from + "@" + SipService.sipListener.host);
this.remoteParty = SipService.addressFactory.createAddress("sip:" + to + "@" + SipService.sipListener.host);
this.localTag = Integer.toString((int) (Math.random() * 100000));
this.remoteTag = null;
callId = SipService.sipProvider.getNewCallId().getCallId();
this.cseq = 1;
@SuppressWarnings("unused")
ListeningPoint listeningPoint = SipService.sipProvider.getListeningPoint(ListeningPoint.UDP);
this.contact = "sip:" + to + "@" + SipService.getRemoteIP();
rl = new LinkedList<Address>();
expires = System.currentTimeMillis() + (3600 * 1000);
}
开发者ID:idwanglu2010,项目名称:openfire,代码行数:21,代码来源:SipSubscription.java
示例17: SipProviderImpl
import javax.sip.ListeningPoint; //导入依赖的package包/类
/** Creates a new instance of SipProviderImpl */
protected SipProviderImpl(SipStackImpl sipStack) {
this.eventScanner = sipStack.getEventScanner(); // for quick access.
this.sipStack = sipStack;
this.eventScanner.incrementRefcount();
this.listeningPoints = new ConcurrentHashMap<String,ListeningPoint>();
this.automaticDialogSupportEnabled = this.sipStack
.isAutomaticDialogSupportEnabled();
this.dialogErrorsAutomaticallyHandled = this.sipStack.isAutomaticDialogErrorHandlingEnabled();
this.loopDetectionEnabled = this.sipStack.isServerLoopDetectionEnabled();
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:12,代码来源:SipProviderImpl.java
示例18: getListeningPoint
import javax.sip.ListeningPoint; //导入依赖的package包/类
public ListeningPoint getListeningPoint() {
if (this.listeningPoints.size() > 0)
return (ListeningPoint) this.listeningPoints.values().iterator()
.next();
else
return null;
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:8,代码来源:SipProviderImpl.java
示例19: setListeningPoint
import javax.sip.ListeningPoint; //导入依赖的package包/类
public synchronized void setListeningPoint(ListeningPoint listeningPoint) {
if (listeningPoint == null)
throw new NullPointerException("Null listening point");
ListeningPointImpl lp = (ListeningPointImpl) listeningPoint;
lp.sipProvider = this;
String transport = lp.getTransport().toUpperCase();
// this.address = listeningPoint.getIPAddress();
// this.port = listeningPoint.getPort();
// This is the first listening point.
this.listeningPoints.clear();
this.listeningPoints.put(transport, listeningPoint);
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:14,代码来源:SipProviderImpl.java
示例20: getListeningPoints
import javax.sip.ListeningPoint; //导入依赖的package包/类
public synchronized ListeningPoint[] getListeningPoints() {
ListeningPoint[] retval = new ListeningPointImpl[this.listeningPoints
.size()];
this.listeningPoints.values().toArray(retval);
return retval;
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:8,代码来源:SipProviderImpl.java
注:本文中的javax.sip.ListeningPoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论