Package net.solosky.maplefetion.sipc

Examples of net.solosky.maplefetion.sipc.SipcReceipt


     * @throws IOException
     */
    private void buddyMessageRecived(SipcNotify notify) throws FetionException
    {
      //发送信息收到回复
      SipcReceipt receipt = this.dialog.getMessageFactory()
      .createDefaultReceipt(notify.getFrom(), Integer.toString(notify.getCallID()), notify.getSequence());
      this.dialog.process(receipt);
     
      //查找消息是哪个好友发送的
        FetionStore store = this.context.getFetionStore();
View Full Code Here


     * 群消息
     */
    private void groupMessageReceived(SipcNotify notify) throws FetionException
    {
      //发送信息收到回复
      SipcReceipt receipt = this.dialog.getMessageFactory()
      .createDefaultReceipt(notify.getFrom(), Integer.toString(notify.getCallID()), notify.getSequence());
      this.dialog.process(receipt);
     
      Group  group  = this.context.getFetionStore().getGroup(notify.getFrom());
     
View Full Code Here

     * @see net.solosky.maplefetion.protocol.ISIPNotifyHandler#handle(net.solosky.maplefetion.sip.SIPNotify)
     */
    @Override
    public void handle(SipcNotify notify) throws FetionException
    {
      SipcReceipt receipt = this.dialog.getMessageFactory()
        .createDefaultReceipt(notify.getFrom(),
            Integer.toString(notify.getCallID()), notify.getSequence());
      this.dialog.process(receipt);
    }
View Full Code Here

    @Override
    public void handle(final SipcNotify notify) throws FetionException
    {
      logger.debug("Recived a invite - from = "+notify.getFrom());
    //发送已收到消息
    SipcReceipt receipt = null;
    if(this.context.getTransferFactory().isMutiConnectionSupported()) {
        receipt = this.dialog.getMessageFactory()
              .createDefaultReceipt(notify.getFrom() ,
                  Integer.toString(notify.getCallID()),
                  notify.getSequence());
View Full Code Here

    /**
     * 默认收据
     */
    public SipcReceipt createDefaultReceipt(String callId, String sequence)
    {
      SipcReceipt receipt = new SipcReceipt(200, "OK");
      receipt.addHeader(SipcHeader.CALLID, callId);
      receipt.addHeader(SipcHeader.SEQUENCE, sequence);
     
      return receipt;
    }
View Full Code Here

    /**
     * 信息收到收据
     */
    public SipcReceipt createDefaultReceipt(String fromUri, String callId,String sequence)
    {
      SipcReceipt receipt = this.createDefaultReceipt(callId, sequence);
      receipt.addHeader(SipcHeader.FROM, fromUri);
     
      return receipt;
    }
View Full Code Here

    }
   
   
    public SipcReceipt createHttpInviteReceipt(String uri, String callId, String sequence, Port local)
    {
      SipcReceipt receipt = this.createDefaultReceipt(callId, sequence);
      receipt.addHeader(SipcHeader.FROM, uri);
      receipt.addHeader(SipcHeader.SUPPORTED,"text/html-fragment");
      receipt.addHeader(SipcHeader.SUPPORTED, "text/plain");
      //receipt.addHeader(SipcHeader.SUPPORTED,"multiparty");
      //receipt.addHeader(SipcHeader.SUPPORTED,"nudge");
      //receipt.addHeader(SipcHeader.SUPPORTED,"share-background");
      //receipt.addHeader(SipcHeader.SUPPORTED,"fetion-show");
     
     
      //正文是一些固定的参数
      StringBuffer buffer = new StringBuffer();
      buffer.append("v=0\r\n");
      buffer.append("o=-0 0 IN "+local.toString()+"\r\n");
      buffer.append("s=session\r\n");
      buffer.append("c=IN IP4 "+local.toString()+"\r\n");
      buffer.append("t=0 0\r\n");
      buffer.append("m=message "+Integer.toString(local.getPort())+" sip "+uri);
     
      receipt.setBody(new SipcBody(buffer.toString()));
     
      return receipt;
    }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.sipc.SipcReceipt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.