[svn-commits] tilghman: branch 1.6.1 r192935 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 7 11:45:36 CDT 2009


Author: tilghman
Date: Thu May  7 11:45:31 2009
New Revision: 192935

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=192935
Log:
Merged revisions 192933 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r192933 | tilghman | 2009-05-07 11:43:56 -0500 (Thu, 07 May 2009) | 17 lines
  
  Merged revisions 192932 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r192932 | tilghman | 2009-05-07 11:29:08 -0500 (Thu, 07 May 2009) | 10 lines
    
    Eliminate repetition of fullcontact during reconstruction.
    If the fullcontact field appears in both the sippeers and the
    sipregs table, then during reconstruction of the field, it will
    otherwise be doubled.
    (closes issue #14754)
     Reported by: Alexei Gradinari
     Patches: 
           20090506__bug14754.diff.txt uploaded by tilghman (license 14)
     Tested by: lmadsen
  ........
................

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/channels/chan_sip.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=192935&r1=192934&r2=192935
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Thu May  7 11:45:31 2009
@@ -21593,6 +21593,7 @@
 	struct sip_peer tmp_peer;
 	const char *srvlookup = NULL;
 	static int deprecation_warning = 1;
+	int alt_fullcontact = alt ? 1 : 0;
 	struct ast_str *fullcontact = ast_str_alloca(512);
 
 	if (!realtime || ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
@@ -21678,6 +21679,15 @@
 		} else if (realtime && !strcasecmp(v->name, "name"))
 			ast_copy_string(peer->name, v->value, sizeof(peer->name));
 		else if (realtime && !strcasecmp(v->name, "fullcontact")) {
+			if (alt_fullcontact && !alt) {
+				/* Reset, because the alternate also has a fullcontact and we
+				 * do NOT want the field value to be doubled. It might be
+				 * tempting to skip this, but the first table might not have
+				 * fullcontact and since we're here, we know that the alternate
+				 * absolutely does. */
+				alt_fullcontact = 0;
+				ast_str_reset(fullcontact);
+			}
 			/* Reconstruct field, because realtime separates our value at the ';' */
 			if (fullcontact->used > 0) {
 				ast_str_append(&fullcontact, 0, ";%s", v->value);




More information about the svn-commits mailing list