[libpri-commits] dhubbard: branch dhubbard/bbfcfm r1038 - /team/dhubbard/bbfcfm/
SVN commits to the libpri project
libpri-commits at lists.digium.com
Sat Aug 29 11:30:42 CDT 2009
Author: dhubbard
Date: Sat Aug 29 11:30:37 2009
New Revision: 1038
URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=1038
Log:
attempt to start adding national service message support
1. rename the NATIONAL_SERVICE and NATIONAL_SERVICE_ACKNOWLEDGE preprocessor
definitions to ATT_SERVICE and ATT_SERVICE_ACKNOWLEDGE
2. add NATIONAL_SERVICE and NATIONAL_SERVICE_ACKNOWLEDGE preprocessor definitions
3. add MAINTENANCE_PROTOCOL_DISCRIMINATOR_3 (67)
there is very likely something wrong with this commit, but I don't have much
to reference for this functionality.
Modified:
team/dhubbard/bbfcfm/pri_q931.h
team/dhubbard/bbfcfm/q931.c
Modified: team/dhubbard/bbfcfm/pri_q931.h
URL: http://svn.asterisk.org/svn-view/libpri/team/dhubbard/bbfcfm/pri_q931.h?view=diff&rev=1038&r1=1037&r2=1038
==============================================================================
--- team/dhubbard/bbfcfm/pri_q931.h (original)
+++ team/dhubbard/bbfcfm/pri_q931.h Sat Aug 29 11:30:37 2009
@@ -75,8 +75,11 @@
#define Q931_PROTOCOL_DISCRIMINATOR 0x08
#define GR303_PROTOCOL_DISCRIMINATOR 0x4f
+/* AT&T Maintenance Protocol Discriminators */
#define MAINTENANCE_PROTOCOL_DISCRIMINATOR_1 0x03
#define MAINTENANCE_PROTOCOL_DISCRIMINATOR_2 0x43
+/* National Maintenance Protocol Discriminator */
+#define MAINTENANCE_PROTOCOL_DISCRIMINATOR_3 0x67
/* Q.931 / National ISDN Message Types */
@@ -121,8 +124,10 @@
#define Q931_SUSPEND_REJECT 0x21
/* Maintenance messages (codeset 0 only) */
-#define NATIONAL_SERVICE 0x0f
-#define NATIONAL_SERVICE_ACKNOWLEDGE 0x07
+#define ATT_SERVICE 0x0f
+#define ATT_SERVICE_ACKNOWLEDGE 0x07
+#define NATIONAL_SERVICE 0x0f
+#define NATIONAL_SERVICE_ACKNOWLEDGE 0x07
#define SERVICE_CHANGE_STATUS_INSERVICE 0
#define SERVICE_CHANGE_STATUS_LOOPBACK 1 /* not supported */
Modified: team/dhubbard/bbfcfm/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/team/dhubbard/bbfcfm/q931.c?view=diff&rev=1038&r1=1037&r2=1038
==============================================================================
--- team/dhubbard/bbfcfm/q931.c (original)
+++ team/dhubbard/bbfcfm/q931.c Sat Aug 29 11:30:37 2009
@@ -94,8 +94,10 @@
static int post_handle_q931_message(struct pri *ctrl, struct q931_mh *mh, struct q931_call *c, int missingmand);
struct msgtype maintenance_msgs[] = {
- { NATIONAL_SERVICE, "SERVICE", { Q931_CHANNEL_IDENT } },
- { NATIONAL_SERVICE_ACKNOWLEDGE, "SERVICE ACKNOWLEDGE", { Q931_CHANNEL_IDENT } },
+ { ATT_SERVICE, "SERVICE", { Q931_CHANNEL_IDENT } },
+ { ATT_SERVICE_ACKNOWLEDGE, "SERVICE ACKNOWLEDGE", { Q931_CHANNEL_IDENT } },
+ { NATIONAL_SERVICE, "CONNECT", { Q931_CHANNEL_IDENT } },
+ { NATIONAL_SERVICE_ACKNOWLEDGE, "CONNECT ACKNOWLEDGE", { Q931_CHANNEL_IDENT } },
};
static int post_handle_maintenance_message(struct pri *ctrl, struct q931_mh *mh, struct q931_call *c);
@@ -3343,7 +3345,7 @@
int maintenance_service_ack(struct pri *ctrl, q931_call *c)
{
- return send_message(ctrl, c, (MAINTENANCE_PROTOCOL_DISCRIMINATOR_1 << 8) | NATIONAL_SERVICE_ACKNOWLEDGE, maintenance_service_ies);
+ return send_message(ctrl, c, (MAINTENANCE_PROTOCOL_DISCRIMINATOR_1 << 8) | ATT_SERVICE_ACKNOWLEDGE, maintenance_service_ies);
}
int maintenance_service(struct pri *ctrl, int span, int channel, int changestatus)
@@ -3361,7 +3363,7 @@
c->channelno = channel;
c->chanflags |= FLAG_EXCLUSIVE;
c->changestatus = changestatus;
- return send_message(ctrl, c, (MAINTENANCE_PROTOCOL_DISCRIMINATOR_1 << 8) | NATIONAL_SERVICE, maintenance_service_ies);
+ return send_message(ctrl, c, (MAINTENANCE_PROTOCOL_DISCRIMINATOR_1 << 8) | ATT_SERVICE, maintenance_service_ies);
}
static int status_ies[] = { Q931_CAUSE, Q931_CALL_STATE, -1 };
@@ -4047,8 +4049,8 @@
/* SERVICE messages are a superset of messages that can take b-channels
* or entire d-channels in and out of service */
switch(mh->msg) {
- case NATIONAL_SERVICE:
- case NATIONAL_SERVICE_ACKNOWLEDGE:
+ case ATT_SERVICE:
+ case ATT_SERVICE_ACKNOWLEDGE:
c->channelno = -1;
c->slotmap = -1;
c->chanflags = 0;
@@ -4345,7 +4347,7 @@
{
/* Do some maintenance stuff */
switch (mh->msg) {
- case NATIONAL_SERVICE:
+ case ATT_SERVICE:
if (c->channelno > 0) {
ctrl->ev.e = PRI_EVENT_SERVICE;
ctrl->ev.service.channel = c->channelno | (c->ds1no << 8);
@@ -4367,7 +4369,7 @@
}
maintenance_service_ack(ctrl, c);
return Q931_RES_HAVEEVENT;
- case NATIONAL_SERVICE_ACKNOWLEDGE:
+ case ATT_SERVICE_ACKNOWLEDGE:
if (c->channelno > 0) {
ctrl->ev.e = PRI_EVENT_SERVICE_ACK;
ctrl->ev.service_ack.channel = c->channelno | (c->ds1no << 8);
More information about the libpri-commits
mailing list