Package net.solosky.maplefetion.sipc

Examples of net.solosky.maplefetion.sipc.SipcRequest.addHeader()


        String passHex = PasswordEncrypterV4.encryptV4(this.user.getUserId(),this.user.getPassword());
        AuthGeneratorV4 auth = new AuthGeneratorV4();
        String aeskey = ConvertHelper.byte2HexStringWithoutSpace(user.getAesKey());
          String response = auth.generate(mc.group(2), passHex, mc.group(1), aeskey);
          String authString ="Digest response=\""+response+"\",algorithm=\"SHA1-sess-v4\"";
          req.addHeader(SipcHeader.AUTHORIZATION, authString);
          req.addHeader("AK", "ak-value");
         
          String body = MessageTemplate.TMPL_USER_AUTH;
          body = body.replace("{machineCode}", FetionConfig.getString("fetion.sip.machine-code"));
          body = body.replace("{sid}", Integer.toString(this.user.getFetionId()));
View Full Code Here


        AuthGeneratorV4 auth = new AuthGeneratorV4();
        String aeskey = ConvertHelper.byte2HexStringWithoutSpace(user.getAesKey());
          String response = auth.generate(mc.group(2), passHex, mc.group(1), aeskey);
          String authString ="Digest response=\""+response+"\",algorithm=\"SHA1-sess-v4\"";
          req.addHeader(SipcHeader.AUTHORIZATION, authString);
          req.addHeader("AK", "ak-value");
         
          String body = MessageTemplate.TMPL_USER_AUTH;
          body = body.replace("{machineCode}", FetionConfig.getString("fetion.sip.machine-code"));
          body = body.replace("{sid}", Integer.toString(this.user.getFetionId()));
          body = body.replace("{userId}", Integer.toString(this.user.getUserId()));
View Full Code Here

     * @return
     */
    public SipcRequest createGetPersonalInfoRequest()
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
      req.addHeader(SipcHeader.EVENT, "GetPersonalInfo");
      req.setBody(new SipcBody(MessageTemplate.TMPL_GET_PERSONAL_INFO));
     
      return req;
    }
   
View Full Code Here

     */
    public SipcRequest createSendChatMessageRequest(String toUri, Message m)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.MESSAGE);
     
      req.addHeader(SipcHeader.TO, toUri);
      req.addHeader(SipcHeader.CONTENT_TYPE, m.getType());
      req.addHeader(SipcHeader.EVENT, "CatMsg");
     
      req.setBody(new SipcBody(m.getContent()));
     
View Full Code Here

    public SipcRequest createSendChatMessageRequest(String toUri, Message m)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.MESSAGE);
     
      req.addHeader(SipcHeader.TO, toUri);
      req.addHeader(SipcHeader.CONTENT_TYPE, m.getType());
      req.addHeader(SipcHeader.EVENT, "CatMsg");
     
      req.setBody(new SipcBody(m.getContent()));
     
      return req;
View Full Code Here

    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.MESSAGE);
     
      req.addHeader(SipcHeader.TO, toUri);
      req.addHeader(SipcHeader.CONTENT_TYPE, m.getType());
      req.addHeader(SipcHeader.EVENT, "CatMsg");
     
      req.setBody(new SipcBody(m.getContent()));
     
      return req;
    }
View Full Code Here

     */
    public SipcRequest createSendSMSRequest(String uri, Message m)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.MESSAGE);
     
      req.addHeader(SipcHeader.TO, uri);
      req.addHeader(SipcHeader.EVENT, "SendCatSMS");
     
      req.setBody(new SipcBody(m.getContent()));
     
      return req;
View Full Code Here

    public SipcRequest createSendSMSRequest(String uri, Message m)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.MESSAGE);
     
      req.addHeader(SipcHeader.TO, uri);
      req.addHeader(SipcHeader.EVENT, "SendCatSMS");
     
      req.setBody(new SipcBody(m.getContent()));
     
      return req;
    }
View Full Code Here

     * @return
     */
    public SipcRequest createKeepConnectionRequest()
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.OPTION);
      req.addHeader(SipcHeader.EVENT, "KeepConnectionBusy");
      return req;
    }
   
    /**
     * 保持在线的请求
 
View Full Code Here

     * @return
     */
    public SipcRequest createKeepAliveRequest()
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.REGISTER);
      req.addHeader(SipcHeader.EVENT, "KeepAlive");
      req.setBody(new SipcBody(MessageTemplate.TMPL_KEEP_ALIVE));
      return req;
    }
   
    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.