VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
ben4asterisk at yahoo.com Guest
|
Posted: Thu May 15, 2008 6:05 am Post subject: [asterisk-users] are channel names unique |
|
|
Hello ppl,
Are the channel names generated on 'Dial's supposed to be unique?
I see the channel names repeating on my asterisk box. I just wanted to confirm this.
Can anyone point me to the lines of code where the channel name is generated/calculated? I tried looking, but it looks like quite a big maze.
Regards
- Ben. |
|
Back to top |
|
|
russell at digium.com Guest
|
Posted: Thu May 15, 2008 6:46 am Post subject: [asterisk-users] are channel names unique |
|
|
Benjamin Jacob wrote:
Quote: | Are the channel names generated on 'Dial's supposed to be unique?
I see the channel names repeating on my asterisk box. I just wanted to confirm this.
Can anyone point me to the lines of code where the channel name is generated/calculated? I tried looking, but it looks like quite a big maze.
|
Channel names are not guaranteed to be unique at all. However, all channels
have a uniqueid associated with them. You can access it in the dialplan via
${UNIQUEID}.
--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc. |
|
Back to top |
|
|
philipp.kempgen at amo... Guest
|
Posted: Thu May 15, 2008 6:47 am Post subject: [asterisk-users] are channel names unique |
|
|
Benjamin Jacob schrieb:
Quote: | Can anyone point me to the lines of code where the channel name is generated/calculated? I tried looking, but it looks like quite a big maze.
|
ast_channel_alloc() in main/channel.c
---cut---
if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
ast_string_field_build(tmp, uniqueid, "%li.%d", (long) time(NULL),
ast_atomic_fetchadd_int(&uniqueint, 1));
} else {
ast_string_field_build(tmp, uniqueid, "%s-%li.%d", ast_config_AST_SYSTEM_NAME,
(long) time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1));
}
---cut---
Gr??e,
Philipp Kempgen
--
Asterisk-Tag.org 2008, 26.-27. Mai -> http://www.asterisk-tag.org
amooma GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de
Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 |
|
Back to top |
|
|
philipp.kempgen at amo... Guest
|
Posted: Thu May 15, 2008 6:52 am Post subject: [asterisk-users] are channel names unique |
|
|
Philipp Kempgen schrieb:
Quote: | Benjamin Jacob schrieb:
Quote: | Can anyone point me to the lines of code where the channel name is generated/calculated? I tried looking, but it looks like quite a big maze.
|
ast_channel_alloc() in main/channel.c
---cut---
if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
ast_string_field_build(tmp, uniqueid, "%li.%d", (long) time(NULL),
ast_atomic_fetchadd_int(&uniqueint, 1));
} else {
ast_string_field_build(tmp, uniqueid, "%s-%li.%d", ast_config_AST_SYSTEM_NAME,
(long) time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1));
}
---cut---
|
Er, sorry, I thought a bit too far. That is for the UNIQUEID.
Gr??e,
Philipp Kempgen
--
Asterisk-Tag.org 2008, 26.-27. Mai -> http://www.asterisk-tag.org
amooma GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de
Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 |
|
Back to top |
|
|
ben4asterisk at yahoo.com Guest
|
Posted: Thu May 15, 2008 7:03 am Post subject: [asterisk-users] are channel names unique |
|
|
So I thought!! Thanks guys.
But a query with regards to this :
I need to send hangup commands based on these channel names only. So at any given point of time, for 'n' ongoing calls, will these 'n' channel names be different/ unique?
If not, using AMI, how do we hangup a given channel?
cheers
- Ben.
--- On Thu, 5/15/08, Russell Bryant <russell at digium.com> wrote:
Quote: | From: Russell Bryant <russell at digium.com>
Subject: Re: [asterisk-users] are channel names unique
To: ben4asterisk at yahoo.com, "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Date: Thursday, May 15, 2008, 11:46 AM
Benjamin Jacob wrote:
Quote: | Are the channel names generated on 'Dial's
| supposed to be unique?
Quote: | I see the channel names repeating on my asterisk box.
| I just wanted to confirm this.
Quote: | Can anyone point me to the lines of code where the
| channel name is generated/calculated? I tried looking, but
it looks like quite a big maze.
Channel names are not guaranteed to be unique at all.
However, all channels
have a uniqueid associated with them. You can access it in
the dialplan via
${UNIQUEID}.
--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc. |
|
|
Back to top |
|
|
russell at digium.com Guest
|
Posted: Thu May 15, 2008 7:15 am Post subject: [asterisk-users] are channel names unique |
|
|
Benjamin Jacob wrote:
Quote: | So I thought!! Thanks guys.
But a query with regards to this :
I need to send hangup commands based on these channel names only. So at any given point of time, for 'n' ongoing calls, will these 'n' channel names be different/ unique?
If not, using AMI, how do we hangup a given channel?
|
While channel names are not unique over time, at any given point in time, there
should not be more than 1 channel with the same name.
--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc. |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|