diff options
author | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-23 10:28:54 +0000 |
---|---|---|
committer | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-23 10:28:54 +0000 |
commit | 6c89c6af2a0a0af19853e39c7baf25958f25aa26 (patch) | |
tree | 7846b836cfe9654f865d299a209df49ecef268de /channels/misdn | |
parent | ce6b278e29cb1fd6df0cdab8480372f8e0b80036 (diff) |
Merged revisions 50495,50506 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r50495 | crichter | 2007-01-11 14:27:52 +0100 (Do, 11 Jan 2007) | 6 lines
* more additions to make the RESTART message work
* added fix for misdn_call to allow SETUPs with empty
extensions, replaced the strtok_r functions with strsep for that
(inspired by Sandro Cappellazzo, thanks)
........
r50506 | crichter | 2007-01-11 15:45:38 +0100 (Do, 11 Jan 2007) | 1 line
when we get L2 UP, the L1 is UP definitely too, so we set the L1 state up as well.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51649 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/misdn')
-rw-r--r-- | channels/misdn/isdn_lib.c | 21 | ||||
-rw-r--r-- | channels/misdn/isdn_msg_parser.c | 6 |
2 files changed, 23 insertions, 4 deletions
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c index d655b9305..0735f6cce 100644 --- a/channels/misdn/isdn_lib.c +++ b/channels/misdn/isdn_lib.c @@ -1970,7 +1970,9 @@ handle_event_nt(void *dat, void *arg) cb_log(0, stack->port, "%% GOT L2 Activate Info. but we're activated already.. this l2 is faulty, blocking port\n"); cb_event(EVENT_PORT_ALARM, &stack->bc[0], glob_mgr->user_data); } - + + /* when we get the L2 UP, the L1 is UP definitely too*/ + stack->l1link = 1; stack->l2link = 1; stack->l2upcnt=0; @@ -2821,6 +2823,9 @@ static int handle_mgmt(msg_t *msg) case SSTATUS_L2_ESTABLISHED: cb_log(3, stack->port, "MGMT: SSTATUS: L2_ESTABLISH \n"); + + /*when the L2 goes UP, L1 needs to be UP too*/ + stack->l1link=1; stack->l2link=1; break; @@ -3612,12 +3617,12 @@ int misdn_lib_send_restart(int port) struct misdn_bchannel dummybc; memset (&dummybc,0,sizeof(dummybc)); dummybc.port=stack->port; - dummybc.l3_id=MISDN_ID_DUMMY; + dummybc.l3_id=MISDN_ID_GLOBAL; dummybc.nt=stack->nt; int max=stack->pri?30:2; int i; - for (i=1;i<max;i++) { + for (i=1;i<=max;i++) { dummybc.channel=i; cb_log(0, port, "Restarting channel %d\n",i); misdn_lib_send_event(&dummybc, EVENT_RESTART); @@ -3747,6 +3752,16 @@ static void manager_event_handler(void *arg) iframe_t *frm = (iframe_t *)msg->data; struct misdn_bchannel *bc = find_bc_by_l3id(stack, frm->dinfo); if (bc) send_msg(glob_mgr->midev, bc, msg); + else { + if (frm->dinfo == MISDN_ID_GLOBAL) { + struct misdn_bchannel dummybc; + memset (&dummybc,0,sizeof(dummybc)); + dummybc.port=stack->port; + dummybc.l3_id=MISDN_ID_GLOBAL; + dummybc.nt=stack->nt; + send_msg(glob_mgr->midev, &dummybc, msg); + } + } } } } diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c index aa6fb73f6..1a1223db7 100644 --- a/channels/misdn/isdn_msg_parser.c +++ b/channels/misdn/isdn_msg_parser.c @@ -816,10 +816,14 @@ static msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, msg_t *msg =(msg_t*)create_l3msg(CC_RESTART | REQUEST, MT_RESTART, bc?bc->l3_id:-1, sizeof(RESTART_t) ,nt); restart=(RESTART_t*)((msg->data+HEADER_LEN)); - + #if DEBUG printf("Building RESTART Msg\n"); #endif + enc_ie_channel_id(&restart->CHANNEL_ID, msg, 1,bc->channel, nt,bc); + + cb_log(0,bc->port, "Restarting channel %d\n", bc->channel); + return msg; } |