summaryrefslogtreecommitdiff
path: root/channels/chan_misdn.c
diff options
context:
space:
mode:
authorChristian Richter <christian.richter@beronet.com>2006-08-07 09:09:17 +0000
committerChristian Richter <christian.richter@beronet.com>2006-08-07 09:09:17 +0000
commitf2178d336b5773d137d83ee3a9870ec801a18681 (patch)
tree363b12b611849e8a31b478c2a6894d7946ca302c /channels/chan_misdn.c
parent4d7c67fc721641ad5af9f023c7cfb41492d54dc9 (diff)
changed naming of mISDN channels, so that hinting works proper
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_misdn.c')
-rw-r--r--channels/chan_misdn.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index f093af080..21edb0d5b 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -3042,18 +3042,20 @@ static struct ast_channel_tech misdn_tech_wo_bridge = {
};
-static unsigned long glob_channel=0;
+static int glob_channel=0;
static void update_name(struct ast_channel *tmp, int port, int c)
{
- if (c<=0) {
- c=glob_channel++;
- ast_string_field_build(tmp, name, "%s/%d-u%d",
- misdn_type, port, c);
- } else {
- ast_string_field_build(tmp, name, "%s/%d-%d",
- misdn_type, port, c);
+ int chan_offset=0;
+ int tmp_port = misdn_cfg_get_next_port(0);
+ for (; tmp_port > 0; tmp_port=misdn_cfg_get_next_port(tmp_port)) {
+ if (tmp_port == port) break;
+ chan_offset+=misdn_lib_port_is_pri(tmp_port)?30:2;
}
+ if (c<0) c=0;
+
+ ast_string_field_build(tmp, name, "%s/%d-u%d",
+ misdn_type, chan_offset+c, glob_channel++);
chan_misdn_log(3,port," --> updating channel name to [%s]\n",tmp->name);