Index: include/asterisk/callerid.h =================================================================== --- include/asterisk/callerid.h (revision 48456) +++ include/asterisk/callerid.h (working copy) @@ -49,6 +49,7 @@ #define CID_PRIVATE_NUMBER (1 << 1) #define CID_UNKNOWN_NAME (1 << 2) #define CID_UNKNOWN_NUMBER (1 << 3) +#define CID_UNKNOWN_DATA (1 << 4) #define CID_SIG_BELL 1 #define CID_SIG_V23 2 @@ -59,6 +60,10 @@ #define CID_START_RING 1 #define CID_START_POLARITY 2 +#define CID_TYPE_SDMF_CLI 0x04 +#define CID_TYPE_SDMF_VM 0x06 +#define CID_TYPE_MDMF_CLI 0x80 +#define CID_TYPE_MDMF_CLI_VM 0x82 #define AST_LIN2X(a) ((codec == AST_FORMAT_ALAW) ? (AST_LIN2A(a)) : (AST_LIN2MU(a))) #define AST_XLAW(a) ((codec == AST_FORMAT_ALAW) ? (AST_ALAW(a)) : (AST_MULAW(a))) @@ -86,6 +91,13 @@ */ int callerid_generate(unsigned char *buf, const char *number, const char *name, int flags, int callwaiting, int codec); +/*! \brief Generate message waiting indicator (See callerid_generate for more info as it use the same encoding) + \param active The message indicator state either 0 no messages in mailbox or 1 messages in mailbox + \param type Format of message (0 for smdf format, 1 for mdmf with message indicator only, and 2 for mdmf with date, number, name and message indicator) + +*/ +int vmwi_generate(unsigned char *buf, int active, int type, int codec, const char *name, const char *number, int flags); + /*! \brief Create a callerID state machine * \param cid_signalling Type of signalling in use * @@ -132,6 +144,16 @@ */ void callerid_get(struct callerid_state *cid, char **number, char **name, int *flags); +/*! \brief Extract raw data from callerID state machine. + * \param cid Callerid state machine to act upon + * \param data Pass the address of a pointer-to-char (will contain the raw data) + * \param name len the address of a int variable (will contain the length of data) + * \param type Pass the address of an int variable (will contain the type of data one of CID_TYPE_*) + * + * \return Returns nothing. + */ +void callerid_get_rawdata(struct callerid_state *cid, char **data, int *len, int *type); + /*! Get and parse DTMF-based callerid */ /*! * \param cidstring The actual transmitted string. @@ -157,8 +179,16 @@ */ int ast_callerid_generate(unsigned char *buf, const char *name, const char *number, int codec); -/*! \brief Generate message waiting indicator (stutter tone) */ -int vmwi_generate(unsigned char *buf, int active, int mdmf, int codec); +/*! \brief Generate Message Waiting Indicator spill (mdmf with date, number and name fields set) + * \param buf buffer for output samples. + * \param active The message indicator state either 0 no messages in mailbox or 1 messages in mailbox + * \param name Caller-ID Name + * \param number Caller-ID Number + * \param codec Asterisk codec (either AST_FORMAT_ALAW or AST_FORMAT_ULAW) + * + * See vmwi_generate() for more info + */ +int ast_vmwi_generate(unsigned char *buf, int active, const char *name, const char *number, int codec); /*! \brief Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm) * See ast_callerid_generate() for other details