summaryrefslogtreecommitdiff
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2009-10-22 16:33:22 +0000
committerRichard Mudgett <rmudgett@digium.com>2009-10-22 16:33:22 +0000
commit1174a6161274ee600f77089bff5f87a98f57bf4f (patch)
tree6e14b9b86b44349743912e3e737f8cbe8c706d22 /include/asterisk/channel.h
parent3acfd4933cf70974fda938fb2e7421d659aa87d0 (diff)
Add support for calling and called subaddress. Partial support for COLP subaddress.
The Telecom Specs in NZ suggests that SUB ADDRESS is always on, so doing "desk to desk" between offices each with an asterisk box over the ISDN should then be possible, without a whole load of DDI numbers required. (closes issue #15604) Reported by: alecdavis Patches: asterisk_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585) Some minor modificatons were made. Tested by: alecdavis, rmudgett Review: https://reviewboard.asterisk.org/r/405/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r--include/asterisk/channel.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 2b285ba8d..1edd0d883 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -185,6 +185,37 @@ struct ast_generator {
};
/*!
+ * \since 1.6.3
+ * \brief Information needed to specify a subaddress in a call.
+ * \note All string fields here are malloc'ed, so they need to be
+ * freed when the structure is deleted.
+ * \note NULL and "" must be considered equivalent.
+ */
+struct ast_party_subaddress {
+ /*!
+ * \brief Malloced subaddress string.
+ * \note If the subaddress type is user specified then the subaddress is
+ * a string of ASCII hex because the actual subaddress is likely BCD encoded.
+ */
+ char *str;
+ /*!
+ * \brief Q.931 subaddress type.
+ * \details
+ * nsap(0),
+ * user_specified(2)
+ */
+ int type;
+ /*!
+ * \brief TRUE if odd number of address signals
+ * \note The odd/even indicator is used when the type of subaddress is
+ * user_specified and the coding is BCD.
+ */
+ unsigned char odd_even_indicator;
+ /*! \brief TRUE if the subaddress information is valid/present */
+ unsigned char valid;
+};
+
+/*!
* \brief Structure for all kinds of caller ID identifications.
* \note All string fields here are malloc'ed, so they need to be
* freed when the structure is deleted.
@@ -260,6 +291,16 @@ struct ast_callerid {
* (Field will eventually move to struct ast_channel.dialed.transit_network_select)
*/
int cid_tns;
+ /*!
+ * \brief Caller id subaddress.
+ * (Field will eventually move to struct ast_channel.caller.id.subaddress)
+ */
+ struct ast_party_subaddress subaddress;
+ /*!
+ * \brief Dialed/Called subaddress.
+ * (Field will eventually move to struct ast_channel.dialed.subaddress)
+ */
+ struct ast_party_subaddress dialed_subaddress;
};
/*!
@@ -276,6 +317,9 @@ struct ast_party_id {
/*! \brief Subscriber name (Malloced) */
char *name;
+ /*! \brief Subscriber subaddress. */
+ struct ast_party_subaddress subaddress;
+
/*! \brief Q.931 encoded type-of-number/numbering-plan fields */
int number_type;
@@ -2342,6 +2386,67 @@ void ast_channel_set_linkgroup(struct ast_channel *chan, struct ast_channel *pee
/*!
* \since 1.6.3
+ * \brief Initialize the given subaddress structure.
+ *
+ * \param init Subaddress structure to initialize.
+ *
+ * \return Nothing
+ */
+void ast_party_subaddress_init(struct ast_party_subaddress *init);
+
+/*!
+ * \since 1.6.3
+ * \brief Copy the source party subaddress information to the destination party subaddress.
+ *
+ * \param dest Destination party subaddress
+ * \param src Source party subaddress
+ *
+ * \return Nothing
+ */
+void ast_party_subaddress_copy(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src);
+
+/*!
+ * \since 1.6.3
+ * \brief Initialize the given party subadress structure using the given guide
+ * for a set update operation.
+ *
+ * \details
+ * The initialization is needed to allow a set operation to know if a
+ * value needs to be updated. Simple integers need the guide's original
+ * value in case the set operation is not trying to set a new value.
+ * String values are simply set to NULL pointers if they are not going
+ * to be updated.
+ *
+ * \param init Party Subaddress structure to initialize.
+ * \param guide Source party subaddress to use as a guide in initializing.
+ *
+ * \return Nothing
+ */
+void ast_party_subaddress_set_init(struct ast_party_subaddress *init, const struct ast_party_subaddress *guide);
+
+/*!
+ * \since 1.6.3
+ * \brief Set the source party subaddress information into the destination party subaddress.
+ *
+ * \param dest Destination party subaddress
+ * \param src Source party subaddress
+ *
+ * \return Nothing
+ */
+void ast_party_subaddress_set(struct ast_party_subaddress *dest, const struct ast_party_subaddress *src);
+
+/*!
+ * \since 1.6.3
+ * \brief Destroy the party subaddress contents
+ *
+ * \param doomed The party subaddress to destroy.
+ *
+ * \return Nothing
+ */
+void ast_party_subaddress_free(struct ast_party_subaddress *doomed);
+
+/*!
+ * \since 1.6.3
* \brief Initialize the given caller structure.
*
* \param init Caller structure to initialize.