Unable to create re-INVITE: Invalid operation (Video dir change fails in my pjsua)

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

 



Hi,
I made an attempt to suppress incoming video stream and related SDL 
rendering in pjsua.
To obtain this I have ported the code of cmd_enable_vid_rx() that I 
found in pjsua_app_cli.c, but it didn't work: I get the following log:

  pjsua_app.c  .....Going to change video stream direction...
  pjsua_vid.c  .....Call 0: set video stream, op=3
  pjsua_vid.c  ......Unable to create re-INVITE: Invalid operation 
(PJ_EINVALIDOP) [status=70013]
  pjsua_app.c  .....Video dir: ENCODING_DECODING


Here is code I've had ported in on_call_state() callback:

static void on_call_state(pjsua_call_id call_id, pjsip_event *e)
{
..............
..............
int vid_idx= pjsua_call_get_vid_stream_idx(call_id);
if(call_info.state==PJSIP_INV_STATE_CONFIRMED)
{
    PJ_LOG(3,(THIS_FILE,
        "Going to change video stream direction..."));
    pjsua_call_vid_strm_op_param vid_strm_param;
    pjsua_stream_info si;
    pjsua_call_vid_strm_op_param_default(&vid_strm_param);
    vid_strm_param.med_idx = vid_idx;
    if (pjsua_call_get_stream_info(call_id,
          vid_strm_param.med_idx, &si) ||
          si.type != PJMEDIA_TYPE_VIDEO)
    {
       PJ_PERROR(1,(THIS_VDP, PJ_EINVAL,
          "Error: invalid stream!"));
    }
    vid_strm_param.dir = (si.info.vid.dir & PJMEDIA_DIR_ENCODING);
    status = pjsua_call_set_vid_strm(call_id,
                  PJSUA_CALL_VID_STRM_CHANGE_DIR,
                  &vid_strm_param);
}
switch(call_info.media[vid_idx].dir)
{
    case PJMEDIA_DIR_NONE:
      PJ_LOG(3,(THIS_FILE, "Video dir:NONE"));
      break;
    case PJMEDIA_DIR_ENCODING:
      PJ_LOG(3,(THIS_FILE, "Video dir: ENCODING"));
      break;
    case PJMEDIA_DIR_DECODING:
      PJ_LOG(3,(THIS_FILE, "Video dir: DECODING"));
      break;
    case PJMEDIA_DIR_ENCODING_DECODING:
      PJ_LOG(3,(THIS_FILE, "Video dir: ENCODING_DECODING"));
      break;
    default:
      PJ_LOG(3,(THIS_FILE, "Video dir: errate enumerator value"));
      break;
}
...............
...............
}

Can anyone please tell me why pjsua it is unable to create re-INVITE?
Thanks in advance
Regards
Silvio




[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