summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorChristian Richter <christian.richter@beronet.com>2006-02-15 19:32:45 +0000
committerChristian Richter <christian.richter@beronet.com>2006-02-15 19:32:45 +0000
commitf6bd1b8559e6dfb7f12fe797a1fac0ff9fe3c36c (patch)
tree1366bf804725d662a11ee78940a3103fdca18c91 /channels
parent5f3af13a97cd6a9a10cb34f00ff3f5da7407c388 (diff)
added pmp_l1_check option, to avoid l1 checking for group calls on PMP ports
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_misdn.c13
-rw-r--r--channels/misdn/chan_misdn_config.h1
-rw-r--r--channels/misdn/isdn_lib.c24
-rw-r--r--channels/misdn/isdn_lib.h2
-rw-r--r--channels/misdn_config.c1
5 files changed, 22 insertions, 19 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 606c4cebf..68adc5e74 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -2306,8 +2306,9 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
if (!strcasecmp(cfg_group, group)) {
int port_up;
-
- port_up = misdn_lib_port_up(port);
+ int check;
+ misdn_cfg_get(port, MISDN_CFG_PMP_L1_CHECK, &check, sizeof(int));
+ port_up = misdn_lib_port_up(port, check);
if ( port_up ) {
newbc = misdn_lib_get_free_bc(port, robin_channel);
@@ -2333,12 +2334,14 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
port=misdn_cfg_get_next_port(port)) {
misdn_cfg_get( port, MISDN_CFG_GROUPNAME, cfg_group, BUFFERSIZE);
-
+
+ chan_misdn_log(3,port, "Group [%s] Port [%d]\n", group, port);
if (!strcasecmp(cfg_group, group)) {
int port_up;
+ int check;
+ misdn_cfg_get(port, MISDN_CFG_PMP_L1_CHECK, &check, sizeof(int));
+ port_up = misdn_lib_port_up(port, check);
- port_up = misdn_lib_port_up(port);
-
chan_misdn_log(4, port, "portup:%d\n", port_up);
if ( port_up ) {
diff --git a/channels/misdn/chan_misdn_config.h b/channels/misdn/chan_misdn_config.h
index 8e2b2609f..84f346a94 100644
--- a/channels/misdn/chan_misdn_config.h
+++ b/channels/misdn/chan_misdn_config.h
@@ -26,6 +26,7 @@ enum misdn_cfg_elements {
MISDN_CFG_RXGAIN, /* int */
MISDN_CFG_TXGAIN, /* int */
MISDN_CFG_TE_CHOOSE_CHANNEL, /* int (bool) */
+ MISDN_CFG_PMP_L1_CHECK, /* int (bool) */
MISDN_CFG_CONTEXT, /* char[] */
MISDN_CFG_LANGUAGE, /* char[] */
MISDN_CFG_MUSICCLASS, /* char[] */
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index 8605bff90..ee0e988de 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -1460,27 +1460,25 @@ int misdn_lib_send_facility(struct misdn_bchannel *bc, enum facility_type fac, v
}
-int misdn_lib_port_up(int port)
+int misdn_lib_port_up(int port, int check)
{
struct misdn_stack *stack;
-
+
+
for (stack=glob_mgr->stack_list;
stack;
stack=stack->next) {
+ if ( !stack->ptp && !check) return 1;
+
if (stack->port == port) {
- if (stack->nt) {
- if (stack->l1link)
- return 1;
- else
- return 0;
- } else {
- if (stack->l1link)
- return 1;
- else
- return 0;
+ if (stack->l1link)
+ return 1;
+ else {
+ cb_log(-1,port, "Port down [%s]\n",
+ stack->ptp?"PP":"PMP");
+ return 0;
}
-
}
}
diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h
index 77804241d..7590b3eee 100644
--- a/channels/misdn/isdn_lib.h
+++ b/channels/misdn/isdn_lib.h
@@ -335,7 +335,7 @@ void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2);
int misdn_lib_port_restart(int port);
int misdn_lib_get_port_info(int port);
-int misdn_lib_port_up(int port);
+int misdn_lib_port_up(int port, int notcheck);
int misdn_lib_get_port_up (int port) ;
diff --git a/channels/misdn_config.c b/channels/misdn_config.c
index c3a884fb3..7716ce39e 100644
--- a/channels/misdn_config.c
+++ b/channels/misdn_config.c
@@ -87,6 +87,7 @@ static const struct misdn_cfg_spec port_spec[] = {
{ "rxgain", MISDN_CFG_RXGAIN, MISDN_CTYPE_INT, "0", NONE },
{ "txgain", MISDN_CFG_TXGAIN, MISDN_CTYPE_INT, "0", NONE },
{ "te_choose_channel", MISDN_CFG_TE_CHOOSE_CHANNEL, MISDN_CTYPE_BOOL, "no", NONE },
+ { "pmp_l1_check", MISDN_CFG_PMP_L1_CHECK, MISDN_CTYPE_BOOL, "yes", NONE },
{ "context", MISDN_CFG_CONTEXT, MISDN_CTYPE_STR, "default", NONE },
{ "language", MISDN_CFG_LANGUAGE, MISDN_CTYPE_STR, "en", NONE },
{ "musicclass", MISDN_CFG_MUSICCLASS, MISDN_CTYPE_STR, "default", NONE },