`

SIP电话设计思路

    博客分类:
  • SIP
 
阅读更多
1. caller调用方法Call createCall(String callee),过程如下:
    1)把String callee转换为javax.sip.Address;
    2)创建请求,Request invite = protocolProvider.getMessageFactory    ().createRequest(
                toHeader.getAddress().getURI()
                , Request.INVITE
                , callIdHeader
                , cSeqHeader
                , fromHeader
                , toHeader
                , viaHeaders
                , maxForwards);
   3)创建sdp的ContentTypeHeader,contentTypeHeader=headerFactory.createContentTypeHeader(
                    "application", "sdp");
   4)创建客户端事务ClientTransaction,clientTransaction=sipProvider.getNewClientTransaction(invite);
   5)create the call,and creates a new call participant with participantAddress,
CallParticipantSipImpl callParticipant = new CallParticipantSipImpl(
            containingTransaction.getDialog().getRemoteParty(), call)
,设置callParticipant状态为INITIATING_CALL,添加该新创建的Call;
   6)创建双方具体的多媒体会话约定,设置请求消息的内容为该多媒体数据,然后发送出去。
    invite.setContent(callSession.createSdpOffe (intendedDestination),    contentTypeHeader);
2. callee端process inviteRequest,过程如下:
   1)creates a new call participant,设置participant的sdp描述,
   CallParticipantSipImpl callParticipant
            = createCallParticipantFor(serverTransaction,    sourceProvider);
   callParticipant.setSdpDescription(
                                        new String(invite.getRawContent()));
  2)判断本地uri是否是远端caller要呼叫的uri
  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics