[asterisk-commits] branch crichter/0.3.0 r9222 -
/team/crichter/0.3.0/channels/misdn/isdn_lib.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Feb 8 12:36:08 MST 2006
Author: crichter
Date: Wed Feb 8 13:36:06 2006
New Revision: 9222
URL: http://svn.digium.com/view/asterisk?rev=9222&view=rev
Log:
L2 Signalling in PTP-TE Mode fixed
Modified:
team/crichter/0.3.0/channels/misdn/isdn_lib.c
Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.c?rev=9222&r1=9221&r2=9222&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Wed Feb 8 13:36:06 2006
@@ -635,18 +635,30 @@
return 0;
}
-
-int misdn_lib_get_l2_status(struct misdn_stack *stack)
+int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack)
{
iframe_t act;
-
+
act.prim = DL_ESTABLISH | REQUEST;
-
- act.addr = (stack->upper_id | FLG_MSG_DOWN) ;
-
+ act.addr = (stack->upper_id & ~LAYER_ID_MASK) | 3 | FLG_MSG_DOWN;
+
act.dinfo = 0;
act.len = 0;
return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
+ return 0;
+}
+
+int misdn_lib_get_l2_status(struct misdn_stack *stack)
+{
+ iframe_t act;
+
+ act.prim = DL_ESTABLISH | REQUEST;
+
+ act.addr = (stack->upper_id | FLG_MSG_DOWN) ;
+
+ act.dinfo = 0;
+ act.len = 0;
+ return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
}
int misdn_lib_get_short_status(struct misdn_stack *stack)
@@ -656,9 +668,9 @@
act.prim = MGR_SHORTSTATUS | REQUEST;
- act.addr = (stack->upper_id | FLG_MSG_DOWN) ;
-
- act.dinfo = SSTATUS_L1;
+ act.addr = (stack->upper_id | MSG_BROADCAST) ;
+
+ act.dinfo = SSTATUS_BROADCAST_BIT | SSTATUS_ALL;
act.len = 0;
return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
@@ -1119,31 +1131,22 @@
Isdnl2Init(&stack->nst);
Isdnl3Init(&stack->nst);
-
- //misdn_lib_get_l1_up(stack);
}
if ( stack->nt && stack->ptp) {
- //misdn_lib_get_l2_up(stack);
- //stack->l2link=0;
}
if (!stack->nt) {
/*assume L1 is up, we'll get DEACTIVATES soon, for non
* up L1s*/
stack->l1link=1;
- //misdn_lib_get_l2_up(stack);
- //misdn_lib_get_l1_up(stack);
- }
-
- //misdn_lib_get_short_status(stack);
-
-
+ }
+
+ misdn_lib_get_short_status(stack);
misdn_lib_get_l1_up(stack);
misdn_lib_get_l2_up(stack);
-
}
cb_log(1,0,"stack_init: port:%d lowerId:%x upperId:%x\n",stack->port,stack->lower_id, stack->upper_id);
@@ -2324,6 +2327,10 @@
case SSTATUS_L1_ACTIVATED:
cb_log(1, stack->port, "MGMT: SSTATUS: L1_ACTIVATED \n");
stack->l1link=1;
+
+ if (stack->ptp && stack->nt) {
+ misdn_lib_get_l2_te_ptp_up(stack);
+ }
break;
case SSTATUS_L1_DEACTIVATED:
More information about the asterisk-commits
mailing list