how can i make pjsua as recvonly vid ua

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This is a way to force recvonly mode, by setting up a handler for 
on_call_sdp_created:

     // set up handler
     app_config.cfg.cb.on_call_sdp_created = &on_call_sdp_created;

static void on_call_sdp_created(pjsua_call_id call_id,
                     pjmedia_sdp_session *sdp,
                     pj_pool_t *pool,
                     const pjmedia_sdp_session *rem_sdp)
{
     pj_status_t status;
     pjmedia_sdp_attr *attr;
     unsigned count;
     unsigned i;
     PJ_UNUSED_ARG(call_id);
     // only add recvonly when first offering
     if (rem_sdp == NULL) {
         // remove sendrecv from media attributes
         for (i = 0; i < sdp->media_count; i++) {
pjmedia_sdp_media_remove_all_attr(sdp->media[i], "sendrecv");
             attr =  pjmedia_sdp_attr_create(pool, "recvonly", NULL);
             status = pjmedia_sdp_media_add_attr(sdp->media[i], attr);
             if (status != PJ_SUCCESS) {
                 PJ_LOG(3, (THIS_FILE, "error %d adding attribute to SDP 
media", status));
             }
         }
     }
}

Regards,

Bill

On 11/10/2015 10:23 PM, zhuyongwen at made-in-china.com wrote:
> Hi all,
>     i video call , when one ua-a doens't got any camer , the other 
> side(ua-b) will show a picutre like below :
>
>
> so i try to make the ua-b as one video recvonly ,
>
> in my ua-b my code like this  :
> on_pjsip_media_state(pjsua_call_id cid ) {
> *******
>
> if(type==VIDEO)
> {
>     pjsua_call_vid_strm_op_param param;
>     pjsua_call_vid_strm_param_default(&param);
>     param.dir = PJMEDIA_DIR_DECODEING;
> pjsua_call_set_vid_strm(cid,PJSUA_CALL_VID_STREM_CHANGE_DIR, &param);
> }
> **********
> }
>
> but it doen't work , the sdp will still sendrecv;
>
>
> v=0
> o=- 3656229426 3656229428 IN IP4 221.226.184.166
> s=pjmedia
> b=AS:621
> t=0 0
> a=X-nat:0
> m=audio 54641 RTP/AVP 98 96
> c=IN IP4 221.226.184.166
> b=TIAS:64000
> a=sendrecv
> a=rtpmap:98 speex/16000
> a=rtpmap:96 telephone-event/8000
> a=fmtp:96 0-16
> a=ice-ufrag:6e5d1ad4
> a=ice-pwd:63cb6bfc
> a=rtcp:61445 IN IP4 192.168.17.153
> a=candidate:Rdde2b8a6 1 UDP 16777215 221.226.184.166 54641 typ relay raddr 192.168.28.106 rport 10383
> a=candidate:Rc0a81199 2 UDP 16777214 192.168.17.153 61445 typ relay raddr 192.168.28.106 rport 10384
> m=video 63261 RTP/AVP 97
> c=IN IP4 221.226.184.166
> b=TIAS:512000
> a=sendrecv
> a=rtpmap:97 H264/90000
> a=fmtp:97 profile-level-id=42e01e; packetization-mode=1
> a=ice-ufrag:2213260d
> a=ice-pwd:6b89030a
> a=rtcp:53440 IN IP4 221.226.184.166
> a=candidate:Rdde2b8a6 1 UDP 16777215 221.226.184.166 63261 typ relay raddr 192.168.28.106 rport 10385
> a=candidate:Rdde2b8a6 2 UDP 16777214 221.226.184.166 53440 typ relay raddr 192.168.28.106 rport 10386
>
>
>
> so how can i make ua-b just recv the vid stream?  thx a lot..
>
>
> ------------------------------------------------------------------------
> Best regards.
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20151111/5d55c006/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 7820 bytes
Desc: not available
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20151111/5d55c006/attachment.jpe>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux