]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ensure that two SIP channels that exist at the same moment will not have the same...
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 26 Jun 2006 17:10:12 +0000 (17:10 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 26 Jun 2006 17:10:12 +0000 (17:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@36078 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 6d47c87c7115940e6435abe91a037454a15fdfc0..69828f7173194c56cc962fdb423c56870119af4d 100644 (file)
@@ -2773,11 +2773,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
        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) {