Video deactivated when registered with Asterisk (patch included)

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

 



Dear PJSIP team,

first of all thank you for providing this great library to the public!

I am currently working on a VoIP client nased on PJSUA and stumbled
accross a problem that appears to be the same as reported at

https://community.asterisk.org/t/h263p-video-deactivated-when-using-with-asterisk/

and for which I could not find any fix yet. 

When called directly, my VoIP client is working fine, video is working
in both directions with the h263p and the h264 codec. If the client is
registered with the asterisk PBX, video is deactivated, and PJSIP
reports the following errors:

[PJSIP-4] 17:02:27.898   pjsua_call.c  Answering call 0: code=200
[PJSIP-5] 17:02:27.898  inv0xa9a066ac  ..SDP negotiation done, status=0
[PJSIP-5] 17:02:27.898   pjsua_call.c  ...Call 0: remote NAT type is 0 (Unknown)
[PJSIP-4] 17:02:27.898  pjsua_media.c  ...Call 0: updating media..
[PJSIP-4] 17:02:27.898    pjsua_aud.c  ....Audio channel update..
[...]
[PJSIP-4] 17:02:27.899  pjsua_media.c  ....Audio updated, stream #0: PCMA (sendrecv)
[PJSIP-4] 17:02:27.899    pjsua_vid.c  ....Video channel update..
[PJSIP-1] 17:02:27.899  pjsua_media.c  ....pjsua_vid_channel_update() failed for call_id 0 media 1: Invalid SDP fmtp attribute (PJMEDIA_SDP_EINFMTP)
[PJSIP-1] 17:02:27.899  pjsua_media.c  ....Error updating media call00:1: Invalid SDP fmtp attribute (PJMEDIA_SDP_EINFMTP)

I am using PJSIP 2.6  and Asterisk PBX 13.14.1~dfsg-2 under Debian
Stretch.

Looking deeper, I discovered that PJSIP apparently does not accept the
SDP/fmtp message sent by asterisk

> Media Attribute (a): fmtp:98 SQCIF=0;QCIF=1;CIF=1;CIF4=0;CIF16=0;VGA=0;F=0;I=0;J=0;T=0;K=0;N=0;BPP=0;HRD=0

due to the "...=0" entries. Without looking into the protocol specs in
detail, I believe that entries like "SQCIF=0" should simply state that
the respective video format is not supported and can be ignored.
However, in function 'pjmedia_vid_codec_parse_h263_fmtp()' they lead
to an PJMEDIA_SDP_EINFMTP error.

The following patch resolves the problem in my case by ignoring such
entries in pjmedia_vid_codec_parse_h263_fmtp():

--- src/pjproject-2.6/pjmedia/src/pjmedia/vid_codec_util.c.orig	2017-09-16 18:05:00.099741051 +0200
+++ src/pjproject-2.6/pjmedia/src/pjmedia/vid_codec_util.c	2017-09-16 17:29:42.282403470 +0200
@@ -128,6 +128,7 @@
 		unsigned mpi;
 
 		mpi = pj_strtoul(&fmtp->param[i].val);
+		if (mpi == 0) continue;   /* [GK] This refers to a "<format>=0" entry in the SDP/fmtp attribute - we simply ignore it. */
 		if (mpi<1 || mpi>32)
 		    return PJMEDIA_SDP_EINFMTP;
 
I hope this may helpful for other users (though perhaps not the final
perfect solution).

Best regards

Gundolf Kiefer


_______________________________________________
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