endpoint.c bug with sdp versions > 32 bits (?), proposed patch

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

 



I discovered that if pjsip puts a call on hold, it does not trigger 
music-on-hold using the Digium Switchvox pbx.

This appears to be because the version number in the sdp that pjsip generates is 
overflowing a 32 bit int used in the Asterisk version used by switchvox.

The patch below (against 1.10) solves the issue, and I believe it should be 
harmless to anyone else.

-m@

Index: callbridge/pjproject-1.10/pjmedia/src/pjmedia/endpoint.c
===================================================================
--- callbridge/pjproject-1.10/pjmedia/src/pjmedia/endpoint.c    (revision 33933)
+++ callbridge/pjproject-1.10/pjmedia/src/pjmedia/endpoint.c    (revision 33936)
@@ -343,7 +343,11 @@
 
     pj_gettimeofday(&tv);
     sdp->origin.user = pj_str("-");
-    sdp->origin.version = sdp->origin.id = tv.sec + 2208988800UL;
+    // this used to add a big value that pushed the number past 32 bits
+    // and broke a few things in switchvox's asterisk, notably music-on-hold.
+    // This number is just a time in the not-too-distant past to get the
+    // numbers into a reasonable range.
+    sdp->origin.version = sdp->origin.id = tv.sec - 1304628710UL;
     sdp->origin.net_type = STR_IN;
 
     if (addr0->addr.sa_family == pj_AF_INET()) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110707/5d6e3369/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