diff options
author | dbrooks <dbrooks@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-02 21:06:20 +0000 |
---|---|---|
committer | dbrooks <dbrooks@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-02 21:06:20 +0000 |
commit | 1ab059f5f3eccc68f020ae06681ecf09406be10a (patch) | |
tree | c024bd6fd2d023315a353d59b595188a3e73cffe /channels | |
parent | 04aadd76161e3a6e1dde98f0776372c0590b4ac5 (diff) |
SIP channel name uniqueness
SIP channel names were supposed to be unique by way of a name suffix derived from the
pointer to the channel's private data. Uniqueness was preserved on 32-bit systems, but
not on 64-bit systems. This patch, as suggested by kpfleming, replaces this suffix with
a simple incremented unsigned int.
(closes issue #15152)
Reported by: palbrecht
Review: https://reviewboard.asterisk.org/r/420/
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@226978 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 43ecc0226..55f76e91a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -850,6 +850,8 @@ static const struct cfsip_methods { { SIP_PING, NO_RTP, "PING", CAN_CREATE_DIALOG_UNSUPPORTED_METHOD } }; +static unsigned int chan_idx; + /*! Define SIP option tags, used in Require: and Supported: headers We need to be aware of these properties in the phones to use the replace: header. We should not do that without knowing @@ -6619,7 +6621,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit sip_pvt_unlock(i); /* Don't hold a sip pvt lock while we allocate a channel */ - tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "SIP/%s-%08x", my_name, (int)(long) i); + tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "SIP/%s-%08x", my_name, ast_atomic_fetchadd_int((int *)&chan_idx, +1)); } if (!tmp) { |