public void setTime(long timeStamp) throws InvalidArgumentException { if (timeStamp < -1) throw new InvalidArgumentException("Illegal timestamp"); this.timeStamp = timeStamp; this.timeStampFloat = -1; }
public MessageFactory createMessageFactory() throws PeerUnavailableException { if (mMessageFactory == null) { mMessageFactory = (MessageFactory) createSipFactory("javax.sip.message.MessageFactoryImpl"); } return mMessageFactory; }
public DialogState getState() { if (this.dialogState == NULL_STATE) return null; // not yet initialized return DialogState.getObject(this.dialogState); }
private void respond(RequestEvent evt, int cause) { Request request = evt.getRequest(); ServerTransaction tx = evt.getServerTransaction(); try { Response response = messageFactory.createResponse(cause, request); tx.sendResponse(response); } catch (Exception e) { logger.warning("Unexpected error: ", e); } }
public SipConfiguration() { sipFactory = SipFactory.getInstance(); sipFactory.setPathName(IMPLEMENTATION); }
public void sendCallerAck(ResponseEvent event) { try { Dialog dialog = sipUtils.getDialog(event); Request ackRequest = sipUtils.buildAck(dialog, null); dialog.sendAck(ackRequest); } catch (SipException e) { e.printStackTrace(); } }
public synchronized static SipFactory getInstance() { if (_instance == null) { _instance = new SipFactory(); } return _instance; }
private String makeClassName(String c) { return getPathName() + "." + c; }
private void sendResponse(RequestEvent event, int responseCode) throws SipException, InvalidArgumentException, ParseException { event.getServerTransaction().sendResponse( sipProvider.getMessageFactory().createResponse(responseCode, event.getRequest())); }
public void setTimeStamp(float timeStamp) throws InvalidArgumentException { if (timeStamp < 0) throw new InvalidArgumentException( "JAIN-SIP Exception, TimeStamp, " + "setTimeStamp(), the timeStamp parameter is <0"); this.timeStamp = -1; this.timeStampFloat = timeStamp; }
public HeaderFactory createHeaderFactory() throws PeerUnavailableException { if (mHeaderFactory == null) { mHeaderFactory = (HeaderFactory) createSipFactory("javax.sip.header.HeaderFactoryImpl"); } return mHeaderFactory; }
public void setTimeDelay(int delay) throws InvalidArgumentException { if (delay < -1) throw new InvalidArgumentException("Value out of range " + delay); this.delay = delay; this.delayFloat = -1; }
public AddressFactory createAddressFactory() throws PeerUnavailableException { if (mAddressFactory == null) { mAddressFactory = (AddressFactory) createSipFactory("javax.sip.address.AddressFactoryImpl"); } return mAddressFactory; }
public void setRSequenceNumber(long rSeqNumber) throws InvalidArgumentException { if (rSeqNumber <= 0 || cSeqNumber > ((long) 1) << 32 - 1) throw new InvalidArgumentException("Bad rSeq # " + rSeqNumber); this.rSeqNumber = rSeqNumber; } }
public void setCSequenceNumber(long cSeqNumber) throws InvalidArgumentException { if (cSeqNumber <= 0 || cSeqNumber > ((long) 1) << 32 - 1) throw new InvalidArgumentException("Bad CSeq # " + cSeqNumber); this.cSeqNumber = cSeqNumber; }
public void setSeqNumber(long sequenceNumber) throws InvalidArgumentException { if (sequenceNumber <= 0 ||sequenceNumber > ((long)1)<<32 - 1) throw new InvalidArgumentException( "Bad seq number " + sequenceNumber); this.sequenceNumber = sequenceNumber; }
/** * Set the maxForwards member * @param maxForwards maxForwards parameter to set */ public void setMaxForwards(int maxForwards) throws InvalidArgumentException { if (maxForwards < 0 || maxForwards > 255) throw new InvalidArgumentException( "bad max forwards value " + maxForwards); this.maxForwards = maxForwards; }
/** * Sets code of WarningHeader * @param code int to set * @throws SipParseException if code is not accepted by implementation */ public void setCode(int code) throws InvalidArgumentException { if (code >99 && code < 1000) { // check this is a 3DIGIT code this.code = code; } else throw new InvalidArgumentException( "Code parameter in the Warning header is invalid: code=" + code); }
/** * Sets the retry after value of the SubscriptionStateHeader. The retry after value * MUST be greater than zero and MUST be less than 2**31. * * @param retryAfter - the new retry after value of this SubscriptionStateHeader * @throws InvalidArgumentException if supplied value is less than zero. */ public void setRetryAfter(int retryAfter) throws InvalidArgumentException { if (retryAfter <= 0) throw new InvalidArgumentException( "JAIN-SIP " + "Exception, SubscriptionState, setRetryAfter(), the retryAfter parameter is <=0"); this.retryAfter = retryAfter; }
/** * Sets the relative expires value of the SubscriptionStateHeader. The * expires value MUST be greater than zero and MUST be less than 2**31. * * @param expires - the new expires value of this SubscriptionStateHeader. * @throws InvalidArgumentException if supplied value is less than zero. */ public void setExpires(int expires) throws InvalidArgumentException { if (expires < 0) throw new InvalidArgumentException( "JAIN-SIP " + "Exception, SubscriptionState, setExpires(), the expires parameter is < 0"); this.expires = expires; }