summaryrefslogtreecommitdiff
path: root/channels/misdn
diff options
context:
space:
mode:
Diffstat (limited to 'channels/misdn')
-rw-r--r--channels/misdn/chan_misdn_config.h10
-rw-r--r--channels/misdn/isdn_lib.c196
-rw-r--r--channels/misdn/isdn_lib.h202
-rw-r--r--channels/misdn/isdn_lib_intern.h1
-rw-r--r--channels/misdn/isdn_msg_parser.c395
5 files changed, 512 insertions, 292 deletions
diff --git a/channels/misdn/chan_misdn_config.h b/channels/misdn/chan_misdn_config.h
index c00db864b..d64b8c860 100644
--- a/channels/misdn/chan_misdn_config.h
+++ b/channels/misdn/chan_misdn_config.h
@@ -46,10 +46,16 @@ enum misdn_cfg_elements {
MISDN_CFG_DIALPLAN, /* int */
MISDN_CFG_LOCALDIALPLAN, /* int */
MISDN_CFG_CPNDIALPLAN, /* int */
- MISDN_CFG_NATPREFIX, /* char[] */
- MISDN_CFG_INTERNATPREFIX, /* char[] */
+ MISDN_CFG_TON_PREFIX_UNKNOWN, /* char[] */
+ MISDN_CFG_TON_PREFIX_INTERNATIONAL, /* char[] */
+ MISDN_CFG_TON_PREFIX_NATIONAL, /* char[] */
+ MISDN_CFG_TON_PREFIX_NETWORK_SPECIFIC,/* char[] */
+ MISDN_CFG_TON_PREFIX_SUBSCRIBER, /* char[] */
+ MISDN_CFG_TON_PREFIX_ABBREVIATED, /* char[] */
MISDN_CFG_PRES, /* int */
MISDN_CFG_SCREEN, /* int */
+ MISDN_CFG_DISPLAY_CONNECTED, /* int */
+ MISDN_CFG_DISPLAY_SETUP, /* int */
MISDN_CFG_ALWAYS_IMMEDIATE, /* int (bool) */
MISDN_CFG_NODIALTONE, /* int (bool) */
MISDN_CFG_IMMEDIATE, /* int (bool) */
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index 071f756eb..d8cf6171a 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -171,19 +171,24 @@ struct misdn_stack *get_stack_by_bc(struct misdn_bchannel *bc)
void get_show_stack_details(int port, char *buf)
{
- struct misdn_stack *stack=get_misdn_stack();
+ struct misdn_stack *stack = get_misdn_stack();
- for ( ; stack; stack=stack->next) {
- if (stack->port == port) break;
+ for (; stack; stack = stack->next) {
+ if (stack->port == port) {
+ break;
+ }
}
if (stack) {
- sprintf(buf, "* Port %d Type %s Prot. %s L2Link %s L1Link:%s Blocked:%d",
- stack->port, stack->nt ? "NT" : "TE", stack->ptp ? "PTP" : "PMP",
- stack->l2link ? "UP" : "DOWN", stack->l1link ? "UP" : "DOWN",
+ sprintf(buf, "* Port %2d Type %s Prot. %s L2Link %s L1Link:%s Blocked:%d",
+ stack->port,
+ stack->nt ? "NT" : "TE",
+ stack->ptp ? "PTP" : "PMP",
+ stack->l2link ? "UP " : "DOWN",
+ stack->l1link ? "UP " : "DOWN",
stack->blocked);
} else {
- buf[0]=0;
+ buf[0] = 0;
}
}
@@ -644,6 +649,29 @@ static void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state
static void empty_bc(struct misdn_bchannel *bc)
{
+ bc->caller.presentation = 0; /* allowed */
+ bc->caller.number_plan = NUMPLAN_ISDN;
+ bc->caller.number_type = NUMTYPE_UNKNOWN;
+ bc->caller.name[0] = 0;
+ bc->caller.number[0] = 0;
+ bc->caller.subaddress[0] = 0;
+
+ bc->connected.presentation = 0; /* allowed */
+ bc->connected.number_plan = NUMPLAN_ISDN;
+ bc->connected.number_type = NUMTYPE_UNKNOWN;
+ bc->connected.name[0] = 0;
+ bc->connected.number[0] = 0;
+ bc->connected.subaddress[0] = 0;
+
+ bc->redirecting.from.presentation = 0; /* allowed */
+ bc->redirecting.from.number_plan = NUMPLAN_ISDN;
+ bc->redirecting.from.number_type = NUMTYPE_UNKNOWN;
+ bc->redirecting.from.name[0] = 0;
+ bc->redirecting.from.number[0] = 0;
+ bc->redirecting.from.subaddress[0] = 0;
+
+ bc->redirecting.reason = mISDN_REDIRECTING_REASON_UNKNOWN;
+
bc->dummy=0;
bc->bframe_len=0;
@@ -678,12 +706,6 @@ static void empty_bc(struct misdn_bchannel *bc)
bc->generate_tone=0;
bc->tone_cnt=0;
- bc->dnumplan=NUMPLAN_UNKNOWN;
- bc->onumplan=NUMPLAN_UNKNOWN;
- bc->rnumplan=NUMPLAN_UNKNOWN;
- bc->cpnnumplan=NUMPLAN_UNKNOWN;
-
-
bc->active = 0;
bc->early_bconnect = 1;
@@ -701,7 +723,12 @@ static void empty_bc(struct misdn_bchannel *bc)
bc->cause = AST_CAUSE_NORMAL_CLEARING;
bc->out_cause = AST_CAUSE_NORMAL_CLEARING;
- bc->pres = 0; /* allowed */
+
+ bc->display_connected = 0; /* none */
+ bc->display_setup = 0; /* none */
+
+ bc->presentation = 0; /* allowed */
+ bc->set_presentation = 0;
bc->evq=EVENT_NOTHING;
@@ -719,15 +746,14 @@ static void empty_bc(struct misdn_bchannel *bc)
bc->hdlc=0;
+ bc->dialed.number_plan = NUMPLAN_ISDN;
+ bc->dialed.number_type = NUMTYPE_UNKNOWN;
+ bc->dialed.number[0] = 0;
+ bc->dialed.subaddress[0] = 0;
bc->info_dad[0] = 0;
bc->display[0] = 0;
bc->infos_pending[0] = 0;
- bc->cad[0] = 0;
- bc->oad[0] = 0;
- bc->dad[0] = 0;
- bc->rad[0] = 0;
- bc->orig_dad[0] = 0;
bc->uu[0]=0;
bc->uulen=0;
@@ -929,7 +955,7 @@ static int create_process(int midev, struct misdn_bchannel *bc)
if (stack->procids[proc_id] == 0) {
break;
}
- } /* end for */
+ }
if (proc_id == MAXPROCS) {
cb_log(0, stack->port, "Couldn't Create New ProcId.\n");
return -1;
@@ -1560,7 +1586,14 @@ static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_
setup_bc(bc);
if ( *bc->crypt_key ) {
- cb_log(4, stack->port, "ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s\n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
+ cb_log(4, stack->port,
+ "ENABLING BLOWFISH channel:%d caller%d:\"%s\" <%s> dialed%d:%s\n",
+ bc->channel,
+ bc->caller.number_type,
+ bc->caller.name,
+ bc->caller.number,
+ bc->dialed.number_type,
+ bc->dialed.number);
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
}
@@ -1582,7 +1615,14 @@ static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_
case EVENT_CONNECT:
if ( *bc->crypt_key ) {
- cb_log(4, stack->port, "ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s\n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
+ cb_log(4, stack->port,
+ "ENABLING BLOWFISH channel:%d caller%d:\"%s\" <%s> dialed%d:%s\n",
+ bc->channel,
+ bc->caller.number_type,
+ bc->caller.name,
+ bc->caller.number,
+ bc->dialed.number_type,
+ bc->dialed.number);
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
}
case EVENT_ALERTING:
@@ -2454,7 +2494,14 @@ static int handle_bchan(msg_t *msg)
{
unsigned int *cont = (unsigned int *) &frm->data.p;
- cb_log(4, stack->port, "PH_CONTROL: channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
+ cb_log(4, stack->port,
+ "PH_CONTROL: channel:%d caller%d:\"%s\" <%s> dialed%d:%s \n",
+ bc->channel,
+ bc->caller.number_type,
+ bc->caller.name,
+ bc->caller.number,
+ bc->dialed.number_type,
+ bc->dialed.number);
if ((*cont & ~DTMF_TONE_MASK) == DTMF_TONE_VAL) {
int dtmf = *cont & DTMF_TONE_MASK;
@@ -3268,10 +3315,6 @@ struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel, int inout, i
return NULL;
}
-
-
-
-/* ******************************************************************* */
/*!
* \internal
* \brief Convert the facility function enum value into a string.
@@ -3286,14 +3329,8 @@ static const char *fac2str(enum FacFunction facility)
} arr[] = {
/* *INDENT-OFF* */
{ Fac_None, "Fac_None" },
- { Fac_GetSupportedServices, "Fac_GetSupportedServices" },
- { Fac_Listen, "Fac_Listen" },
- { Fac_Suspend, "Fac_Suspend" },
- { Fac_Resume, "Fac_Resume" },
{ Fac_CFActivate, "Fac_CFActivate" },
{ Fac_CFDeactivate, "Fac_CFDeactivate" },
- { Fac_CFInterrogateParameters, "Fac_CFInterrogateParameters" },
- { Fac_CFInterrogateNumbers, "Fac_CFInterrogateNumbers" },
{ Fac_CD, "Fac_CD" },
{ Fac_AOCDCurrency, "Fac_AOCDCurrency" },
{ Fac_AOCDChargingUnit, "Fac_AOCDChargingUnit" },
@@ -3306,10 +3343,10 @@ static const char *fac2str(enum FacFunction facility)
if (arr[index].facility == facility) {
return arr[index].name;
}
- } /* end for */
+ }
return "unknown";
-} /* end fac2str() */
+}
void misdn_lib_log_ies(struct misdn_bchannel *bc)
{
@@ -3321,20 +3358,50 @@ void misdn_lib_log_ies(struct misdn_bchannel *bc)
if (!stack) return;
- cb_log(2, stack->port, " --> channel:%d mode:%s cause:%d ocause:%d rad:%s cad:%s\n", bc->channel, stack->nt?"NT":"TE", bc->cause, bc->out_cause, bc->rad, bc->cad);
+ cb_log(2, stack->port,
+ " --> channel:%d mode:%s cause:%d ocause:%d\n",
+ bc->channel,
+ stack->nt ? "NT" : "TE",
+ bc->cause,
+ bc->out_cause);
+
+ cb_log(2, stack->port,
+ " --> info_dad:%s dialed numtype:%d plan:%d\n",
+ bc->info_dad,
+ bc->dialed.number_type,
+ bc->dialed.number_plan);
+
+ cb_log(2, stack->port,
+ " --> caller:\"%s\" <%s> type:%d plan:%d pres:%d screen:%d\n",
+ bc->caller.name,
+ bc->caller.number,
+ bc->caller.number_type,
+ bc->caller.number_plan,
+ bc->caller.presentation,
+ bc->caller.screening);
+
+ cb_log(2, stack->port,
+ " --> redirecting:\"%s\" <%s> type:%d plan:%d pres:%d screen:%d reason:%d\n",
+ bc->redirecting.from.name,
+ bc->redirecting.from.number,
+ bc->redirecting.from.number_type,
+ bc->redirecting.from.number_plan,
+ bc->redirecting.from.presentation,
+ bc->redirecting.from.screening,
+ bc->redirecting.reason);
cb_log(2, stack->port,
- " --> info_dad:%s onumplan:%c dnumplan:%c rnumplan:%c cpnnumplan:%c\n",
- bc->info_dad,
- bc->onumplan>=0?'0'+bc->onumplan:' ',
- bc->dnumplan>=0?'0'+bc->dnumplan:' ',
- bc->rnumplan>=0?'0'+bc->rnumplan:' ',
- bc->cpnnumplan>=0?'0'+bc->cpnnumplan:' '
- );
+ " --> connected:\"%s\" <%s> type:%d plan:%d pres:%d screen:%d\n",
+ bc->connected.name,
+ bc->connected.number,
+ bc->connected.number_type,
+ bc->connected.number_plan,
+ bc->connected.presentation,
+ bc->connected.screening);
cb_log(3, stack->port, " --> caps:%s pi:%x keypad:%s sending_complete:%d\n", bearer2str(bc->capability),bc->progress_indicator, bc->keypad, bc->sending_complete);
- cb_log(4, stack->port, " --> screen:%d --> pres:%d\n",
- bc->screen, bc->pres);
+
+ cb_log(4, stack->port, " --> set_pres:%d pres:%d\n", bc->set_presentation, bc->presentation);
cb_log(4, stack->port, " --> addr:%x l3id:%x b_stid:%x layer_id:%x\n", bc->addr, bc->l3_id, bc->b_stid, bc->layer_id);
@@ -3373,7 +3440,12 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
stack = get_stack_by_bc(bc);
if (!stack) {
- cb_log(0,bc->port,"SENDEVENT: no Stack for event:%s oad:%s dad:%s \n", isdn_get_info(msgs_g, event, 0), bc->oad, bc->dad);
+ cb_log(0,bc->port,
+ "SENDEVENT: no Stack for event:%s caller:\"%s\" <%s> dialed:%s \n",
+ isdn_get_info(msgs_g, event, 0),
+ bc->caller.name,
+ bc->caller.number,
+ bc->dialed.number);
RETURN(-1,OUT);
}
@@ -3390,7 +3462,13 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
RETURN(0,OUT);
}
- cb_log(1, stack->port, "I SEND:%s oad:%s dad:%s pid:%d\n", isdn_get_info(msgs_g, event, 0), bc->oad, bc->dad, bc->pid);
+ cb_log(1, stack->port,
+ "I SEND:%s caller:\"%s\" <%s> dialed:%s pid:%d\n",
+ isdn_get_info(msgs_g, event, 0),
+ bc->caller.name,
+ bc->caller.number,
+ bc->dialed.number,
+ bc->pid);
cb_log(4, stack->port, " --> bc_state:%s\n",bc_state2str(bc->bc_state));
misdn_lib_log_ies(bc);
@@ -3431,7 +3509,14 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
if (misdn_cap_is_speech(bc->capability)) {
if ((event==EVENT_CONNECT)||(event==EVENT_RETRIEVE_ACKNOWLEDGE)) {
if ( *bc->crypt_key ) {
- cb_log(4, stack->port, " --> ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
+ cb_log(4, stack->port,
+ " --> ENABLING BLOWFISH channel:%d caller%d:\"%s\" <%s> dialed%d:%s\n",
+ bc->channel,
+ bc->caller.number_type,
+ bc->caller.name,
+ bc->caller.number,
+ bc->dialed.number_type,
+ bc->dialed.number);
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
}
@@ -3571,8 +3656,19 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
/* Later we should think about sending bchannel data directly to misdn. */
msg = isdn_msg_build_event(msgs_g, bc, event, stack->nt);
- msg_queue_tail(&stack->downqueue, msg);
- sem_post(&glob_mgr->new_msg);
+ if (!msg) {
+ /*
+ * The message was not built.
+ *
+ * NOTE: The only time that the message will fail to build
+ * is because the requested FACILITY message is not supported.
+ * A failed malloc() results in exit() being called.
+ */
+ RETURN(-1, OUT);
+ } else {
+ msg_queue_tail(&stack->downqueue, msg);
+ sem_post(&glob_mgr->new_msg);
+ }
OUT:
misdn_send_unlock(bc);
diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h
index 638df8a74..ff098c18b 100644
--- a/channels/misdn/isdn_lib.h
+++ b/channels/misdn/isdn_lib.h
@@ -96,15 +96,23 @@ enum misdn_err_e {
ENOCHAN=1
};
-
enum mISDN_NUMBER_PLAN {
- NUMPLAN_UNINITIALIZED=-1,
- NUMPLAN_INTERNATIONAL=0x1,
- NUMPLAN_NATIONAL=0x2,
- NUMPLAN_SUBSCRIBER=0x4,
- NUMPLAN_UNKNOWN=0x0
+ NUMPLAN_UNKNOWN = 0x0,
+ NUMPLAN_ISDN = 0x1, /* ISDN/Telephony numbering plan E.164 */
+ NUMPLAN_DATA = 0x3, /* Data numbering plan X.121 */
+ NUMPLAN_TELEX = 0x4, /* Telex numbering plan F.69 */
+ NUMPLAN_NATIONAL = 0x8,
+ NUMPLAN_PRIVATE = 0x9
};
+enum mISDN_NUMBER_TYPE {
+ NUMTYPE_UNKNOWN = 0x0,
+ NUMTYPE_INTERNATIONAL = 0x1,
+ NUMTYPE_NATIONAL = 0x2,
+ NUMTYPE_NETWORK_SPECIFIC = 0x3,
+ NUMTYPE_SUBSCRIBER = 0x4,
+ NUMTYPE_ABBREVIATED = 0x5
+};
enum event_response_e {
RESPONSE_IGNORE_SETUP_WITHOUT_CLOSE,
@@ -189,6 +197,19 @@ enum { /* progress indicators */
INFO_PI_INTERWORKING_NO_RELEASE_POST_ANSWER =0x13
};
+/*!
+ * \brief Q.931 encoded redirecting reason
+ */
+enum mISDN_REDIRECTING_REASON {
+ mISDN_REDIRECTING_REASON_UNKNOWN = 0x0,
+ mISDN_REDIRECTING_REASON_CALL_FWD_BUSY = 0x1, /* Call forwarding busy or called DTE busy */
+ mISDN_REDIRECTING_REASON_NO_REPLY = 0x2, /* Call forwarding no reply */
+ mISDN_REDIRECTING_REASON_DEFLECTION = 0x4, /* Call deflection */
+ mISDN_REDIRECTING_REASON_OUT_OF_ORDER = 0x9, /* Called DTE out of order */
+ mISDN_REDIRECTING_REASON_CALL_FWD_DTE = 0xA, /* Call forwarding by the called DTE */
+ mISDN_REDIRECTING_REASON_CALL_FWD = 0xF /* Call forwarding unconditional or systematic call redirection */
+};
+
enum { /*CODECS*/
INFO_CODEC_ULAW=2,
INFO_CODEC_ALAW=3
@@ -202,12 +223,81 @@ enum layer_e {
UNKNOWN
};
+/* Maximum phone number (address) length plus null terminator */
+#define MISDN_MAX_NUMBER_LEN (31 + 1)
+
+/* Maximum name length plus null terminator (From ECMA-164) */
+#define MISDN_MAX_NAME_LEN (50 + 1)
+
+/* Maximum subaddress length plus null terminator */
+#define MISDN_MAX_SUBADDRESS_LEN (23 + 1)
+
+/* Maximum keypad facility content length plus null terminator */
+#define MISDN_MAX_KEYPAD_LEN (31 + 1)
+
+/*! \brief Connected-Line/Calling/Redirecting ID info struct */
+struct misdn_party_id {
+ /*! \brief Number presentation restriction code
+ * 0=Allowed, 1=Restricted, 2=Unavailable
+ */
+ int presentation;
+
+ /*! \brief Number screening code
+ * 0=Unscreened, 1=Passed Screen, 2=Failed Screen, 3=Network Number
+ */
+ int screening;
+
+ /*! \brief Type-of-number in ISDN terms for the number */
+ enum mISDN_NUMBER_TYPE number_type;
+
+ /*! \brief Type-of-number numbering plan. */
+ enum mISDN_NUMBER_PLAN number_plan;
+
+ /*! \brief Subscriber Name
+ * \note The name is currently obtained from Asterisk for
+ * potential use in display ie's since basic ISDN does
+ * not support names directly.
+ */
+ char name[MISDN_MAX_NAME_LEN];
+
+ /*! \brief Phone number (Address) */
+ char number[MISDN_MAX_NUMBER_LEN];
+
+ /*! \brief Subaddress number */
+ char subaddress[MISDN_MAX_SUBADDRESS_LEN];
+};
+
+/*! \brief Redirecting information struct */
+struct misdn_party_redirecting {
+ /*! \brief Who is redirecting the call (Sent to the party the call is redirected toward) */
+ struct misdn_party_id from;
+
+ /*! \brief Reason a call is being redirected (Q.931 field value) */
+ enum mISDN_REDIRECTING_REASON reason;
+};
+/*! \brief B channel control structure */
struct misdn_bchannel {
/*! \brief B channel send locking structure */
struct send_lock *send_lock;
+ /*! \brief Originating/Caller ID information struct
+ * \note The number_type element is set to "localdialplan" in /etc/asterisk/misdn.conf for outgoing calls
+ * \note The number element can be set to "callerid" in /etc/asterisk/misdn.conf for outgoing calls
+ */
+ struct misdn_party_id caller;
+
+ /*! \brief Connected-Party/Connected-Line ID information struct
+ * \note The number_type element is set to "cpndialplan" in /etc/asterisk/misdn.conf for outgoing calls
+ */
+ struct misdn_party_id connected;
+
+ /*! \brief Redirecting information struct (Where a call diversion or transfer was invoked)
+ * \note The redirecting subaddress is not defined in Q.931 so it is not used.
+ */
+ struct misdn_party_redirecting redirecting;
+
/*! \brief TRUE if this is a dummy BC record */
int dummy;
@@ -326,26 +416,6 @@ struct misdn_bchannel {
/*! \brief TRUE if we will not use the jitter buffer system */
int nojitter;
- /*! \brief Type-of-number in ISDN terms for the dialed/called number
- * \note This value is set to "dialplan" in /etc/asterisk/misdn.conf for outgoing calls
- */
- enum mISDN_NUMBER_PLAN dnumplan;
-
- /*! \brief Type-of-number in ISDN terms for the redirecting number which a call diversion or transfer was invoked.
- * \note Collected from the incoming SETUP message but not used.
- */
- enum mISDN_NUMBER_PLAN rnumplan;
-
- /*! \brief Type-of-number in ISDN terms for the originating/calling number (Caller-ID)
- * \note This value is set to "localdialplan" in /etc/asterisk/misdn.conf for outgoing calls
- */
- enum mISDN_NUMBER_PLAN onumplan;
-
- /*! \brief Type-of-number in ISDN terms for the connected party number
- * \note This value is set to "cpndialplan" in /etc/asterisk/misdn.conf for outgoing calls
- */
- enum mISDN_NUMBER_PLAN cpnnumplan;
-
/*! \brief Progress Indicator IE coding standard field.
* \note Collected from the incoming messages but not used.
*/
@@ -421,16 +491,38 @@ struct misdn_bchannel {
*/
int stack_holder;
- /*! \brief Caller ID presentation restriction code
+ /*!
+ * \brief Put a display ie in the CONNECT message
+ * \details
+ * Put a display ie in the CONNECT message containing the following
+ * information if it is available (nt port only):
+ * 0 - Do not put the connected line information in the display ie.
+ * 1 - Put the available connected line name in the display ie.
+ * 2 - Put the available connected line number in the display ie.
+ * 3 - Put the available connected line name and number in the display ie.
+ */
+ int display_connected;
+
+ /*!
+ * \brief Put a display ie in the SETUP message
+ * \details
+ * Put a display ie in the SETUP message containing the following
+ * information if it is available (nt port only):
+ * 0 - Do not put the caller information in the display ie.
+ * 1 - Put the available caller name in the display ie.
+ * 2 - Put the available caller number in the display ie.
+ * 3 - Put the available caller name and number in the display ie.
+ */
+ int display_setup;
+
+ /*! \brief User set presentation restriction code
* 0=Allowed, 1=Restricted, 2=Unavailable
* \note It is settable by the misdn_set_opt() application.
*/
- int pres;
+ int presentation;
- /*! \brief Caller ID screening code
- * 0=Unscreened, 1=Passed Screen, 2=Failed Screen, 3=Network Number
- */
- int screen;
+ /*! \brief TRUE if the user set the presentation restriction code */
+ int set_presentation;
/*! \brief SETUP message bearer capability field code value */
int capability;
@@ -462,6 +554,23 @@ struct misdn_bchannel {
int hdlc;
/* V110 */
+ /*! \brief Dialed/Called information struct */
+ struct {
+ /*! \brief Type-of-number in ISDN terms for the dialed/called number
+ * \note This value is set to "dialplan" in /etc/asterisk/misdn.conf for outgoing calls
+ */
+ enum mISDN_NUMBER_TYPE number_type;
+
+ /*! \brief Type-of-number numbering plan. */
+ enum mISDN_NUMBER_PLAN number_plan;
+
+ /*! \brief Dialed/Called Phone Number (Address) */
+ char number[MISDN_MAX_NUMBER_LEN];
+
+ /*! \brief Dialed/Called Subaddress number */
+ char subaddress[MISDN_MAX_SUBADDRESS_LEN];
+ } dialed;
+
/*! \brief Display message that can be displayed by the user phone.
* \note Maximum displayable length is 34 or 82 octets.
* It is also settable by the misdn_set_opt() application.
@@ -469,39 +578,20 @@ struct misdn_bchannel {
char display[84];
/*! \brief Not used. Contents are setup but not used. */
- char msn[32];
-
- /*! \brief Originating/Calling Phone Number (Address)
- * \note This value can be set to "callerid" in /etc/asterisk/misdn.conf for outgoing calls
- */
- char oad[32];
-
- /*! \brief Redirecting Phone Number (Address) where a call diversion or transfer was invoked */
- char rad[32];
-
- /*! \brief Dialed/Called Phone Number (Address) */
- char dad[32];
-
- /*! \brief Connected Party/Line Phone Number (Address) */
- char cad[32];
-
- /*! \brief Original Dialed/Called Phone Number (Address) before national/international dialing prefix added.
- * \note Not used. Contents are setup but not used.
- */
- char orig_dad[32];
+ char msn[MISDN_MAX_NUMBER_LEN];
/*! \brief Q.931 Keypad Facility IE contents
* \note Contents exported and imported to Asterisk variable MISDN_KEYPAD
*/
- char keypad[32];
+ char keypad[MISDN_MAX_KEYPAD_LEN];
/*! \brief Current overlap dialing digits to/from INFORMATION messages */
- char info_dad[64];
+ char info_dad[MISDN_MAX_NUMBER_LEN];
/*! \brief Collected digits to go into info_dad[] while waiting for a SETUP_ACKNOWLEDGE to come in. */
- char infos_pending[64];
+ char infos_pending[MISDN_MAX_NUMBER_LEN];
-/* unsigned char info_keypad[32]; */
+/* unsigned char info_keypad[MISDN_MAX_KEYPAD_LEN]; */
/* unsigned char clisub[24]; */
/* unsigned char cldsub[24]; */
diff --git a/channels/misdn/isdn_lib_intern.h b/channels/misdn/isdn_lib_intern.h
index a4ddc7a49..3347fe335 100644
--- a/channels/misdn/isdn_lib_intern.h
+++ b/channels/misdn/isdn_lib_intern.h
@@ -41,7 +41,6 @@ struct send_lock {
struct isdn_msg {
unsigned long misdn_msg;
- enum layer_e layer;
enum event_e event;
void (*msg_parser)(struct isdn_msg *msgs, msg_t *msg, struct misdn_bchannel *bc, int nt);
diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c
index 6c4272ea0..01c084ff7 100644
--- a/channels/misdn/isdn_msg_parser.c
+++ b/channels/misdn/isdn_msg_parser.c
@@ -25,6 +25,42 @@
#include "ie.c"
+/*!
+ * \internal
+ * \brief Build the name, number, name/number display message string
+ *
+ * \param display Display buffer to fill in
+ * \param display_length Length of the display buffer to fill in
+ * \param display_format Display format enumeration
+ * \param name Name string to use
+ * \param number Number string to use
+ *
+ * \return Nothing
+ */
+static void build_display_str(char *display, size_t display_length, int display_format, const char *name, const char *number)
+{
+ display[0] = 0;
+ switch (display_format) {
+ default:
+ case 0: /* none */
+ break;
+
+ case 1: /* name */
+ snprintf(display, display_length, "%s", name);
+ break;
+
+ case 2: /* number */
+ snprintf(display, display_length, "%s", number);
+ break;
+
+ case 3: /* both */
+ if (name[0] || number[0]) {
+ snprintf(display, display_length, "\"%s\" <%s>", name, number);
+ }
+ break;
+ }
+}
+
static void set_channel(struct misdn_bchannel *bc, int channel)
{
@@ -161,62 +197,74 @@ static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchann
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_t *setup= (SETUP_t*)((unsigned long)msg->data+HEADER_LEN);
Q931_info_t *qi=(Q931_info_t*)((unsigned long)msg->data+HEADER_LEN);
+ int type;
+ int plan;
+ int present;
+ int screen;
+ int reason;
#ifdef DEBUG
printf("Parsing SETUP Msg\n");
#endif
- {
- int type,plan,present, screen;
- char id[32];
- dec_ie_calling_pn(setup->CALLING_PN, qi, &type, &plan, &present, &screen, id, sizeof(id)-1, nt,bc);
-
- bc->onumplan=type;
- strcpy(bc->oad, id);
- switch (present) {
- case 0:
- bc->pres=0; /* screened */
- break;
- case 1:
- bc->pres=1; /* not screened */
- break;
- default:
- bc->pres=0;
- }
- switch (screen) {
- case 0:
- break;
- default:
- ;
- }
- }
- {
- int type, plan;
- char number[32];
- dec_ie_called_pn(setup->CALLED_PN, (Q931_info_t *)setup, &type, &plan, number, sizeof(number)-1, nt,bc);
- strcpy(bc->dad, number);
- bc->dnumplan=type;
+
+ dec_ie_calling_pn(setup->CALLING_PN, qi, &type, &plan, &present, &screen, bc->caller.number, sizeof(bc->caller.number) - 1, nt, bc);
+ bc->caller.number_type = type;
+ bc->caller.number_plan = plan;
+ switch (present) {
+ default:
+ case 0:
+ bc->caller.presentation = 0; /* presentation allowed */
+ break;
+ case 1:
+ bc->caller.presentation = 1; /* presentation restricted */
+ break;
+ case 2:
+ bc->caller.presentation = 2; /* Number not available */
+ break;
}
- {
- char keypad[32];
- dec_ie_keypad(setup->KEYPAD, (Q931_info_t *)setup, keypad, sizeof(keypad)-1, nt,bc);
- strcpy(bc->keypad, keypad);
+ if (0 <= screen) {
+ bc->caller.screening = screen;
+ } else {
+ bc->caller.screening = 0; /* Unscreened */
}
- {
- dec_ie_complete(setup->COMPLETE, (Q931_info_t *)setup, &bc->sending_complete, nt,bc);
-
+ dec_ie_called_pn(setup->CALLED_PN, (Q931_info_t *) setup, &type, &plan, bc->dialed.number, sizeof(bc->dialed.number) - 1, nt, bc);
+ bc->dialed.number_type = type;
+ bc->dialed.number_plan = plan;
+
+ dec_ie_keypad(setup->KEYPAD, (Q931_info_t *) setup, bc->keypad, sizeof(bc->keypad) - 1, nt, bc);
+
+ dec_ie_complete(setup->COMPLETE, (Q931_info_t *) setup, &bc->sending_complete, nt, bc);
+
+ dec_ie_redir_nr(setup->REDIR_NR, (Q931_info_t *) setup, &type, &plan, &present, &screen, &reason, bc->redirecting.from.number, sizeof(bc->redirecting.from.number) - 1, nt, bc);
+ bc->redirecting.from.number_type = type;
+ bc->redirecting.from.number_plan = plan;
+ switch (present) {
+ default:
+ case 0:
+ bc->redirecting.from.presentation = 0; /* presentation allowed */
+ break;
+ case 1:
+ bc->redirecting.from.presentation = 1; /* presentation restricted */
+ break;
+ case 2:
+ bc->redirecting.from.presentation = 2; /* Number not available */
+ break;
}
-
- {
- int type, plan, present, screen, reason;
- char id[32];
- dec_ie_redir_nr(setup->REDIR_NR, (Q931_info_t *)setup, &type, &plan, &present, &screen, &reason, id, sizeof(id)-1, nt,bc);
-
- strcpy(bc->rad, id);
- bc->rnumplan=type;
+ if (0 <= screen) {
+ bc->redirecting.from.screening = screen;
+ } else {
+ bc->redirecting.from.screening = 0; /* Unscreened */
+ }
+ if (0 <= reason) {
+ bc->redirecting.reason = reason;
+ } else {
+ bc->redirecting.reason = mISDN_REDIRECTING_REASON_UNKNOWN;
}
+
{
int coding, capability, mode, rate, multi, user, async, urate, stopbits, dbits, parity;
+
dec_ie_bearer(setup->BEARER, (Q931_info_t *)setup, &coding, &capability, &mode, &rate, &multi, &user, &async, &urate, &stopbits, &dbits, &parity, nt,bc);
switch (capability) {
case -1: bc->capability=INFO_CAPABILITY_DIGITAL_UNRESTRICTED;
@@ -271,7 +319,7 @@ static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchann
}
-#define ANY_CHANNEL 0xff /* IE attribut for 'any channel' */
+#define ANY_CHANNEL 0xff /* IE attribute for 'any channel' */
static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
@@ -286,35 +334,43 @@ static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, in
enc_ie_channel_id(&setup->CHANNEL_ID, msg, 1, bc->channel, nt,bc);
- {
- int type=bc->onumplan,plan=1,present=bc->pres,screen=bc->screen;
- enc_ie_calling_pn(&setup->CALLING_PN, msg, type, plan, present,
- screen, bc->oad, nt, bc);
- }
+ enc_ie_calling_pn(&setup->CALLING_PN, msg, bc->caller.number_type, bc->caller.number_plan,
+ bc->caller.presentation, bc->caller.screening, bc->caller.number, nt, bc);
- {
- if (bc->dad[0])
- enc_ie_called_pn(&setup->CALLED_PN, msg, bc->dnumplan, 1, bc->dad, nt,bc);
+ if (bc->dialed.number[0]) {
+ enc_ie_called_pn(&setup->CALLED_PN, msg, bc->dialed.number_type, bc->dialed.number_plan, bc->dialed.number, nt, bc);
}
- {
- if (bc->rad[0])
- enc_ie_redir_nr(&setup->REDIR_NR, msg, 1, 1, bc->pres, bc->screen, 0, bc->rad, nt,bc);
+ if (bc->redirecting.from.number[0]) {
+ enc_ie_redir_nr(&setup->REDIR_NR, msg, bc->redirecting.from.number_type, bc->redirecting.from.number_plan,
+ bc->redirecting.from.presentation, bc->redirecting.from.screening, bc->redirecting.reason,
+ bc->redirecting.from.number, nt, bc);
}
- {
- if (bc->keypad[0])
- enc_ie_keypad(&setup->KEYPAD, msg, bc->keypad, nt,bc);
+ if (bc->keypad[0]) {
+ enc_ie_keypad(&setup->KEYPAD, msg, bc->keypad, nt,bc);
}
+
if (*bc->display) {
- enc_ie_display(&setup->DISPLAY, msg, bc->display, nt,bc);
+ enc_ie_display(&setup->DISPLAY, msg, bc->display, nt, bc);
+ } else if (nt && bc->caller.presentation == 0) {
+ char display[sizeof(bc->display)];
+
+ /* Presentation is allowed */
+ build_display_str(display, sizeof(display), bc->display_setup, bc->caller.name, bc->caller.number);
+ if (display[0]) {
+ enc_ie_display(&setup->DISPLAY, msg, display, nt, bc);
+ }
}
{
- int coding=0, capability, mode=0 /* 2 for packet ! */
- ,user, rate=0x10;
+ int coding = 0;
+ int capability;
+ int mode = 0; /* 2 for packet! */
+ int user;
+ int rate = 0x10;
switch (bc->law) {
case INFO_CODEC_ULAW: user=2;
@@ -340,8 +396,6 @@ static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, in
capability=bc->capability;
}
-
-
enc_ie_bearer(&setup->BEARER, msg, coding, capability, mode, rate, -1, user, nt,bc);
}
@@ -365,15 +419,36 @@ static void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bcha
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_t *connect=(CONNECT_t*)((unsigned long)(msg->data+HEADER_LEN));
+ int type;
+ int plan;
+ int pres;
+ int screen;
- int plan,pres,screen;
-
- bc->ces = connect->ces;
bc->ces = connect->ces;
dec_ie_progress(connect->PROGRESS, (Q931_info_t *)connect, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);
- dec_ie_connected_pn(connect->CONNECT_PN,(Q931_info_t *)connect, &bc->cpnnumplan, &plan, &pres, &screen, bc->cad, 31, nt, bc);
+ dec_ie_connected_pn(connect->CONNECT_PN, (Q931_info_t *) connect, &type, &plan,
+ &pres, &screen, bc->connected.number, sizeof(bc->connected.number) - 1, nt, bc);
+ bc->connected.number_type = type;
+ bc->connected.number_plan = plan;
+ switch (pres) {
+ default:
+ case 0:
+ bc->connected.presentation = 0; /* presentation allowed */
+ break;
+ case 1:
+ bc->connected.presentation = 1; /* presentation restricted */
+ break;
+ case 2:
+ bc->connected.presentation = 2; /* Number not available */
+ break;
+ }
+ if (0 <= screen) {
+ bc->connected.screening = screen;
+ } else {
+ bc->connected.screening = 0; /* Unscreened */
+ }
/*
cb_log(1,bc->port,"CONNETED PN: %s cpn_dialplan:%d\n", connected_pn, type);
@@ -400,9 +475,17 @@ static msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc,
enc_ie_date(&connect->DATE, msg, now, nt,bc);
}
- {
- int type=bc->cpnnumplan, plan=1, present=2, screen=0;
- enc_ie_connected_pn(&connect->CONNECT_PN, msg, type,plan, present, screen, bc->cad, nt , bc);
+ enc_ie_connected_pn(&connect->CONNECT_PN, msg, bc->connected.number_type, bc->connected.number_plan,
+ bc->connected.presentation, bc->connected.screening, bc->connected.number, nt, bc);
+
+ if (nt && bc->connected.presentation == 0) {
+ char display[sizeof(bc->display)];
+
+ /* Presentation is allowed */
+ build_display_str(display, sizeof(display), bc->display_connected, bc->connected.name, bc->connected.number);
+ if (display[0]) {
+ enc_ie_display(&connect->DISPLAY, msg, display, nt, bc);
+ }
}
#ifdef DEBUG
@@ -982,12 +1065,12 @@ static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bch
static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
- int len,
- HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN;
- unsigned char *ie_fac,
- fac_tmp[256];
- msg_t *msg =(msg_t*)create_l3msg(CC_FACILITY | REQUEST, MT_FACILITY, bc?bc->l3_id:-1, sizeof(FACILITY_t) ,nt);
- FACILITY_t *facility = (FACILITY_t*)(msg->data+HEADER_LEN);
+ int len;
+ int HEADER_LEN;
+ unsigned char *ie_fac;
+ unsigned char fac_tmp[256];
+ msg_t *msg;
+ FACILITY_t *facility;
Q931_info_t *qi;
#ifdef DEBUG
@@ -995,8 +1078,14 @@ static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc,
#endif
len = encodeFac(fac_tmp, &(bc->fac_out));
- if (len <= 0)
+ if (len <= 0) {
+ /* mISDN does not know how to build the requested facility structure */
return NULL;
+ }
+
+ msg = (msg_t *) create_l3msg(CC_FACILITY | REQUEST, MT_FACILITY, bc ? bc->l3_id : -1, sizeof(FACILITY_t), nt);
+ HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN;
+ facility = (FACILITY_t *) (msg->data + HEADER_LEN);
ie_fac = msg_put(msg, len);
if (bc->nt) {
@@ -1009,7 +1098,9 @@ static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc,
memcpy(ie_fac, fac_tmp, len);
if (*bc->display) {
+#ifdef DEBUG
printf("Sending %s as Display\n", bc->display);
+#endif
enc_ie_display(&facility->DISPLAY, msg, bc->display, nt,bc);
}
@@ -1062,15 +1153,11 @@ static void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
INFORMATION_t *information=(INFORMATION_t*)((unsigned long)(msg->data+HEADER_LEN));
- {
- int type, plan;
- char number[32];
- char keypad[32];
- dec_ie_called_pn(information->CALLED_PN, (Q931_info_t *)information, &type, &plan, number, sizeof(number)-1, nt, bc);
- dec_ie_keypad(information->KEYPAD, (Q931_info_t *)information, keypad, sizeof(keypad)-1, nt, bc);
- strcpy(bc->info_dad, number);
- strcpy(bc->keypad,keypad);
- }
+ int type, plan;
+
+ dec_ie_called_pn(information->CALLED_PN, (Q931_info_t *) information, &type, &plan, bc->info_dad, sizeof(bc->info_dad) - 1, nt, bc);
+ dec_ie_keypad(information->KEYPAD, (Q931_info_t *) information, bc->keypad, sizeof(bc->keypad) - 1, nt, bc);
+
#ifdef DEBUG
printf("Parsing INFORMATION Msg\n");
#endif
@@ -1084,13 +1171,13 @@ static msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *
information=(INFORMATION_t*)((msg->data+HEADER_LEN));
- {
- enc_ie_called_pn(&information->CALLED_PN, msg, 0, 1, bc->info_dad, nt,bc);
- }
+ enc_ie_called_pn(&information->CALLED_PN, msg, 0, 1, bc->info_dad, nt,bc);
{
if (*bc->display) {
+#ifdef DEBUG
printf("Sending %s as Display\n", bc->display);
+#endif
enc_ie_display(&information->DISPLAY, msg, bc->display, nt,bc);
}
}
@@ -1110,7 +1197,6 @@ static void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchan
dec_ie_cause(status->CAUSE, (Q931_info_t *)(status), &location, &cause, nt,bc);
if (cause>0) bc->cause=cause;
- ;
#ifdef DEBUG
printf("Parsing STATUS Msg\n");
@@ -1161,97 +1247,40 @@ static msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc,
/** Msg Array **/
struct isdn_msg msgs_g[] = {
- {CC_PROCEEDING,L3,EVENT_PROCEEDING,
- parse_proceeding,build_proceeding,
- "PROCEEDING"},
- {CC_ALERTING,L3,EVENT_ALERTING,
- parse_alerting,build_alerting,
- "ALERTING"},
- {CC_PROGRESS,L3,EVENT_PROGRESS,
- parse_progress,build_progress,
- "PROGRESS"},
- {CC_SETUP,L3,EVENT_SETUP,
- parse_setup,build_setup,
- "SETUP"},
- {CC_CONNECT,L3,EVENT_CONNECT,
- parse_connect,build_connect,
- "CONNECT"},
- {CC_SETUP_ACKNOWLEDGE,L3,EVENT_SETUP_ACKNOWLEDGE,
- parse_setup_acknowledge,build_setup_acknowledge,
- "SETUP_ACKNOWLEDGE"},
- {CC_CONNECT_ACKNOWLEDGE ,L3,EVENT_CONNECT_ACKNOWLEDGE ,
- parse_connect_acknowledge ,build_connect_acknowledge,
- "CONNECT_ACKNOWLEDGE "},
- {CC_USER_INFORMATION,L3,EVENT_USER_INFORMATION,
- parse_user_information,build_user_information,
- "USER_INFORMATION"},
- {CC_SUSPEND_REJECT,L3,EVENT_SUSPEND_REJECT,
- parse_suspend_reject,build_suspend_reject,
- "SUSPEND_REJECT"},
- {CC_RESUME_REJECT,L3,EVENT_RESUME_REJECT,
- parse_resume_reject,build_resume_reject,
- "RESUME_REJECT"},
- {CC_HOLD,L3,EVENT_HOLD,
- parse_hold,build_hold,
- "HOLD"},
- {CC_SUSPEND,L3,EVENT_SUSPEND,
- parse_suspend,build_suspend,
- "SUSPEND"},
- {CC_RESUME,L3,EVENT_RESUME,
- parse_resume,build_resume,
- "RESUME"},
- {CC_HOLD_ACKNOWLEDGE,L3,EVENT_HOLD_ACKNOWLEDGE,
- parse_hold_acknowledge,build_hold_acknowledge,
- "HOLD_ACKNOWLEDGE"},
- {CC_SUSPEND_ACKNOWLEDGE,L3,EVENT_SUSPEND_ACKNOWLEDGE,
- parse_suspend_acknowledge,build_suspend_acknowledge,
- "SUSPEND_ACKNOWLEDGE"},
- {CC_RESUME_ACKNOWLEDGE,L3,EVENT_RESUME_ACKNOWLEDGE,
- parse_resume_acknowledge,build_resume_acknowledge,
- "RESUME_ACKNOWLEDGE"},
- {CC_HOLD_REJECT,L3,EVENT_HOLD_REJECT,
- parse_hold_reject,build_hold_reject,
- "HOLD_REJECT"},
- {CC_RETRIEVE,L3,EVENT_RETRIEVE,
- parse_retrieve,build_retrieve,
- "RETRIEVE"},
- {CC_RETRIEVE_ACKNOWLEDGE,L3,EVENT_RETRIEVE_ACKNOWLEDGE,
- parse_retrieve_acknowledge,build_retrieve_acknowledge,
- "RETRIEVE_ACKNOWLEDGE"},
- {CC_RETRIEVE_REJECT,L3,EVENT_RETRIEVE_REJECT,
- parse_retrieve_reject,build_retrieve_reject,
- "RETRIEVE_REJECT"},
- {CC_DISCONNECT,L3,EVENT_DISCONNECT,
- parse_disconnect,build_disconnect,
- "DISCONNECT"},
- {CC_RESTART,L3,EVENT_RESTART,
- parse_restart,build_restart,
- "RESTART"},
- {CC_RELEASE,L3,EVENT_RELEASE,
- parse_release,build_release,
- "RELEASE"},
- {CC_RELEASE_COMPLETE,L3,EVENT_RELEASE_COMPLETE,
- parse_release_complete,build_release_complete,
- "RELEASE_COMPLETE"},
- {CC_FACILITY,L3,EVENT_FACILITY,
- parse_facility,build_facility,
- "FACILITY"},
- {CC_NOTIFY,L3,EVENT_NOTIFY,
- parse_notify,build_notify,
- "NOTIFY"},
- {CC_STATUS_ENQUIRY,L3,EVENT_STATUS_ENQUIRY,
- parse_status_enquiry,build_status_enquiry,
- "STATUS_ENQUIRY"},
- {CC_INFORMATION,L3,EVENT_INFORMATION,
- parse_information,build_information,
- "INFORMATION"},
- {CC_STATUS,L3,EVENT_STATUS,
- parse_status,build_status,
- "STATUS"},
- {CC_TIMEOUT,L3,EVENT_TIMEOUT,
- parse_timeout,build_timeout,
- "TIMEOUT"},
- {0,0,0,NULL,NULL,NULL}
+/* *INDENT-OFF* */
+ /* misdn_msg, event, msg_parser, msg_builder, info */
+ { CC_PROCEEDING, EVENT_PROCEEDING, parse_proceeding, build_proceeding, "PROCEEDING" },
+ { CC_ALERTING, EVENT_ALERTING, parse_alerting, build_alerting, "ALERTING" },
+ { CC_PROGRESS, EVENT_PROGRESS, parse_progress, build_progress, "PROGRESS" },
+ { CC_SETUP, EVENT_SETUP, parse_setup, build_setup, "SETUP" },
+ { CC_CONNECT, EVENT_CONNECT, parse_connect, build_connect, "CONNECT" },
+ { CC_SETUP_ACKNOWLEDGE, EVENT_SETUP_ACKNOWLEDGE, parse_setup_acknowledge, build_setup_acknowledge, "SETUP_ACKNOWLEDGE" },
+ { CC_CONNECT_ACKNOWLEDGE, EVENT_CONNECT_ACKNOWLEDGE, parse_connect_acknowledge, build_connect_acknowledge, "CONNECT_ACKNOWLEDGE " },
+ { CC_USER_INFORMATION, EVENT_USER_INFORMATION, parse_user_information, build_user_information, "USER_INFORMATION" },
+ { CC_SUSPEND_REJECT, EVENT_SUSPEND_REJECT, parse_suspend_reject, build_suspend_reject, "SUSPEND_REJECT" },
+ { CC_RESUME_REJECT, EVENT_RESUME_REJECT, parse_resume_reject, build_resume_reject, "RESUME_REJECT" },
+ { CC_HOLD, EVENT_HOLD, parse_hold, build_hold, "HOLD" },
+ { CC_SUSPEND, EVENT_SUSPEND, parse_suspend, build_suspend, "SUSPEND" },
+ { CC_RESUME, EVENT_RESUME, parse_resume, build_resume, "RESUME" },
+ { CC_HOLD_ACKNOWLEDGE, EVENT_HOLD_ACKNOWLEDGE, parse_hold_acknowledge, build_hold_acknowledge, "HOLD_ACKNOWLEDGE" },
+ { CC_SUSPEND_ACKNOWLEDGE, EVENT_SUSPEND_ACKNOWLEDGE, parse_suspend_acknowledge, build_suspend_acknowledge, "SUSPEND_ACKNOWLEDGE" },
+ { CC_RESUME_ACKNOWLEDGE, EVENT_RESUME_ACKNOWLEDGE, parse_resume_acknowledge, build_resume_acknowledge, "RESUME_ACKNOWLEDGE" },
+ { CC_HOLD_REJECT, EVENT_HOLD_REJECT, parse_hold_reject, build_hold_reject, "HOLD_REJECT" },
+ { CC_RETRIEVE, EVENT_RETRIEVE, parse_retrieve, build_retrieve, "RETRIEVE" },
+ { CC_RETRIEVE_ACKNOWLEDGE, EVENT_RETRIEVE_ACKNOWLEDGE, parse_retrieve_acknowledge, build_retrieve_acknowledge, "RETRIEVE_ACKNOWLEDGE" },
+ { CC_RETRIEVE_REJECT, EVENT_RETRIEVE_REJECT, parse_retrieve_reject, build_retrieve_reject, "RETRIEVE_REJECT" },
+ { CC_DISCONNECT, EVENT_DISCONNECT, parse_disconnect, build_disconnect, "DISCONNECT" },
+ { CC_RESTART, EVENT_RESTART, parse_restart, build_restart, "RESTART" },
+ { CC_RELEASE, EVENT_RELEASE, parse_release, build_release, "RELEASE" },
+ { CC_RELEASE_COMPLETE, EVENT_RELEASE_COMPLETE, parse_release_complete, build_release_complete, "RELEASE_COMPLETE" },
+ { CC_FACILITY, EVENT_FACILITY, parse_facility, build_facility, "FACILITY" },
+ { CC_NOTIFY, EVENT_NOTIFY, parse_notify, build_notify, "NOTIFY" },
+ { CC_STATUS_ENQUIRY, EVENT_STATUS_ENQUIRY, parse_status_enquiry, build_status_enquiry, "STATUS_ENQUIRY" },
+ { CC_INFORMATION, EVENT_INFORMATION, parse_information, build_information, "INFORMATION" },
+ { CC_STATUS, EVENT_STATUS, parse_status, build_status, "STATUS" },
+ { CC_TIMEOUT, EVENT_TIMEOUT, parse_timeout, build_timeout, "TIMEOUT" },
+ { 0, 0, NULL, NULL, NULL }
+/* *INDENT-ON* */
};
#define msgs_max (sizeof(msgs_g)/sizeof(struct isdn_msg))