mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
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
This commit is contained in:
@@ -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)
|
static void update_name(struct ast_channel *tmp, int port, int c)
|
||||||
{
|
{
|
||||||
if (c<=0) {
|
int chan_offset=0;
|
||||||
c=glob_channel++;
|
int tmp_port = misdn_cfg_get_next_port(0);
|
||||||
ast_string_field_build(tmp, name, "%s/%d-u%d",
|
for (; tmp_port > 0; tmp_port=misdn_cfg_get_next_port(tmp_port)) {
|
||||||
misdn_type, port, c);
|
if (tmp_port == port) break;
|
||||||
} else {
|
chan_offset+=misdn_lib_port_is_pri(tmp_port)?30:2;
|
||||||
ast_string_field_build(tmp, name, "%s/%d-%d",
|
|
||||||
misdn_type, port, c);
|
|
||||||
}
|
}
|
||||||
|
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);
|
chan_misdn_log(3,port," --> updating channel name to [%s]\n",tmp->name);
|
||||||
|
|
||||||
|
@@ -27,6 +27,18 @@ struct misdn_stack* get_misdn_stack( void );
|
|||||||
static int bec_initialized=0;
|
static int bec_initialized=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int misdn_lib_port_is_pri(int port)
|
||||||
|
{
|
||||||
|
struct misdn_stack *stack=get_misdn_stack();
|
||||||
|
for ( ; stack; stack=stack->next) {
|
||||||
|
if (stack->port == port) {
|
||||||
|
return stack->pri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int misdn_lib_port_block(int port)
|
int misdn_lib_port_block(int port)
|
||||||
{
|
{
|
||||||
|
@@ -413,6 +413,8 @@ int misdn_lib_get_port_info(int port);
|
|||||||
int misdn_lib_port_block(int port);
|
int misdn_lib_port_block(int port);
|
||||||
int misdn_lib_port_unblock(int port);
|
int misdn_lib_port_unblock(int port);
|
||||||
|
|
||||||
|
int misdn_lib_port_is_pri(int port);
|
||||||
|
|
||||||
int misdn_lib_port_up(int port, int notcheck);
|
int misdn_lib_port_up(int port, int notcheck);
|
||||||
|
|
||||||
int misdn_lib_get_port_down(int port);
|
int misdn_lib_get_port_down(int port);
|
||||||
|
Reference in New Issue
Block a user