[svn-commits] branch 1.2 r36078 - /branches/1.2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Jun 26 10:10:12 MST 2006


Author: kpfleming
Date: Mon Jun 26 12:10:12 2006
New Revision: 36078

URL: http://svn.digium.com/view/asterisk?rev=36078&view=rev
Log:
ensure that two SIP channels that exist at the same moment will not have the same channel names (issue #7245, different fix)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=36078&r1=36077&r2=36078&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Mon Jun 26 12:10:12 2006
@@ -2773,11 +2773,11 @@
 	fmt = ast_best_codec(tmp->nativeformats);
 
 	if (title)
-		snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%04x", title, thread_safe_rand() & 0xffff);
+		snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", title, (int)(long) i);
 	else if (strchr(i->fromdomain,':'))
-		snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", strchr(i->fromdomain,':')+1, (int)(long)(i));
+		snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", strchr(i->fromdomain,':') + 1, (int)(long) i);
 	else
-		snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", i->fromdomain, (int)(long)(i));
+		snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", i->fromdomain, (int)(long) i);
 
 	tmp->type = channeltype;
 	if (ast_test_flag(i, SIP_DTMF) ==  SIP_DTMF_INBAND) {



More information about the svn-commits mailing list