[asterisk-commits] jpeeler: branch jpeeler/asterisk-sigwork-trunk r199090 - /team/jpeeler/asteri...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 4 11:25:29 CDT 2009
Author: jpeeler
Date: Thu Jun 4 11:25:25 2009
New Revision: 199090
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199090
Log:
Make the necessary modifications for sig_pri to be linked against chan_dahdi rather than just being embedded
Modified:
team/jpeeler/asterisk-sigwork-trunk/channels/Makefile
team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c
team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/Makefile?view=diff&rev=199090&r1=199089&r2=199090
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/Makefile (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/Makefile Thu Jun 4 11:25:25 2009
@@ -69,7 +69,7 @@
rm -f h323/Makefile
$(if $(filter chan_iax2,$(EMBEDDED_MODS)),modules.link,chan_iax2.so): iax2-parser.o iax2-provision.o
-$(if $(filter chan_dahdi,$(EMBEDDED_MODS)),modules.link,chan_dahdi.so): sig_analog.o
+$(if $(filter chan_dahdi,$(EMBEDDED_MODS)),modules.link,chan_dahdi.so): sig_analog.o sig_pri.o
ifneq ($(filter chan_h323,$(EMBEDDED_MODS)),)
modules.link: h323/libchanh323.a
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c?view=diff&rev=199090&r1=199089&r2=199090
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Thu Jun 4 11:25:25 2009
@@ -352,38 +352,10 @@
#define CHAN_PSEUDO -2
-/* Overlap dialing option types */
-#define DAHDI_OVERLAPDIAL_NONE 0
-#define DAHDI_OVERLAPDIAL_OUTGOING 1
-#define DAHDI_OVERLAPDIAL_INCOMING 2
-#define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
-
#define CALLPROGRESS_PROGRESS 1
#define CALLPROGRESS_FAX_OUTGOING 2
#define CALLPROGRESS_FAX_INCOMING 4
#define CALLPROGRESS_FAX (CALLPROGRESS_FAX_INCOMING | CALLPROGRESS_FAX_OUTGOING)
-
-#ifdef HAVE_PRI_SERVICE_MESSAGES
-/*! \brief Persistent Service State */
-#define SRVST_DBKEY "service-state"
-/*! \brief The out-of-service SERVICE state */
-#define SRVST_TYPE_OOS "O"
-/*! \brief SRVST_INITIALIZED is used to indicate a channel being out-of-service
- * The SRVST_INITIALIZED is mostly used maintain backwards compatibility but also may
- * mean that the channel has not yet received a RESTART message. If a channel is
- * out-of-service with this reason a RESTART message will result in the channel
- * being put into service. */
-#define SRVST_INITIALIZED 0
-/*! \brief SRVST_NEAREND is used to indicate that the near end was put out-of-service */
-#define SRVST_NEAREND (1 << 0)
-/*! \brief SRVST_FAREND is used to indicate that the far end was taken out-of-service */
-#define SRVST_FAREND (1 << 1)
-/*! \brief SRVST_BOTH is used to indicate that both sides of the channel are out-of-service */
-#define SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND)
-
-/*! \brief The AstDB family */
-static const char dahdi_db[] = "dahdi/registry";
-#endif
static char defaultcic[64] = "";
static char defaultozz[64] = "";
@@ -2328,10 +2300,6 @@
static const char *event2str(int event);
-#ifdef HAVE_PRI
-static char *dialplan2str(int dialplan);
-#endif
-
static void my_handle_dchan_exception(struct sig_pri_pri *pri, int index)
{
int x, res;
@@ -10368,7 +10336,7 @@
return NULL;
}
if ((pris[span].pri.dialplan) && (pris[span].pri.dialplan != conf->pri.pri.dialplan)) {
- ast_log(LOG_ERROR, "Span %d is already a %s dialing plan\n", span + 1, dialplan2str(pris[span].pri.dialplan));
+ ast_log(LOG_ERROR, "Span %d is already a %s dialing plan\n", span + 1, pris[span].pri.dialplan == -1 ? "Dynamically set dialplan in ISDN" : pri_plan2str(pris[span].pri.dialplan));
destroy_dahdi_pvt(&tmp);
return NULL;
}
@@ -12145,8 +12113,6 @@
}
#endif /* defined(HAVE_PRI) */
-#include "sig_pri.c"
-
static int prepare_pri(struct dahdi_pri *pri)
{
int i, res, x;
@@ -12426,7 +12392,7 @@
default:
ast_log(LOG_WARNING, "Unsupported changestatus: '%d'\n", changestatus);
}
- pri_maintenance_service(tmp->pri->pri, PRI_SPAN(PVT_TO_CHANNEL(tmp->sig_pvt)), PVT_TO_CHANNEL(tmp->sig_pvt), changestatus);
+ pri_maintenance_bservice(tmp->pri->pri, tmp->sig_pvt, changestatus);
ast_mutex_unlock(lock);
return CLI_SUCCESS;
}
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c?view=diff&rev=199090&r1=199089&r2=199090
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c Thu Jun 4 11:25:25 2009
@@ -32,7 +32,6 @@
#include "asterisk/utils.h"
#include "asterisk/options.h"
#include "asterisk/pbx.h"
-#include "asterisk/features.h"
#include "asterisk/file.h"
#include "asterisk/callerid.h"
#include "asterisk/say.h"
@@ -42,6 +41,7 @@
#include "asterisk/musiconhold.h"
#include "asterisk/cli.h"
#include "asterisk/transcap.h"
+#include "asterisk/features.h"
#include "sig_pri.h"
#define OLD 0 /* jpeeler */
@@ -2540,3 +2540,10 @@
return res;
}
+int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int changestatus)
+{
+ int channel = PVT_TO_CHANNEL(p);
+ int span = PRI_SPAN(channel);
+
+ return pri_maintenance_service(pri, span, channel, changestatus);
+}
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h?view=diff&rev=199090&r1=199089&r2=199090
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h Thu Jun 4 11:25:25 2009
@@ -28,6 +28,7 @@
#include "asterisk/channel.h"
#include "asterisk/frame.h"
#include <libpri.h>
+#include <dahdi/user.h>
enum sig_pri_tone {
SIG_PRI_TONE_RINGTONE = 0,
@@ -75,6 +76,38 @@
#define NUM_DCHANS 4 /*!< No more than 4 d-channels */
#define MAX_CHANNELS 672 /*!< No more than a DS3 per trunk group */
+
+#define SIG_PRI DAHDI_SIG_CLEAR
+#define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR)
+#define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR)
+
+/* Overlap dialing option types */
+#define DAHDI_OVERLAPDIAL_NONE 0
+#define DAHDI_OVERLAPDIAL_OUTGOING 1
+#define DAHDI_OVERLAPDIAL_INCOMING 2
+#define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
+
+#ifdef HAVE_PRI_SERVICE_MESSAGES
+/*! \brief Persistent Service State */
+#define SRVST_DBKEY "service-state"
+/*! \brief The out-of-service SERVICE state */
+#define SRVST_TYPE_OOS "O"
+/*! \brief SRVST_INITIALIZED is used to indicate a channel being out-of-service
+ * The SRVST_INITIALIZED is mostly used maintain backwards compatibility but also may
+ * mean that the channel has not yet received a RESTART message. If a channel is
+ * out-of-service with this reason a RESTART message will result in the channel
+ * being put into service. */
+#define SRVST_INITIALIZED 0
+/*! \brief SRVST_NEAREND is used to indicate that the near end was put out-of-service */
+#define SRVST_NEAREND (1 << 0)
+/*! \brief SRVST_FAREND is used to indicate that the far end was taken out-of-service */
+#define SRVST_FAREND (1 << 1)
+/*! \brief SRVST_BOTH is used to indicate that both sides of the channel are out-of-service */
+#define SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND)
+
+/*! \brief The AstDB family */
+static const char dahdi_db[] = "dahdi/registry";
+#endif
struct sig_pri_chan {
/* Options to be set by user */
@@ -222,4 +255,6 @@
int pri_send_keypad_facility_exec(struct sig_pri_chan *p, const char *digits);
int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channel_state chanstate, const char *destination, const char *original, const char *reason);
+int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int changestatus);
+
#endif /* _SIG_PRI_H */
More information about the asterisk-commits
mailing list