Re: Preventing video on per call basis during initial invite

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

 



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).

To make this work either:
use the second constructor when making the call settings ie CallSetting callSetting = new CallSetting(true); (populates default values)

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
Sent: Wednesday, 26 June 2019 2:23 p.m.
To: 'pjsip@xxxxxxxxxxxxxxx' <pjsip@xxxxxxxxxxxxxxx>
Subject: Preventing video on per call basis during initial invite

 

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:
AccountConfig accCfg = new AccountConfig();

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:
I think setAutoTransmitOutgoing(false) is working (no rtp packets are sent), but doesn't signal the sdp information I want.

 

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:
pjsua_vid.c !.Unable to modify video because another media operation is in progress
call.cpp  pjsua_call_set_vid_strm(id, op, &prm) error: Invalid operation (PJ_EINVALIDOP) (status=70013) [../src/pjsua2/call.cpp:633]

(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

[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