aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorcrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-12 13:22:17 +0000
committercrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-12 13:22:17 +0000
commitf8c609617aa8f60076f42ede7ccd9be484a1b8ee (patch)
tree4c003713bd4fb5850663cd7f7c2c9b971a479a51 /channels
parent4856e67e8c1ca023f4096507f1c64b5980cf55a6 (diff)
Merged revisions 89171 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89171 | crichter | 2007-11-12 12:13:13 +0100 (Mo, 12 Nov 2007) | 1 line fixed a state/event issue with overlapdial=yes when no extension matched. removed the general sending of a RELEASE_COMPLETE when we receive a RELEASE, this is done by mISDNuser/mISDN. This makes it possible to use asterisk-1.4 with mISDN trunk, but requires users of mISDN/mISDNuser-1.1.X to upgrade to at least mISDNuser-1.1.6 (when using the NT mode at all) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89176 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_misdn.c2
-rw-r--r--channels/misdn/isdn_lib.c73
2 files changed, 44 insertions, 31 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 4349d39b5..066c981f5 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -706,6 +706,7 @@ static int misdn_overlap_dial_task (const void *data)
misdn_overlap_dial_task_disconnect:
hanguptone_indicate(ch);
ch->bc->out_cause=1;
+ ch->state=MISDN_CLEANING;
misdn_lib_send_event(ch->bc, EVENT_DISCONNECT);
}
ch->overlap_dial_task = -1;
@@ -5085,7 +5086,6 @@ static int load_module(void)
if (!ast_strlen_zero(ports))
chan_misdn_log(0, 0, "Got: %s from get_ports\n", ports);
-
if (misdn_lib_init(ports, &iface, NULL))
chan_misdn_log(0, 0, "No te ports initialized\n");
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index 4b45b4175..6171a5f06 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -29,6 +29,8 @@ struct misdn_stack* get_misdn_stack( void );
static int set_chan_in_stack(struct misdn_stack *stack, int channel);
+int release_cr(struct misdn_stack *stack, mISDNuser_head_t *hh);
+
int misdn_lib_port_is_pri(int port)
{
struct misdn_stack *stack=get_misdn_stack();
@@ -1773,6 +1775,38 @@ int misdn_lib_port_up(int port, int check)
}
+int release_cr(struct misdn_stack *stack, mISDNuser_head_t *hh)
+{
+ struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
+ struct misdn_bchannel dummybc;
+ iframe_t frm; /* fake te frm to remove callref from global callreflist */
+ frm.dinfo = hh->dinfo;
+
+ frm.addr=stack->upper_id | FLG_MSG_DOWN;
+
+ frm.prim = CC_RELEASE_CR|INDICATION;
+ cb_log(4, stack->port, " --> CC_RELEASE_CR: Faking Realease_cr for %x l3id:%x\n",frm.addr, frm.dinfo);
+ /** removing procid **/
+ if (!bc) {
+ cb_log(4, stack->port, " --> Didn't found BC so temporarly creating dummy BC (l3id:%x) on this port.\n", hh->dinfo);
+ misdn_make_dummy(&dummybc, stack->port, hh->dinfo, stack->nt, 0);
+ bc=&dummybc;
+ }
+
+ if (bc) {
+ if ( (bc->l3_id & 0xff00) == 0xff00) {
+ cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xff);
+ stack->procids[bc->l3_id&0xff] = 0 ;
+ }
+ }
+ else cb_log(0, stack->port, "Couldnt find BC so I couldnt remove the Process!!!! this is a bad port.\n");
+
+ if (handle_cr(stack, &frm)<0) {
+ }
+
+ return 0 ;
+}
+
int
handle_event_nt(void *dat, void *arg)
{
@@ -1921,43 +1955,23 @@ handle_event_nt(void *dat, void *arg)
break;
case CC_RELEASE|CONFIRM:
+ {
+ struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
+
+ if (bc) {
+ cb_log(1, stack->port, "CC_RELEASE|CONFIRM (l3id:%x), sending RELEASE_COMPLETE\n", hh->dinfo);
+ misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE);
+ }
+ }
break;
case CC_RELEASE|INDICATION:
break;
case CC_RELEASE_CR|INDICATION:
- {
- struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
- struct misdn_bchannel dummybc;
- iframe_t frm; /* fake te frm to remove callref from global callreflist */
- frm.dinfo = hh->dinfo;
-
- frm.addr=stack->upper_id | FLG_MSG_DOWN;
-
- frm.prim = CC_RELEASE_CR|INDICATION;
- cb_log(4, stack->port, " --> Faking Realease_cr for %x\n",frm.addr);
- /** removing procid **/
- if (!bc) {
- cb_log(4, stack->port, " --> Didn't found BC so temporarly creating dummy BC (l3id:%x) on this port.\n", hh->dinfo);
- misdn_make_dummy(&dummybc, stack->port, hh->dinfo, stack->nt, 0);
- bc=&dummybc;
- }
-
- if (bc) {
- if ( (bc->l3_id & 0xff00) == 0xff00) {
- cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xff);
- stack->procids[bc->l3_id&0xff] = 0 ;
- }
- }
- else cb_log(0, stack->port, "Couldnt find BC so I couldnt remove the Process!!!! this is a bad port.\n");
-
- if (handle_cr(stack, &frm)<0) {
- }
-
+ release_cr(stack, hh);
free_msg(msg);
return 0 ;
- }
break;
case CC_NEW_CR|INDICATION:
@@ -2087,7 +2101,6 @@ handle_event_nt(void *dat, void *arg)
}
cb_event(event, bc, glob_mgr->user_data);
}
-
} else {
cb_log(4, stack->port, "No BC found with l3id: prim %x dinfo %x\n",hh->prim, hh->dinfo);
}