最近在研究imsdroid源码,但是很坎坷,其中遇到不少问题。
  1. 基于sip协议的消息发送解决,是用messagingSession类中的send方法吗还是另有别的方法?
  2. 我是调用messagingSession类中的send方法,但是为什么android平台的 两个基于sip协议的消息发送没有反应,当一个客户端消息发送成功时,代理服务器返回一个202(Accepted for later delivery)。但是另外一个客户端没有反应
   
  发送消息的核心代码:
  byte[] content = "hello ervery".getBytes();
  final MySipStack sipStack = ServiceManager.getSipService().getStack();
  final MessagingSession session = new MessagingSession(sipStack);
  remoteUri = UriUtils.makeValidSipUri(remoteUri);  session.addHeader("Proxy-Authorization", "Digest realm=sip2sip.info");
  session.setToUri(remoteUri);
  session.addHeader("Content-Type", "text/plain");  final ByteBuffer payload = ByteBuffer.allocateDirect(content.length);
  payload.put(content);
  success = session.send(payload, content.length);