aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_misdn.c
diff options
context:
space:
mode:
authorcrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-18 09:36:16 +0000
committercrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-18 09:36:16 +0000
commit8d21cf4fa07f14e7f3a890e057a8d816c3a65c69 (patch)
treed045dea209917142944d8ee85a2d5980fdb51458 /channels/chan_misdn.c
parent7188fd81cffe0cd2dcb2ea4f9bc87962d9e0e14b (diff)
Merged revisions 59064 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r59064 | crichter | 2007-03-20 14:16:06 +0100 (Di, 20 Mär 2007) | 21 lines Merged revisions 58849-58850,59062-59063 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r58849 | crichter | 2007-03-13 12:58:16 +0100 (Di, 13 Mär 2007) | 1 line added method standard_dec for dialing out on groups, to avoid conflicts, which caused issues with some ISDN providers ........ r58850 | crichter | 2007-03-13 13:58:32 +0100 (Di, 13 Mär 2007) | 1 line fixed the crypt_keys stuff ........ r59062 | crichter | 2007-03-20 10:18:06 +0100 (Di, 20 Mär 2007) | 1 line avoid sending a disconnect when we already received one. ........ r59063 | crichter | 2007-03-20 10:23:22 +0100 (Di, 20 Mär 2007) | 1 line modified a loglevel ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@64952 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_misdn.c')
-rw-r--r--channels/chan_misdn.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index fefef85b7..06c04a233 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -2972,6 +2972,7 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
char *tokb=NULL, *p=NULL;
int channel=0, port=0;
struct misdn_bchannel *newbc = NULL;
+ int dec=0;
struct chan_list *cl=init_chan_list(ORG_AST);
@@ -3000,23 +3001,27 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
else {
port = atoi(port_str);
}
-
-
} else {
ast_log(LOG_WARNING, " --> ! IND : CALL dad:%s WITHOUT PORT/Group, check extension.conf\n",ext);
return NULL;
}
+ if (misdn_cfg_is_group_method(group, METHOD_STANDARD_DEC)) {
+ chan_misdn_log(4, port, " --> STARTING STANDARDDEC...\n");
+ dec=1;
+ }
+
if (!ast_strlen_zero(group)) {
char cfg_group[BUFFERSIZE+1];
struct robin_list *rr = NULL;
if (misdn_cfg_is_group_method(group, METHOD_ROUND_ROBIN)) {
- chan_misdn_log(4, port, " --> STARTING ROUND ROBIN...");
+ chan_misdn_log(4, port, " --> STARTING ROUND ROBIN...\n");
rr = get_robin_position(group);
}
+
if (rr) {
int robin_channel = rr->channel;
int port_start;
@@ -3058,7 +3063,7 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
if ( port_up>0 ) {
- newbc = misdn_lib_get_free_bc(port, robin_channel,0);
+ newbc = misdn_lib_get_free_bc(port, robin_channel,0, 0);
if (newbc) {
chan_misdn_log(4, port, " Success! Found port:%d channel:%d\n", newbc->port, newbc->channel);
if (port_up)
@@ -3074,9 +3079,7 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
if (!newbc)
chan_misdn_log(-1, port, " Failed! No free channel in group %d!", group);
- }
-
- else {
+ } else {
for (port=misdn_cfg_get_next_port(0); port > 0;
port=misdn_cfg_get_next_port(port)) {
@@ -3092,18 +3095,17 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
chan_misdn_log(4, port, "portup:%d\n", port_up);
if ( port_up>0 ) {
- newbc = misdn_lib_get_free_bc(port, 0, 0);
+ newbc = misdn_lib_get_free_bc(port, 0, 0, dec);
if (newbc)
break;
}
}
}
}
-
} else {
if (channel)
chan_misdn_log(1, port," --> preselected_channel: %d\n",channel);
- newbc = misdn_lib_get_free_bc(port, channel, 0);
+ newbc = misdn_lib_get_free_bc(port, channel, 0, dec);
}
if (!newbc) {
@@ -4397,6 +4399,8 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
cb_log(1,bc->port," --> found holded ch\n");
misdn_transfer_bc(ch, holded_ch) ;
}
+
+ bc->need_disconnect=0;
stop_bc_tones(ch);
hangup_chan(ch);
@@ -4413,6 +4417,9 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
case EVENT_RELEASE:
{
+ bc->need_disconnect=0;
+ bc->need_release=0;
+
hangup_chan(ch);
release_chan(bc);
@@ -4422,6 +4429,10 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
break;
case EVENT_RELEASE_COMPLETE:
{
+ bc->need_disconnect=0;
+ bc->need_release=0;
+ bc->need_release_complete=0;
+
stop_bc_tones(ch);
hangup_chan(ch);
release_chan(bc);