/** * Receive notification of the parameter of a message. Parser will call * this method to report about parameter reading. * * @param name * the name of the parameter * @param value * the value of the parameter. */ public void param(String name, String value) throws ParseException { if (name.equalsIgnoreCase("I")) { connectionIdentifier = new ConnectionIdentifier(value); } else if (name.equalsIgnoreCase("F")) { int RCindex = value.indexOf("RC"); int LCindex = value.indexOf("LC"); if (RCindex != -1 && RCindex < LCindex) { RCfirst = true; } requestedInfo = utils.decodeInfoCodeList(value); } else { logger.error("Unknown code while encoding AUCX Command name = " + name + " value = " + value); } }
/** * Receive notification of the header of a message. Parser will call * this method to report about header reading. * * @param header * the header from the message. */ public void header(String header) throws ParseException { command = new ModifyConnection(source != null ? source : stack, new CallIdentifier("00"), endpoint, new ConnectionIdentifier("00")); command.setTransactionHandle(remoteTID); }
/** * Receive notification of the header of a message. Parser will call * this method to report about header reading. * * @param header * the header from the message. */ public void header(String header) throws ParseException { String[] tokens = utils.splitStringBySpace(header); int tid = Integer.parseInt(tokens[1]); response = new CreateConnectionResponse(source != null ? source : stack, utils.decodeReturnCode(Integer .parseInt(tokens[0])), new ConnectionIdentifier("00")); response.setTransactionHandle(tid); }
public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new CreateConnectionResponse(source != null ? source : stack, returnCode, new ConnectionIdentifier("00")); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Decode of CRCX Response failed ", e); } return response; }
public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new CreateConnectionResponse(source != null ? source : stack, returnCode, new ConnectionIdentifier("00")); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Decode of CRCX Response failed ", e); } return response; }
@Override public JainMgcpResponseEvent getProvisionalResponse() { CreateConnectionResponse provisionalResponse = null; if (!sent) { // TODO We are hardcoding connectionIdentifier here. This would // differ from final response. Problem? ConnectionIdentifier connectionIdentifier = new ConnectionIdentifier("1"); provisionalResponse = new CreateConnectionResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed, connectionIdentifier); provisionalResponse.setTransactionHandle(remoteTID); } return provisionalResponse; }
@Override public JainMgcpResponseEvent getProvisionalResponse() { CreateConnectionResponse provisionalResponse = null; if (!sent) { ConnectionIdentifier connectionIdentifier = new ConnectionIdentifier("1"); provisionalResponse = new CreateConnectionResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed, connectionIdentifier); provisionalResponse.setTransactionHandle(remoteTID); } return provisionalResponse; } }
@Override public JainMgcpResponseEvent getProvisionalResponse() { CreateConnectionResponse provisionalResponse = null; if (!sent) { ConnectionIdentifier connectionIdentifier = new ConnectionIdentifier("1"); provisionalResponse = new CreateConnectionResponse(source != null ? source : stack,ReturnCode.Transaction_Being_Executed, connectionIdentifier); provisionalResponse.setTransactionHandle(remoteTID); } return provisionalResponse; } }
/** * 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("I")) { response.setConnectionIdentifier(new ConnectionIdentifier(value)); } else if (name.equalsIgnoreCase("I2")) { response.setSecondConnectionIdentifier(new ConnectionIdentifier(value)); } else if (name.equalsIgnoreCase("Z")) { response.setSpecificEndpointIdentifier(utils.decodeEndpointIdentifier(value)); } else if (name.equalsIgnoreCase("Z2")) { response.setSecondEndpointIdentifier(utils.decodeEndpointIdentifier(value)); } }
connectionIdentifier = ConnectionIdentifier.AllConnections; } else { connectionIdentifier = new ConnectionIdentifier(cid); (decdEventName.get(1)).substring(0, pos)).withParm(param), new ConnectionIdentifier(cid)); } else { throw new ParseException("Unexpected event name " + value, 0);
public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new ModifyConnection(source != null ? source : stack, new CallIdentifier("00"), endpoint,new ConnectionIdentifier("00")); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (IOException e) { logger.error("Decoding of MDCX command failed", e); } NotifiedEntity notifiedEntity = command.getNotifiedEntity(); if (command.getNotifiedEntity() != null) this.stack.provider.setNotifiedEntity(notifiedEntity); return command; }
ConnectionIdentifier connId = new ConnectionIdentifier(buffer.toString()); final ReturnCode code = ReturnCode.Transaction_Executed_Normally; final CreateConnectionResponse response = new CreateConnectionResponse(self, code, connId); buffer = new StringBuilder(); buffer.append(connectionIdPool.get()); connId = new ConnectionIdentifier(buffer.toString()); response.setSecondConnectionIdentifier(connId); endpointName = secondaryEndpointId.getLocalEndpointName();
public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new ModifyConnection(source != null ? source : stack, new CallIdentifier("00"), endpoint,new ConnectionIdentifier("00")); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (IOException e) { logger.error("Decoding of MDCX command failed", e); } NotifiedEntity notifiedEntity = command.getNotifiedEntity(); if (command.getNotifiedEntity() != null) this.stack.provider.setNotifiedEntity(notifiedEntity); return command; }
connectionIdentifier = new ConnectionIdentifier(new String(data,value.getOffset(),value.getLength())); break; case StringFunctions.LOW_F_BYTE:
connectionIdentifier = new ConnectionIdentifier(new String(data,value.getOffset(),value.getLength())); break; case StringFunctions.LOW_F_BYTE:
/** * 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.setCallIdentifier(new CallIdentifier(value)); } else if (name.equalsIgnoreCase("I")) { command.setConnectionIdentifier(new ConnectionIdentifier(value)); } else if (name.equalsIgnoreCase("m")) { command.setMode(utils.decodeConnectionMode(value));
response.setConnectionIdentifier(new ConnectionIdentifier(new String(data,value.getOffset(),value.getLength()))); break; case StringFunctions.LOW_Z_BYTE: case StringFunctions.HIGH_I_BYTE: if(data[name.getOffset()+1]==StringFunctions.TWO_BYTE) response.setSecondConnectionIdentifier(new ConnectionIdentifier(new String(data,value.getOffset(),value.getLength()))); break; case StringFunctions.LOW_Z_BYTE:
@Override protected void createConnection (final Object message, final ActorRef sender) { final jain.protocol.ip.mgcp.message.CreateConnection crcx = (jain.protocol.ip.mgcp.message.CreateConnection) message; if(logger.isInfoEnabled()) logger.info("createConnection: " +crcx.toString()); // check if its a conference and call link request if(crcx.getSecondEndpointIdentifier() != null && crcx.getSecondEndpointIdentifier().getLocalEndpointName() != null && crcx.getSecondEndpointIdentifier().getLocalEndpointName().contains("cnf")){ // if yes then fail this connection request if(logger.isInfoEnabled()) logger.info("got conference and call link request, will fail it! with error code Endpoint_Unknown"); StringBuilder buffer = new StringBuilder(); buffer.append(connectionIdPool.get()); ConnectionIdentifier connId = new ConnectionIdentifier(buffer.toString()); sender.tell(new CreateConnectionResponse(self(), ReturnCode.Endpoint_Unknown, connId), self()); }else { // if not then let daddy proceed with existing mocked mechanism. super.createConnection(message, sender); } } }
response.setConnectionIdentifier(new ConnectionIdentifier(new String(data,value.getOffset(),value.getLength()))); break; case StringFunctions.LOW_Z_BYTE: case StringFunctions.HIGH_I_BYTE: if(data[name.getOffset()+1]==StringFunctions.TWO_BYTE) response.setSecondConnectionIdentifier(new ConnectionIdentifier(new String(data,value.getOffset(),value.getLength()))); break; case StringFunctions.LOW_Z_BYTE: