[asterisk-commits] rmudgett: branch rmudgett/mwi r254930 - /team/rmudgett/mwi/channels/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 25 18:34:58 CDT 2010
Author: rmudgett
Date: Thu Mar 25 18:34:54 2010
New Revision: 254930
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=254930
Log:
Move some code into sig_pri.
Modified:
team/rmudgett/mwi/channels/chan_dahdi.c
team/rmudgett/mwi/channels/sig_pri.c
Modified: team/rmudgett/mwi/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/mwi/channels/chan_dahdi.c?view=diff&rev=254930&r1=254929&r2=254930
==============================================================================
--- team/rmudgett/mwi/channels/chan_dahdi.c (original)
+++ team/rmudgett/mwi/channels/chan_dahdi.c Thu Mar 25 18:34:54 2010
@@ -13380,50 +13380,8 @@
struct dahdi_params p;
struct dahdi_bufferinfo bi;
struct dahdi_spaninfo si;
-#if defined(HAVE_PRI_MWI)
- char *saveptr;
- char *mbox_number;
- char *mbox_context;
-#endif /* defined(HAVE_PRI_MWI) */
pri->pri.calls = &dahdi_pri_callbacks;
-
-#if defined(HAVE_PRI_MWI)
- /* Prepare the mbox[] for use. */
- memset(pri->pri.mbox, 0, sizeof(pri->pri.mbox));
- for (i = 0; i < SIG_PRI_MAX_MWI_MAILBOXES; ++i) {
- pri->pri.mbox[i].last_message_count = -1;
- }
-
- /*
- * Split the mwi_mailboxes configuration string into the mbox[]:
- * mailbox_number[@context]{,mailbox_number[@context]}
- */
- i = 0;
- saveptr = NULL;/* So compiler will not complain about uninitialized variable. */
- for (mbox_number = strtok_r(pri->pri.mwi_mailboxes, ",", &saveptr);
- mbox_number && i < SIG_PRI_MAX_MWI_MAILBOXES;
- mbox_number = strtok_r(NULL, ",", &saveptr)) {
- /* Split the mailbox_number and context */
- mbox_context = strchr(mbox_number, '@');
- if (mbox_context) {
- *mbox_context++ = '\0';
- mbox_context = ast_strip(mbox_context);
- }
- mbox_number = ast_strip(mbox_number);
- if (ast_strlen_zero(mbox_number)) {
- /* There is no mailbox number. Skip it. */
- continue;
- }
-
- /* Fill the mbox[] element. */
- pri->pri.mbox[i].number = mbox_number;
- if (!ast_strlen_zero(mbox_context)) {
- pri->pri.mbox[i].context = mbox_context;
- }
- ++i;
- }
-#endif /* defined(HAVE_PRI_MWI) */
for (i = 0; i < NUM_DCHANS; i++) {
if (!pri->dchannels[i])
Modified: team/rmudgett/mwi/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/mwi/channels/sig_pri.c?view=diff&rev=254930&r1=254929&r2=254930
==============================================================================
--- team/rmudgett/mwi/channels/sig_pri.c (original)
+++ team/rmudgett/mwi/channels/sig_pri.c Thu Mar 25 18:34:54 2010
@@ -3908,6 +3908,48 @@
{
int x;
int i;
+#if defined(HAVE_PRI_MWI)
+ char *saveptr;
+ char *mbox_number;
+ char *mbox_context;
+#endif /* defined(HAVE_PRI_MWI) */
+
+#if defined(HAVE_PRI_MWI)
+ /* Prepare the mbox[] for use. */
+ memset(pri->mbox, 0, sizeof(pri->mbox));
+ for (i = 0; i < SIG_PRI_MAX_MWI_MAILBOXES; ++i) {
+ pri->mbox[i].last_message_count = -1;
+ }
+
+ /*
+ * Split the mwi_mailboxes configuration string into the mbox[]:
+ * mailbox_number[@context]{,mailbox_number[@context]}
+ */
+ i = 0;
+ saveptr = NULL;/* So compiler will not complain about uninitialized variable. */
+ for (mbox_number = strtok_r(pri->mwi_mailboxes, ",", &saveptr);
+ mbox_number && i < SIG_PRI_MAX_MWI_MAILBOXES;
+ mbox_number = strtok_r(NULL, ",", &saveptr)) {
+ /* Split the mailbox_number and context */
+ mbox_context = strchr(mbox_number, '@');
+ if (mbox_context) {
+ *mbox_context++ = '\0';
+ mbox_context = ast_strip(mbox_context);
+ }
+ mbox_number = ast_strip(mbox_number);
+ if (ast_strlen_zero(mbox_number)) {
+ /* There is no mailbox number. Skip it. */
+ continue;
+ }
+
+ /* Fill the mbox[] element. */
+ pri->mbox[i].number = mbox_number;
+ if (!ast_strlen_zero(mbox_context)) {
+ pri->mbox[i].context = mbox_context;
+ }
+ ++i;
+ }
+#endif /* defined(HAVE_PRI_MWI) */
ast_mutex_init(&pri->lock);
More information about the asterisk-commits
mailing list