aboutsummaryrefslogtreecommitdiffstats
path: root/channels/misdn/isdn_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'channels/misdn/isdn_lib.h')
-rw-r--r--channels/misdn/isdn_lib.h202
1 files changed, 146 insertions, 56 deletions
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]; */