diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index dffca516c8..0f414e7a90 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -283,6 +283,23 @@ struct ast_party_id { int number_presentation; }; +/*! + * \since 1.6.3 + * \brief Caller Party information. + * \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_caller { + struct ast_party_id id; /*! \brief Caller party ID */ + + /*! \brief Automatic Number Identification (ANI) (Malloced) */ + char *ani; + + /*! \brief Automatic Number Identification 2 (Info Digits) */ + int ani2; +}; + /*! * \since 1.6.3 * \brief Connected Line/Party information. @@ -2323,6 +2340,16 @@ struct ast_channel *ast_channel_get_by_exten(const char *exten, const char *cont void ast_channel_set_linkgroup(struct ast_channel *chan, struct ast_channel *peer); +/*! + * \since 1.6.3 + * \brief Initialize the given caller structure. + * + * \param init Caller structure to initialize. + * + * \return Nothing + */ +void ast_party_caller_init(struct ast_party_caller *init); + /*! * \since 1.6.3 * \brief Copy the source caller information to the destination caller. diff --git a/main/channel.c b/main/channel.c index eb6995c66f..2dba7eba2d 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1579,6 +1579,13 @@ static void ast_party_id_free(struct ast_party_id *doomed) } } +void ast_party_caller_init(struct ast_party_caller *init) +{ + ast_party_id_init(&init->id); + init->ani = NULL; + init->ani2 = 0; +} + void ast_party_caller_copy(struct ast_callerid *dest, const struct ast_callerid *src) { if (dest == src) {