[PATCH] Use selection behavior of 'Multiple Codec' as used in PJSIP prior 1.6

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

 



Hello all,

Prior PJSIP version 1.6 when a SDP-answer was received with multiple (audio)
codecs, just the first codec was selected. The other was just ignored. From
on PJSIP 1.6 this behavior has been changed such a way that PJSIP now starts
reINVITE.
In our situation this resulted sometimes in undesirable behavior, so we
decided to revert back to old behavior.

I think this patch (or part of it) has already been mentioned once, but it
is offered again here.
We've introduced "PJSUA_IGNORE_OTHER_THAN_FIRST_CODEC_IN_SDP_ANSWER"-flag
for this.
Credits to Arie Velthoen for his initial patch.

It is likely this patch will never make it to the main-branch (or else in
bit modified form), but we wanted to share it anyway.
Please find the patch below (based upon stable 1.10):

With regards,

Eize Slange


Index: pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjsip/src/pjsua-lib/pjsua_call.c    (revision 3748)
+++ pjsip/src/pjsua-lib/pjsua_call.c    (working copy)
@@ -3269,7 +3269,17 @@
         call->lock_codec.retry_cnt = 0;
     return PJ_SUCCESS;
     }
+#if PJSUA_IGNORE_OTHER_THAN_FIRST_CODEC_IN_SDP_ANSWER
+    else
+    {
+    /* Ignore other codecs, use the first codec. */
+        PJ_LOG(3, (THIS_FILE, "Got answer with multiple codecs, use the
first one."));

+        call->lock_codec.retry_cnt = 0;
+
+    return PJ_SUCCESS;
+    }
+#else
     /* Remote keeps answering with multiple codecs, let's just give up
      * locking codec to avoid infinite retry loop.
      */
@@ -3291,6 +3301,7 @@
                    &call->lock_codec.reinv_timer, &delay);

     return PJ_SUCCESS;
+#endif
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110913/61f4203e/attachment.html>


[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