eXosip和osip詳解


文檔

可以查看exosip osip的在線文檔

http://www.antisip.com/doc/

在線文檔 一般先看mainpage 會有庫的一個整體說明。

其次看看 modules 會有一些使用說明。

exosip是對osip的封裝 使用osip簡單好用。 osip主要包括sip sdp 協議的解析  fmt 無限狀態機 實現sip協議的會話狀態(這個沒有太深入理解) 其次還包括了對不同平台的線程 鎖信號的封裝實現跨平台。

 

osip 源代碼框架詳解

https://wenku.baidu.com/view/49462441be1e650e52ea9940.html?sxts=1557060265157
https://wenku.baidu.com/view/7cc81930b90d6c85ec3ac6de.html?rec_flag=default
https://wenku.baidu.com/view/f7988a6b011ca300a6c390ab.html
* osip 開發手冊
https://wenku.baidu.com/view/fe5ccbebe009581b6bd9eb18.html?sxts=1557122790420
* osip 狀態機的解釋(ICT IST NICT NIST)
https://blog.csdn.net/candy1232009/article/details/3926868

https://blog.csdn.net/lbc2100/article/details/48342889

 

osip  sdp 的操作

void sdpTest() {
    char *sdpStr = "v=0\r\n"
    "o=- 3761910912 3761910915 IN IP4 47.112.105.194\r\n"
    "s=butelmedia\r\n"
    "t=0 0\r\n"
    "m=audio 5061 RTP/AVP 98 97 99 0 8\r\n"
    "c=IN IP4 61.149.194.174\r\n"
    "a=sendrecv\r\n"
    "a=rtpmap:98 speex/16000\r\n"
    "a=rtpmap:97 speex/8000\r\n"
    "a=rtpmap:99 speex/32000\r\n"
    "a=rtpmap:0 PCMU/8000\r\n"
    "a=rtpmap:8 PCMA/8000\r\n"
    "a=ssrc:2066561799 cname:30000025\r\n"
    "a=mid:audio-1\r\n"
    "a=rtcp-mux\r\n"
    "a=audiodesc:mic_audio\r\n"
    "m=video 5061 RTP/AVP 97\r\n"
    "c=IN IP4 61.149.194.174\r\n"
    "a=sendrecv\r\n"
    "a=rtpmap:97 H264/90000\r\n"
    "a=fmtp:97 profile-level-id=42e01e; packetization-mode=1\r\n"
    "a=ssrc:931412768 cname:30000025\r\n"
    "a=mid:video-1\r\n"
    "a=rtcp-mux\r\n"
    "a=videodesc:camera\r\n"
    ;
    int ret = 0;
    sdp_message_t *sdp = NULL;
    char *pChar = NULL;

    ret = sdp_message_init (&sdp);
    if(0!=ret) {
        printf("sdp_message_init error %d \n",ret);
        return;
    }
    ret = sdp_message_parse (sdp, sdpStr);
    if(0!=ret) {
        printf("parse error %d \n",ret);
        return;
    }
    pChar = sdp_message_a_att_field_get(sdp,0,0);
    if (pChar) printf("%s \n",pChar);

    int size = strlen("sendonly");
    char * send = (char *)osip_malloc(size);
    memcpy(send,"sendonly",size);
    ret = sdp_message_a_attribute_add (sdp, 0, send, NULL);
    printf("sdp_message_a_attribute_add %d \n",ret);
    ret = sdp_message_a_attribute_del (sdp, 0, "sendrecv");
    printf("sdp_message_a_attribute_del %d \n",ret);

    ret = sdp_message_to_str(sdp,&pChar);
    if(0!=ret) {
        printf("sdp_message_to_str  %d \n",ret);
        return;
    }
    printf("sdp_message_to_str: %s \n",pChar);
    osip_free(pChar);

    sdp_message_free(sdp);

}

  備注: 添加到sdp_message_t 的信息  需要動態分配的信息  因為 sdp_message_free 會釋放 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM