ticket = this.inviteNotify.getHeader(SipcHeader.AUTHORIZATION).getValue();
}else {
//如果不是,用户主动发起会话请求,需要向服务器获取进入凭证
ticket = this.context.getDialogFactory().getServerDialog().startChat();
}
TicketHelper helper = new TicketHelper(ticket);
//然后连接聊天服务器,建立处理链
Transfer transfer = this.buildTransfer(helper.getPortList());
if(transfer==null) throw new TransferException("Cannot connect to chat server.");
this.buildProcessorChain(transfer);
//发送注册信息
this.register(helper.getCredential());
//如果是主动邀请,邀请好友进入对话框
if(!this.isBeenInvited())
this.invite();