setVideoCount wasn't working because all the settings were 0 (which is interpreted further down by setting.isEmpty() as empty so doesn't get applied and calling happens as if you hadn't provided any settings). or set something in callSetting ie callSetting.setAudioCount(1) I haven't looked into anything else as this is enough to get me by in the short term. Will figure out the others when I'm working on the functionality that I need them for.
From: Jonathan Clapson
I am trying to disable video in calls (on a per call basis). At the moment I am receiving an incoming call (from commandline pjsua on a linux machine with video enabled). I have tested everything with both pjsip 2.7 and pjsip 2.9 and am
running code based on the MyApp.java android example. I have tried this with and without using a sip registrar (with no difference in what happens). I am uncertain what I am doing wrong, everything I have tried results in pjsua still sending a port number in the OK SDP, decoding incoming h264 and displaying. Specific Requirements: Ignore incoming video on a per call basis (no decoding, preferably signal other device so it knows video won't be used) Never supply outgoing video (no encoding, preferably signalling recvonly or no video information as appropriate) Needs to happen in the OK response to the initial invite (I can't guarantee other devices will support update/reinvite and even a short burst of pjsip decoding causes major issues with other video decoding processes I am running). How do I achieve this? Info about what I have tried so far is below. ---Code I am trying--- Creating the account: accCfg.setIdUri("sip:localhost"); accCfg.getNatConfig().setIceEnabled(true); accCfg.getVideoConfig().setAutoTransmitOutgoing(false); accCfg.getVideoConfig().setAutoShowIncoming(false); app.addAcc(accCfg); When I answer the incoming call: CallOpParam prm = new CallOpParam(); CallSetting callSetting = new CallSetting(); callSetting.setFlag(0); //don't send disabled media callSetting.setVideoCount(0); prm.setOpt(callSetting); prm.setStatusCode(pjsip_status_code.PJSIP_SC_OK); try { CallVidSetStreamParam param = new CallVidSetStreamParam(); param.setMedIdx(-1); param.setDir(pjmedia_dir.PJMEDIA_DIR_NONE); currentCall.vidSetStream(pjsua_call_vid_strm_op.PJSUA_CALL_VID_STRM_CHANGE_DIR, param); } catch (Exception e) { Log.e("answerCall", "Could not disable video in call: " + e.getMessage(), e); } try { currentCall.answer(prm); } catch (Exception e) { Log.e("Answer call failed", e.getMessage(), e); } ---What happens from this code--- Disabling outgoing: Disabling incoming: setVideoCount doesn't appear to be working, nothing changes whether this is set to 1 or 0 (ie I still see the linux machines camera on android device) Docs seem to suggest vidsetstreamparam is only for re-invite/update, but I thought I would try anyway: CallVidSetStreamParam param = new CallVidSetStreamParam(); param.setMedIdx(-1); param.setDir(pjmedia_dir.PJMEDIA_DIR_NONE); currentCall.vidSetStream(pjsua_call_vid_strm_op.PJSUA_CALL_VID_STRM_CHANGE_DIR, param); Throws an exception: (java exception)Could not disable video in call: Title: pjsua_call_set_vid_strm(id, op, &prm) Code: 120001 Description: Operation not permitted Location: ../src/pjsua2/call.cpp:633 setAutoShowIncoming doesn't appear to be working, whether this is set to true or false, the android device always shows the remote camera Removing the flag to send disabled media also doesn't seem to do anything (varying setAutoTransmitOutgoing and setAutoShowIncoming along with clearing this doesn't cause any change in the sdp). Noting: if I disable video on the linux machine (don't add --video) both the invite (from linux) and ok (from android) have port number set to 0. |
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org