public RequestIdentifier getUniqueRequestIdentifier() { return new RequestIdentifier(Long.toHexString((long)requestIdentifierCounter.incrementAndGet()-(long)Integer.MIN_VALUE)); }
public RequestIdentifier getUniqueRequestIdentifier() { return new RequestIdentifier(Long.toHexString((long)requestIdentifierCounter.incrementAndGet()-(long)Integer.MIN_VALUE)); }
public RequestIdentifier getUniqueRequestIdentifier() { long current = -1; boolean b = true; while (b) { current = requestIdentifierCounter.get(); if (current == Long.MAX_VALUE) { b = !requestIdentifierCounter.compareAndSet(current, 1); } else { b = !requestIdentifierCounter.compareAndSet(current, current + 1); } } return new RequestIdentifier(Long.toHexString(current)); }
public void header(String header) throws ParseException { command = new NotificationRequest(source != null ? source : stack, endpoint, new RequestIdentifier("0")); command.setTransactionHandle(remoteTID); }
/** * Generates unique request identifier. * * @return request identifier object. */ public RequestIdentifier nextRequestID() { return new RequestIdentifier(Integer.toString(session.getUniqueReqID())); }
/** * Generates unique request identifier. * * @return request identifier object. */ public RequestIdentifier nextRequestID() { return new RequestIdentifier(Integer.toString(session.getUniqueReqID())); }
public void header(String header) throws ParseException { command = new Notify(source != null ? source : stack, endpoint, new RequestIdentifier("0"), new EventName[] {}); command.setTransactionHandle(remoteTID); }
public RequestIdentifier generateRequestIdentifier() { assertState(RUNNING); return new RequestIdentifier(Integer.toString((int)requestId.getAndIncrement())); }
@Override public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new Notify(source != null ? source : stack, endpoint, new RequestIdentifier("0"), new EventName[] {}); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (Exception e) { throw new ParseException(e.getMessage(), -1); } return command; }
@Override public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new Notify(source != null ? source : stack, endpoint, new RequestIdentifier("0"), new EventName[] {}); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (Exception e) { throw new ParseException(e.getMessage(), -1); } return command; }
public void param(String name, String value) throws ParseException { if (name.equalsIgnoreCase("N")) { command.setNotifiedEntity(utils.decodeNotifiedEntity(value, false)); } else if (name.equalsIgnoreCase("X")) { command.setRequestIdentifier(new RequestIdentifier(value)); } else if (name.equalsIgnoreCase("O")) { command.setObservedEvents(utils.decodeEventNames(value)); } }
@Override public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new NotificationRequest(source != null ? source : stack, endpoint, new RequestIdentifier("0")); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (Exception e) { e.printStackTrace(); throw new ParseException(e.getMessage(), -1); } NotifiedEntity notifiedEntity = command.getNotifiedEntity(); if (command.getNotifiedEntity() != null) this.stack.provider.setNotifiedEntity(notifiedEntity); return command; }
@Override public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new NotificationRequest(source != null ? source : stack, endpoint, new RequestIdentifier("0")); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (Exception e) { e.printStackTrace(); throw new ParseException(e.getMessage(), -1); } NotifiedEntity notifiedEntity = command.getNotifiedEntity(); if (command.getNotifiedEntity() != null) this.stack.provider.setNotifiedEntity(notifiedEntity); return command; }
public void param(String name, String value) throws ParseException { if (name.equalsIgnoreCase("N")) { command.setNotifiedEntity(utils.decodeNotifiedEntity(value, true)); } else if (name.equalsIgnoreCase("X")) { command.setRequestIdentifier(new RequestIdentifier(value)); } else if (name.equalsIgnoreCase("R")) { command.setRequestedEvents(utils.decodeRequestedEventList(value)); } else if (name.equalsIgnoreCase("S")) { command.setSignalRequests(utils.decodeEventNames(value)); } else if (name.equalsIgnoreCase("T")) { command.setDetectEvents(utils.decodeEventNames(value)); } else if (name.equalsIgnoreCase("D")) { command.setDigitMap(new DigitMap(value)); } }
/** * Receive notification of the parameter of a message. Parser will call * this method to report about parameter reading. * * @param name * the name of the paremeter * @param value * the value of the parameter. */ public void param(String name, String value) throws ParseException { if (name.equalsIgnoreCase("B")) { command.setBearerInformation(utils.decodeBearerInformation(value)); } else if (name.equalsIgnoreCase("c")) { command.setCallIdentifier(new CallIdentifier(value)); } else if (name.equalsIgnoreCase("I")) { command.setConnectionIdentifier(new ConnectionIdentifier(value)); } else if (name.equalsIgnoreCase("X")) { command.setNotificationRequestParms(new NotificationRequestParms(new RequestIdentifier(value))); } else if (name.equalsIgnoreCase("R")) { command.getNotificationRequestParms().setRequestedEvents(utils.decodeRequestedEventList(value)); } else if (name.equalsIgnoreCase("S")) { command.getNotificationRequestParms().setSignalRequests(utils.decodeEventNames(value)); } else if (name.equalsIgnoreCase("T")) { command.getNotificationRequestParms().setDetectEvents(utils.decodeEventNames(value)); } else if (name.equalsIgnoreCase("P")) { command.setConnectionParms(utils.decodeConnectionParms(value)); } else if (name.equalsIgnoreCase("E")) { command.setReasonCode(utils.decodeReasonCode(value)); } }
command.setNotifiedEntity(utils.decodeNotifiedEntity(value, true)); } else if (name.equalsIgnoreCase("X")) { command.setNotificationRequestParms(new NotificationRequestParms(new RequestIdentifier(value))); } else if (name.equalsIgnoreCase("R")) { command.getNotificationRequestParms().setRequestedEvents(utils.decodeRequestedEventList(value));
public void param(byte[] data,SplitDetails name,SplitDetails value) throws ParseException { if(name.getLength()==1) { switch(data[name.getOffset()]) { case StringFunctions.LOW_N_BYTE: case StringFunctions.HIGH_N_BYTE: command.setNotifiedEntity(NotifiedEntityHandler.decode(data,value.getOffset(),value.getLength(), false)); break; case StringFunctions.LOW_X_BYTE: case StringFunctions.HIGH_X_BYTE: command.setRequestIdentifier(new RequestIdentifier(new String(data,value.getOffset(),value.getLength()))); break; case StringFunctions.LOW_O_BYTE: case StringFunctions.HIGH_O_BYTE: command.setObservedEvents(EventNameHandler.decodeList(data,value.getOffset(),value.getLength())); break; default: logger.warn("Unidentified NTFY Request parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); break; } } else logger.warn("Unidentified NTFY Request parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); }
private void sendRequest(EventName reqSignal, RequestedEvent[] reqEvents) { final EventName[] signal = new EventName[1]; signal[0] = reqSignal; final RequestIdentifier requestId = new RequestIdentifier(DEFAULT_REQUEST_ID); final NotificationRequest request = new NotificationRequest(self(), id, requestId); request.setNotifiedEntity(agent); request.setRequestedEvents(reqEvents); request.setSignalRequests(signal); gateway.tell(request, self()); }
public void param(byte[] data,SplitDetails name,SplitDetails value) throws ParseException { if(name.getLength()==1) { switch(data[name.getOffset()]) { case StringFunctions.LOW_N_BYTE: case StringFunctions.HIGH_N_BYTE: command.setNotifiedEntity(NotifiedEntityHandler.decode(data,value.getOffset(),value.getLength(), false)); break; case StringFunctions.LOW_X_BYTE: case StringFunctions.HIGH_X_BYTE: command.setRequestIdentifier(new RequestIdentifier(new String(data,value.getOffset(),value.getLength()))); break; case StringFunctions.LOW_O_BYTE: case StringFunctions.HIGH_O_BYTE: command.setObservedEvents(EventNameHandler.decodeList(data,value.getOffset(),value.getLength())); break; default: logger.warn("Unidentified NTFY Request parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); break; } } else logger.warn("Unidentified NTFY Request parameter " + new String(data,name.getOffset(),name.getLength()) + " with value = " + new String(data,value.getOffset(),value.getLength())); }
private void stop(Object message) { final EventName[] signal = new EventName[1]; StopEndpoint se = (StopEndpoint) message; String parameters = ""; if (se.getEvent() != null) { parameters = "sg=" + se.getEvent().getName(); } else { if (logger.isDebugEnabled()) { logger.debug("StopEndpoint event is null"); } } signal[0] = new EventName(PACKAGE_NAME, AUMgcpEvent.aues.withParm(parameters)); final RequestIdentifier requestId = new RequestIdentifier(DEFAULT_REQUEST_ID); final NotificationRequest request = new NotificationRequest(self(), id, requestId); request.setSignalRequests(signal); request.setNotifiedEntity(agent); //Ask RMS to notify for PlayRecording and PlayAnnouncement Signal. //This way IVR endpoint state at RMS side, will be ready for any subsequent request if (se.getEvent().getName().equalsIgnoreCase("pr") || se.getEvent().getName().equalsIgnoreCase("pa") ) { request.setRequestedEvents(REQUESTED_EVENTS); } gateway.tell(request, self()); }