domainAndPort = colonPattern.split(tokens[0], 0); domainName = domainAndPort[0]; return new NotifiedEntity(domainName); notifiedEntity = new NotifiedEntity(localName, domainName, port); } catch (Exception ex) { throw new ParseException("unable to parse the " + value + " Message = " + ex.getMessage(), 0);
public String encodeNotifiedEntity(NotifiedEntity n) { StringBuffer s = new StringBuffer(""); if (n.getLocalName() != null) { s.append(n.getLocalName()).append("@"); } if (n.getDomainName() != null) { s.append(n.getDomainName()); } if (n.getPortNumber() > 0) { s.append(":").append(n.getPortNumber()); } return s.toString(); }
notifiedEntity = this.stack.provider.getNotifiedEntity(); port = notifiedEntity.getPortNumber(); host += notifiedEntity.getDomainName();
notifiedEntity = this.stack.provider.getNotifiedEntity(); port = notifiedEntity.getPortNumber(); host += notifiedEntity.getDomainName();
/** * Creates a new instance of TransactionHandle. * * Used by stack to prepare transaction for transmitting message from * provider to the application. * * @param stack * the reference to the MGCP stack. * @remoteAddress the address from wich command message was received. * @port the number of the port from wich command received. */ public TransactionHandler(JainMgcpStackImpl stack, InetAddress remoteAddress, int port) { this(stack); this.remoteAddress = remoteAddress; this.remotePort = port; if (this.stack.provider.getNotifiedEntity() == null) { NotifiedEntity notifiedEntity = new NotifiedEntity(this.remoteAddress.getHostName(), this.remoteAddress .getHostAddress(), this.remotePort); this.stack.provider.setNotifiedEntity(notifiedEntity); } }
if (notifiedEntity.getLocalName() != null && notifiedEntity.getLocalName().length()>0) currNode=notifiedEntity.getLocalName().getBytes(); System.arraycopy(currNode, 0, destination, offset, currNode.length); totalLength+=currNode.length; if (notifiedEntity.getDomainName() != null && notifiedEntity.getDomainName().length()>0) currNode=notifiedEntity.getDomainName().getBytes(); System.arraycopy(currNode, 0, destination, offset+totalLength, currNode.length); totalLength+=currNode.length; if (notifiedEntity.getPortNumber() > 0) totalLength+=StringFunctions.encodeInt(destination,offset+totalLength,notifiedEntity.getPortNumber());
notifiedEntity = this.stack.provider.getNotifiedEntity(); port = notifiedEntity.getPortNumber(); host += notifiedEntity.getDomainName();
/** * Creates a new instance of TransactionHandle. * * Used by stack to prepare transaction for transmitting message from provider to the application. * * @param stack * the reference to the MGCP stack. * @remoteAddress the address from wich command message was received. * @port the number of the port from wich command received. */ public TransactionHandler(JainMgcpStackImpl stack, InetAddress remoteAddress, int port) { this(stack); this.remoteAddress = remoteAddress; this.remotePort = port; if (this.stack.provider.getNotifiedEntity() == null) { NotifiedEntity notifiedEntity = new NotifiedEntity(this.remoteAddress.getHostName(), this.remoteAddress .getHostAddress(), this.remotePort); this.stack.provider.setNotifiedEntity(notifiedEntity); } }
if (notifiedEntity.getLocalName() != null && notifiedEntity.getLocalName().length()>0) currNode=notifiedEntity.getLocalName().getBytes(); System.arraycopy(currNode, 0, destination, offset, currNode.length); totalLength+=currNode.length; if (notifiedEntity.getDomainName() != null && notifiedEntity.getDomainName().length()>0) currNode=notifiedEntity.getDomainName().getBytes(); System.arraycopy(currNode, 0, destination, offset+totalLength, currNode.length); totalLength+=currNode.length; if (notifiedEntity.getPortNumber() > 0) totalLength+=StringFunctions.encodeInt(destination,offset+totalLength,notifiedEntity.getPortNumber());
/** * Creates a new instance of TransactionHandle. * * Used by stack to prepare transaction for transmitting message from provider to the application. * * @param stack * the reference to the MGCP stack. * @remoteAddress the address from wich command message was received. * @port the number of the port from wich command received. */ public TransactionHandler(JainMgcpStackImpl stack, InetAddress remoteAddress, int port) { this(stack); this.remoteAddress = remoteAddress; this.remotePort = port; if (this.stack.provider.getNotifiedEntity() == null) { NotifiedEntity notifiedEntity = new NotifiedEntity(this.remoteAddress.getHostName(), this.remoteAddress .getHostAddress(), this.remotePort); this.stack.provider.setNotifiedEntity(notifiedEntity); } }
port=2427; return new NotifiedEntity(localName, domainName, port);
port=2427; return new NotifiedEntity(localName, domainName, port);
callAgent = new NotifiedEntity("mscontrol", localHost, localPort);
callAgent = new NotifiedEntity("mscontrol", localHost, localPort);
@Override public synchronized void start() throws RuntimeException { assertState(SHUTDOWN); // Initialize the call agent. callAgent = new NotifiedEntity("restcomm", localIp.getHostAddress(), localPort); // Initialize the media gateway domain name. domainName = new StringBuilder().append(remoteIp.getHostAddress()).append(":") .append(remotePort).toString(); // Start the MGCP stack. try { mgcpStack = new JainMgcpStackImpl(localIp, localPort); mgcpProvider = mgcpStack.createProvider(); mgcpProvider.addJainMgcpListener(this); } catch(final Exception exception) { throw new RuntimeException(exception); } requestListeners = new ArrayList<JainMgcpListener>(); requestListenersLock = new Object(); responseListeners = new HashMap<Integer, JainMgcpListener>(); requestId = new RangeCounter(1, Integer.MAX_VALUE); transactionId = new RangeCounter(1, Integer.MAX_VALUE); mediaSessionId = new RangeCounter(1, Integer.MAX_VALUE); mediaSessions = new HashMap<Integer, MgcpSession>(); setState(RUNNING); }
private void powerOn(final Object message) { final PowerOnMediaGateway request = (PowerOnMediaGateway) message; name = request.getName(); localIp = request.getLocalIp(); localPort = request.getLocalPort(); remoteIp = request.getRemoteIp(); remotePort = request.getRemotePort(); useNat = request.useNat(); externalIp = request.getExternalIp(); timeout = request.getTimeout(); agent = new NotifiedEntity("restcomm", localIp.getHostAddress(), localPort); domain = new StringBuilder().append(remoteIp.getHostAddress()).append(":").append(remotePort).toString(); connectionIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); endpointIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); requestIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); sessionIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); transactionIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); }
private void powerOn (final Object message) { final PowerOnMediaGateway request = (PowerOnMediaGateway) message; name = request.getName(); localIp = request.getLocalIp(); localPort = request.getLocalPort(); remoteIp = request.getRemoteIp(); remotePort = request.getRemotePort(); useNat = request.useNat(); externalIp = request.getExternalIp(); timeout = request.getTimeout(); agent = new NotifiedEntity("restcomm", localIp.getHostAddress(), localPort); domain = new StringBuilder().append(remoteIp.getHostAddress()).append(":").append(remotePort).toString(); connectionIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); endpointIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); requestIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); sessionIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); transactionIdPool = new RevolvingCounter(1, Integer.MAX_VALUE); monitoringService = request.getMonitoringService(); }
private void powerOn(final Object message) { final PowerOnMediaGateway request = (PowerOnMediaGateway) message; name = request.getName(); localIp = request.getLocalIp(); localPort = request.getLocalPort(); remoteIp = request.getRemoteIp(); remotePort = request.getRemotePort(); useNat = request.useNat(); externalIp = request.getExternalIp(); timeout = request.getTimeout(); stack = request.getStack(); provider = request.getProvider(); //stack = new JainMgcpStackImpl(localIp, localPort); try { //provider = stack.createProvider(); provider.addJainMgcpListener(this); } catch (final TooManyListenersException exception) { //} catch (final CreateProviderException exception) { logger.error(exception, "Could not create a JAIN MGCP provider."); } agent = new NotifiedEntity("restcomm", localIp.getHostAddress(), localPort); domain = new StringBuilder().append(remoteIp.getHostAddress()).append(":").append(remotePort).toString(); notificationListeners.clear(); responseListeners.clear(); requestIdPool = new RevolvingCounter(1, Long.MAX_VALUE); sessionIdPool = new RevolvingCounter(1, Long.MAX_VALUE); transactionIdPool = new RevolvingCounter(1, Long.MAX_VALUE); }
notificationRequest.setTransactionHandle(mgcpProvider.getUniqueTransactionHandler()); NotifiedEntity notifiedEntity = new NotifiedEntity(JBOSS_BIND_ADDRESS, JBOSS_BIND_ADDRESS, MGCP_PORT); notificationRequest.setNotifiedEntity(notifiedEntity);
.getUniqueTransactionHandler()); NotifiedEntity notifiedEntity = new NotifiedEntity(JBOSS_BIND_ADDRESS, JBOSS_BIND_ADDRESS, MGCP_PORT); notificationRequest.setNotifiedEntity(notifiedEntity);