Discussion:
[pjsip] Video Call In Background
Vedvyas Rauniyar
2017-07-12 10:45:04 UTC
Permalink
Hello ,

I am working on PJSIP. Audio and video call is working fine in foreground
but the issue is, When the app is in background, I am able to make call in
background but no video is displaying. Any help would be highly appreciated.

When I make a call and pick the call from background, I am getting the
errors -

*15:48:19.250 pjsua_vid.c ......Creating video window: type=stream,
cap_id=-1, rend_id=0*

*15:48:19.250 vid_port.c .......Opening device OpenGL renderer
[OpenGL] for render: format=I420, size=656x656 @22:1 fps*

*15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL
because we are in background*

*15:48:19.251 vid_port.c .......Closing OpenGL renderer..*

*15:48:19.319 pjsua_vid.c .......Window 0: destroying..*

*15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for
call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)*

*15:48:19.319 pjsua_media.c ....Error updating media call00:1: video
subsystem not initialized (PJMEDIA_EVID_INIT)*

*15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is
Active*

*15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0*

*15:48:19.319 pjsua_app.c ....Turning sound device ON*

*15:48:19.319 conference.c ....Port 3 (sip:***@192.168.1.7
<sip%***@192.168.1.7>) transmitting to port 0 (Master/sound)*

*15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3*

*15:48:19.319 conference.c ....Port 0 (Master/sound) transmitting to
port 3 (sip:***@192.168.1.7 <sip%***@192.168.1.7>)*

*15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is
Error*

*15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on call
0, use "vid call enable 1" or "vid call add" to enable video!*

*15:48:19.319 pjsua_core.c ....TX 1321 bytes Response msg
200/INVITE/cseq=20 (tdta0x10494b000) to UDP 91.121.209.194:5060
<http://91.121.209.194:5060>:*

Code Snippet is -

#define KEEP_ALIVE_INTERVAL 600



- (void)keepAlive {



static pj_thread_desc a_thread_desc;

static pj_thread_t *a_thread;

int i;



if (!pj_thread_is_registered()) {

pj_thread_register("ipjsua", a_thread_desc, &a_thread);

}



/* Since iOS requires that the minimum keep alive interval is 600s,

* application needs to make sure that the account's registration

* timeout is long enough.

*/

for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {

if (pjsua_acc_is_valid(i)) {

pjsua_acc_set_registration(i, PJ_TRUE);

}

}

}
Vedvyas Rauniyar
2017-07-17 04:13:19 UTC
Permalink
Hi Team,

This is gentle reminder.
Post by Vedvyas Rauniyar
Hello ,
I am working on PJSIP. Audio and video call is working fine in foreground
but the issue is, When the app is in background, I am able to make call in
background but no video is displaying. Any help would be highly appreciated.
When I make a call and pick the call from background, I am getting the
errors -
*15:48:19.250 pjsua_vid.c ......Creating video window: type=stream,
cap_id=-1, rend_id=0*
*15:48:19.250 vid_port.c .......Opening device OpenGL renderer
*15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL
because we are in background*
*15:48:19.251 vid_port.c .......Closing OpenGL renderer..*
*15:48:19.319 pjsua_vid.c .......Window 0: destroying..*
*15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for
call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)*
*15:48:19.319 pjsua_media.c ....Error updating media call00:1: video
subsystem not initialized (PJMEDIA_EVID_INIT)*
*15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is
Active*
*15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0*
*15:48:19.319 pjsua_app.c ....Turning sound device ON*
port 0 (Master/sound)*
*15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3*
*15:48:19.319 conference.c ....Port 0 (Master/sound) transmitting to
*15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is
Error*
*15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on
call 0, use "vid call enable 1" or "vid call add" to enable video!*
*15:48:19.319 pjsua_core.c ....TX 1321 bytes Response msg
200/INVITE/cseq=20 (tdta0x10494b000) to UDP 91.121.209.194:5060
<http://91.121.209.194:5060>:*
Code Snippet is -
#define KEEP_ALIVE_INTERVAL 600
- (void)keepAlive {
static pj_thread_desc a_thread_desc;
static pj_thread_t *a_thread;
int i;
if (!pj_thread_is_registered()) {
pj_thread_register("ipjsua", a_thread_desc, &a_thread);
}
/* Since iOS requires that the minimum keep alive interval is 600s,
* application needs to make sure that the account's registration
* timeout is long enough.
*/
for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {
if (pjsua_acc_is_valid(i)) {
pjsua_acc_set_registration(i, PJ_TRUE);
}
}
}
Oren Barash
2017-07-17 06:27:22 UTC
Permalink
Hi,

Currently I am using PJSIP only in android, but from my knowledge on iOS you can’t do any UI operation from the background, so this is why OpenGL is failing.

I assume that you can answer/initiate the call, but you will be able to connect to the camera only when the app will go back to foreground.

When you wrote “no video is displaying” in which side ?
1) Let’s say that Bob calls Alice, and Alice's app is in the background, which one will not see anything ?
2) Let’s say that Bob calls Alice, and Bob's app is in the background Alice in foreground, when Bob returns to the app do you see video?

Oren.
Elbit Systems
Post by Vedvyas Rauniyar
Hi Team,
This is gentle reminder.
Hello ,
I am working on PJSIP. Audio and video call is working fine in foreground but the issue is, When the app is in background, I am able to make call in background but no video is displaying. Any help would be highly appreciated.
When I make a call and pick the call from background, I am getting the errors -
15:48:19.250 pjsua_vid.c ......Creating video window: type=stream, cap_id=-1, rend_id=0
15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL because we are in background
15:48:19.251 vid_port.c .......Closing OpenGL renderer..
15:48:19.319 pjsua_vid.c .......Window 0: destroying..
15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_media.c ....Error updating media call00:1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is Active
15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0
15:48:19.319 pjsua_app.c ....Turning sound device ON
15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3
15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is Error
15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on call 0, use "vid call enable 1" or "vid call add" to enable video!
Code Snippet is -
#define KEEP_ALIVE_INTERVAL 600
- (void)keepAlive {
static pj_thread_desc a_thread_desc;
static pj_thread_t *a_thread;
int i;
if (!pj_thread_is_registered()) {
pj_thread_register("ipjsua", a_thread_desc, &a_thread);
}
/* Since iOS requires that the minimum keep alive interval is 600s,
* application needs to make sure that the account's registration
* timeout is long enough.
*/
for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {
if (pjsua_acc_is_valid(i)) {
pjsua_acc_set_registration(i, PJ_TRUE);
}
}
}
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Vedvyas Rauniyar
2017-07-17 07:01:29 UTC
Permalink
Hi Oren,

I made a call from linphone mac application to iPhone device in foreground
and video was showing at both end (Linphone and iPhone) but when I made the
same call from linphone mac application to iPhone in background, I picked
up the call and app was moved from background to foreground. Audio was
working fine on both end but no video is displayed either iPhone side or
Linphone mac app side.

I am getting the below error -

*15:48:19.250 pjsua_vid.c ......Creating video window: type=stream,
Post by Vedvyas Rauniyar
cap_id=-1, rend_id=0*
*15:48:19.250 vid_port.c .......Opening device OpenGL renderer
*15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL
because we are in background*
*15:48:19.251 vid_port.c .......Closing OpenGL renderer..*
*15:48:19.319 pjsua_vid.c .......Window 0: destroying..*
*15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for
call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)*
*15:48:19.319 pjsua_media.c ....Error updating media call00:1: video
subsystem not initialized (PJMEDIA_EVID_INIT)*
*15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is
Active*
*15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0*
*15:48:19.319 pjsua_app.c ....Turning sound device ON*
transmitting to port 0 (Master/sound)*
*15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3*
*15:48:19.319 conference.c ....Port 0 (Master/sound) transmitting to
*15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is
Error*
*15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on
call 0, use "vid call enable 1" or "vid call add" to enable video!*
*15:48:19.319 pjsua_core.c ....TX 1321 bytes Response msg
200/INVITE/cseq=20 (tdta0x10494b000) to UDP 91.121.209.194:5060
<http://91.121.209.194:5060/>:*
On Wed, Jul 12, 2017 at 4:15 PM, Vedvyas Rauniyar <
Post by Vedvyas Rauniyar
Hello ,
I am working on PJSIP. Audio and video call is working fine in foreground
but the issue is, When the app is in background, I am able to make call in
background but no video is displaying. Any help would be highly appreciated.
When I make a call and pick the call from background, I am getting the
errors -
*15:48:19.250 pjsua_vid.c ......Creating video window: type=stream,
cap_id=-1, rend_id=0*
*15:48:19.250 vid_port.c .......Opening device OpenGL renderer
*15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL
because we are in background*
*15:48:19.251 vid_port.c .......Closing OpenGL renderer..*
*15:48:19.319 pjsua_vid.c .......Window 0: destroying..*
*15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for
call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)*
*15:48:19.319 pjsua_media.c ....Error updating media call00:1: video
subsystem not initialized (PJMEDIA_EVID_INIT)*
*15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is
Active*
*15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0*
*15:48:19.319 pjsua_app.c ....Turning sound device ON*
*15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3*
*15:48:19.319 conference.c ....Port 0 (Master/sound) transmitting to
*15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is
Error*
*15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on
call 0, use "vid call enable 1" or "vid call add" to enable video!*
*15:48:19.319 pjsua_core.c ....TX 1321 bytes Response msg
200/INVITE/cseq=20 (tdta0x10494b000) to UDP 91.121.209.194:5060
<http://91.121.209.194:5060>:*
Code Snippet is -
#define KEEP_ALIVE_INTERVAL 600
- (void)keepAlive {
static pj_thread_desc a_thread_desc;
static pj_thread_t *a_thread;
int i;
if (!pj_thread_is_registered()) {
pj_thread_register("ipjsua", a_thread_desc, &a_thread);
}
/* Since iOS requires that the minimum keep alive interval is 600s,
* application needs to make sure that the account's registration
* timeout is long enough.
*/
for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {
if (pjsua_acc_is_valid(i)) {
pjsua_acc_set_registration(i, PJ_TRUE);
}
}
}
Oren Barash
2017-07-17 11:25:53 UTC
Permalink
Oh,

I believe you need to add a small delay before connected the video window
Post by Vedvyas Rauniyar
Hi Oren,
I made a call from linphone mac application to iPhone device in foreground and video was showing at both end (Linphone and iPhone) but when I made the same call from linphone mac application to iPhone in background, I picked up the call and app was moved from background to foreground. Audio was working fine on both end but no video is displayed either iPhone side or Linphone mac app side.
I am getting the below error -
Post by Vedvyas Rauniyar
15:48:19.250 pjsua_vid.c ......Creating video window: type=stream, cap_id=-1, rend_id=0
15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL because we are in background
15:48:19.251 vid_port.c .......Closing OpenGL renderer..
15:48:19.319 pjsua_vid.c .......Window 0: destroying..
15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_media.c ....Error updating media call00:1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is Active
15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0
15:48:19.319 pjsua_app.c ....Turning sound device ON
15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3
15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is Error
15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on call 0, use "vid call enable 1" or "vid call add" to enable video!
Hello ,
I am working on PJSIP. Audio and video call is working fine in foreground but the issue is, When the app is in background, I am able to make call in background but no video is displaying. Any help would be highly appreciated.
When I make a call and pick the call from background, I am getting the errors -
15:48:19.250 pjsua_vid.c ......Creating video window: type=stream, cap_id=-1, rend_id=0
15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL because we are in background
15:48:19.251 vid_port.c .......Closing OpenGL renderer..
15:48:19.319 pjsua_vid.c .......Window 0: destroying..
15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_media.c ....Error updating media call00:1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is Active
15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0
15:48:19.319 pjsua_app.c ....Turning sound device ON
15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3
15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is Error
15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on call 0, use "vid call enable 1" or "vid call add" to enable video!
Code Snippet is -
#define KEEP_ALIVE_INTERVAL 600
- (void)keepAlive {
static pj_thread_desc a_thread_desc;
static pj_thread_t *a_thread;
int i;
if (!pj_thread_is_registered()) {
pj_thread_register("ipjsua", a_thread_desc, &a_thread);
}
/* Since iOS requires that the minimum keep alive interval is 600s,
* application needs to make sure that the account's registration
* timeout is long enough.
*/
for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {
if (pjsua_acc_is_valid(i)) {
pjsua_acc_set_registration(i, PJ_TRUE);
}
}
}
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Loading...