Asterisk - The Open Source Telephony Project
21.4.1
|
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata library. More...
#include "asterisk/format.h"
Go to the source code of this file.
Macros | |
#define | AST_LIN2X(a) ((ast_format_cmp(codec, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) ? (AST_LIN2A(a)) : (AST_LIN2MU(a))) |
#define | AST_PRES_ALLOWED 0x00 |
#define | AST_PRES_ALLOWED_NETWORK_NUMBER (AST_PRES_ALLOWED | AST_PRES_NETWORK_NUMBER) |
#define | AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN (AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_FAILED_SCREEN) |
#define | AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED (AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED) |
#define | AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN (AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_PASSED_SCREEN) |
#define | AST_PRES_NETWORK_NUMBER 0x03 |
#define | AST_PRES_NUMBER_NOT_AVAILABLE (AST_PRES_UNAVAILABLE | AST_PRES_NETWORK_NUMBER) |
#define | AST_PRES_NUMBER_TYPE 0x03 |
#define | AST_PRES_PROHIB_NETWORK_NUMBER (AST_PRES_RESTRICTED | AST_PRES_NETWORK_NUMBER) |
#define | AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN (AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_FAILED_SCREEN) |
#define | AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED (AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED) |
#define | AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN (AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_PASSED_SCREEN) |
#define | AST_PRES_RESERVED 0x60 |
#define | AST_PRES_RESTRICTED 0x20 |
#define | AST_PRES_RESTRICTION 0x60 |
#define | AST_PRES_UNAVAILABLE 0x40 |
#define | AST_PRES_USER_NUMBER_FAILED_SCREEN 0x02 |
#define | AST_PRES_USER_NUMBER_PASSED_SCREEN 0x01 |
#define | AST_PRES_USER_NUMBER_UNSCREENED 0x00 |
#define | AST_XLAW(a) ((ast_format_cmp(codec, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) ? (AST_ALAW(a)) : (AST_MULAW(a))) |
#define | CID_MSGWAITING (1 << 4) |
#define | CID_MWI_TYPE_MDMF 0x01 |
#define | CID_MWI_TYPE_MDMF_FULL 0x02 |
#define | CID_MWI_TYPE_SDMF 0x00 |
#define | CID_NOMSGWAITING (1 << 5) |
#define | CID_PRIVATE_NAME (1 << 0) |
#define | CID_PRIVATE_NUMBER (1 << 1) |
#define | CID_QUALIFIER (1 << 6) |
#define | CID_SIG_BELL 1 |
#define | CID_SIG_DTMF 3 |
#define | CID_SIG_SMDI 5 |
#define | CID_SIG_V23 2 |
#define | CID_SIG_V23_JP 4 |
#define | CID_START_DTMF_NOALERT 4 |
#define | CID_START_POLARITY 2 |
#define | CID_START_POLARITY_IN 3 |
#define | CID_START_RING 1 |
#define | CID_TYPE_MDMF 0x01 |
#define | CID_TYPE_SDMF 0x00 |
#define | CID_UNKNOWN_NAME (1 << 2) |
#define | CID_UNKNOWN_NUMBER (1 << 3) |
#define | MAX_CALLERID_SIZE 32000 |
#define | PUT_AUDIO_SAMPLE(y) |
#define | PUT_BYTE(a) |
#define | PUT_CLID(byte) |
#define | PUT_CLID_BAUD(bit) |
#define | PUT_CLID_MARKMS |
Typedefs | |
typedef struct callerid_state | CIDSTATE |
Enumerations | |
enum | AST_CONNECTED_LINE_UPDATE_SOURCE { AST_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN, AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER, AST_CONNECTED_LINE_UPDATE_SOURCE_DIVERSION, AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER, AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER_ALERTING } |
Connected line update source code. More... | |
enum | AST_REDIRECTING_REASON { AST_REDIRECTING_REASON_UNKNOWN, AST_REDIRECTING_REASON_USER_BUSY, AST_REDIRECTING_REASON_NO_ANSWER, AST_REDIRECTING_REASON_UNAVAILABLE, AST_REDIRECTING_REASON_UNCONDITIONAL, AST_REDIRECTING_REASON_TIME_OF_DAY, AST_REDIRECTING_REASON_DO_NOT_DISTURB, AST_REDIRECTING_REASON_DEFLECTION, AST_REDIRECTING_REASON_FOLLOW_ME, AST_REDIRECTING_REASON_OUT_OF_ORDER, AST_REDIRECTING_REASON_AWAY, AST_REDIRECTING_REASON_CALL_FWD_DTE, AST_REDIRECTING_REASON_SEND_TO_VM } |
redirecting reason codes. More... | |
Functions | |
int | ast_callerid_callwaiting_full_generate (unsigned char *buf, const char *name, const char *number, const char *ddn, int redirecting, int pres, int qualifier, struct ast_format *codec) |
Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm) More... | |
int | ast_callerid_callwaiting_full_tz_generate (unsigned char *buf, const char *name, const char *number, const char *ddn, int redirecting, int pres, int qualifier, struct ast_format *codec, const char *tz) |
Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm) More... | |
int | ast_callerid_callwaiting_generate (unsigned char *buf, const char *name, const char *number, struct ast_format *codec) |
Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm) More... | |
int | ast_callerid_full_generate (unsigned char *buf, const char *name, const char *number, const char *ddn, int redirecting, int pres, int qualifier, int format, struct ast_format *codec) |
Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format) More... | |
int | ast_callerid_full_tz_generate (unsigned char *buf, const char *name, const char *number, const char *ddn, int redirecting, int pres, int qualifier, int format, struct ast_format *codec, const char *tz) |
Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format) More... | |
int | ast_callerid_generate (unsigned char *buf, const char *name, const char *number, struct ast_format *codec) |
Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format) More... | |
char * | ast_callerid_merge (char *buf, int bufsiz, const char *name, const char *num, const char *unknown) |
int | ast_callerid_parse (char *instr, char **name, char **location) |
Destructively parse inbuf into name and location (or number) More... | |
int | ast_callerid_split (const char *src, char *name, int namelen, char *num, int numlen) |
int | ast_callerid_vmwi_generate (unsigned char *buf, int active, int type, struct ast_format *codec, const char *name, const char *number, int flags) |
Generate message waiting indicator. More... | |
const char * | ast_connected_line_source_describe (int data) |
Convert connected line update source value to explanatory string. More... | |
const char * | ast_connected_line_source_name (int data) |
Convert connected line update source value to text code. More... | |
int | ast_connected_line_source_parse (const char *data) |
Convert connected line update source text code to value (used in config file parsing) More... | |
const char * | ast_describe_caller_presentation (int data) |
Convert caller ID pres value to explanatory string. More... | |
int | ast_gen_cas (unsigned char *outbuf, int sas, int len, struct ast_format *codec) |
Generate a CAS (CPE Alert Signal) tone for 'n' samples. More... | |
int | ast_is_shrinkable_phonenumber (const char *exten) |
Check if a string consists only of digits and + # ( ) - . (meaning it can be cleaned with ast_shrink_phone_number) More... | |
int | ast_isphonenumber (const char *n) |
Check if a string consists only of digits and + #. More... | |
const char * | ast_named_caller_presentation (int data) |
Convert caller ID pres value to text code. More... | |
int | ast_parse_caller_presentation (const char *data) |
Convert caller ID text code to value (used in config file parsing) More... | |
const char * | ast_party_name_charset_describe (int data) |
Convert ast_party_name.char_set value to explanatory string. More... | |
int | ast_party_name_charset_parse (const char *data) |
Convert ast_party_name.char_set text code to value (used in config file parsing) More... | |
const char * | ast_party_name_charset_str (int data) |
Convert ast_party_name.char_set value to text code. More... | |
const char * | ast_redirecting_reason_describe (int data) |
Convert redirecting reason value to explanatory string. More... | |
const char * | ast_redirecting_reason_name (const struct ast_party_redirecting_reason *data) |
Convert redirecting reason value to text code. More... | |
int | ast_redirecting_reason_parse (const char *data) |
Convert redirecting reason text code to value (used in config file parsing) More... | |
void | ast_shrink_phone_number (char *n) |
Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s... More... | |
int | callerid_feed (struct callerid_state *cid, unsigned char *ubuf, int samples, struct ast_format *codec) |
Read samples into the state machine. More... | |
int | callerid_feed_jp (struct callerid_state *cid, unsigned char *ubuf, int samples, struct ast_format *codec) |
Read samples into the state machine. More... | |
void | callerid_free (struct callerid_state *cid) |
This function frees callerid_state cid. More... | |
int | callerid_full_generate (unsigned char *buf, const char *number, const char *name, const char *ddn, int redirecting, int flags, int format, int callwaiting, struct ast_format *codec) |
Generates a CallerID FSK stream in ulaw format suitable for transmission. More... | |
int | callerid_full_tz_generate (unsigned char *buf, const char *number, const char *name, const char *ddn, int redirecting, int flags, int format, int callwaiting, struct ast_format *codec, const char *tz) |
Generates a CallerID FSK stream in ulaw format suitable for transmission. More... | |
int | callerid_generate (unsigned char *buf, const char *number, const char *name, int flags, int callwaiting, struct ast_format *codec) |
Generates a CallerID FSK stream in ulaw format suitable for transmission. More... | |
void | callerid_get (struct callerid_state *cid, char **number, char **name, int *flags) |
Extract info out of callerID state machine. Flags are listed above. More... | |
void | callerid_get_dtmf (char *cidstring, char *number, int *flags) |
Get and parse DTMF-based callerid. More... | |
void | callerid_get_with_redirecting (struct callerid_state *cid, char **name, char **number, int *flags, int *redirecting) |
Extract info out of callerID state machine. Flags are listed above. More... | |
static float | callerid_getcarrier (float *cr, float *ci, int bit) |
void | callerid_init (void) |
CallerID Initialization. More... | |
struct callerid_state * | callerid_new (int cid_signalling) |
Create a callerID state machine. More... | |
Variables | |
float | cid_di [4] |
float | cid_dr [4] |
float | clidsb |
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata library.
Definition in file callerid.h.
#define CID_MWI_TYPE_MDMF 0x01 |
MWI MDMF format – generate only MWI field
Definition at line 81 of file callerid.h.
Referenced by ast_callerid_vmwi_generate().
#define CID_MWI_TYPE_MDMF_FULL 0x02 |
MWI MDMF format – generate name, callerid, date and MWI fields
Definition at line 83 of file callerid.h.
Referenced by ast_callerid_vmwi_generate().
#define CID_MWI_TYPE_SDMF 0x00 |
MWI SDMF format
Definition at line 79 of file callerid.h.
#define CID_TYPE_MDMF 0x01 |
MDMF - name, number, etc.
Definition at line 75 of file callerid.h.
Referenced by ast_callerid_callwaiting_full_generate(), ast_callerid_callwaiting_full_tz_generate(), ast_callerid_callwaiting_generate(), ast_callerid_generate(), ast_callerid_vmwi_generate(), and callerid_generate().
#define CID_TYPE_SDMF 0x00 |
SDMF - number only
Definition at line 73 of file callerid.h.
#define PUT_AUDIO_SAMPLE | ( | y | ) |
Definition at line 391 of file callerid.h.
#define PUT_BYTE | ( | a | ) |
Definition at line 386 of file callerid.h.
#define PUT_CLID_MARKMS |
Definition at line 397 of file callerid.h.
Connected line update source code.
Definition at line 550 of file callerid.h.
redirecting reason codes.
This list attempts to encompass redirecting reasons as defined by several channel technologies.
Definition at line 498 of file callerid.h.
int ast_callerid_callwaiting_full_generate | ( | unsigned char * | buf, |
const char * | name, | ||
const char * | number, | ||
const char * | ddn, | ||
int | redirecting, | ||
int | pres, | ||
int | qualifier, | ||
struct ast_format * | codec | ||
) |
Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
Definition at line 1253 of file callerid.c.
References CID_TYPE_MDMF.
int ast_callerid_callwaiting_full_tz_generate | ( | unsigned char * | buf, |
const char * | name, | ||
const char * | number, | ||
const char * | ddn, | ||
int | redirecting, | ||
int | pres, | ||
int | qualifier, | ||
struct ast_format * | codec, | ||
const char * | tz | ||
) |
Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
tz | TZ-format time zone for date/time (NULL for system default) |
Definition at line 1266 of file callerid.c.
References CID_TYPE_MDMF.
int ast_callerid_callwaiting_generate | ( | unsigned char * | buf, |
const char * | name, | ||
const char * | number, | ||
struct ast_format * | codec | ||
) |
Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
Definition at line 1242 of file callerid.c.
References CID_TYPE_MDMF.
int ast_callerid_full_generate | ( | unsigned char * | buf, |
const char * | name, | ||
const char * | number, | ||
const char * | ddn, | ||
int | redirecting, | ||
int | pres, | ||
int | qualifier, | ||
int | format, | ||
struct ast_format * | codec | ||
) |
Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format)
buf | buffer for output samples. See callerid_generate() for details regarding buffer. |
name | Caller-ID Name |
number | Caller-ID Number |
ddn | Dialable Directory Number (or NULL) |
redirecting | Redirecting Reason (-1 if N/A) |
pres | Presentation (0 for default) |
qualifier | Call Qualifier (0 for no, 1 for yes) |
format | Message Format |
codec | Asterisk codec (either AST_FORMAT_ALAW or AST_FORMAT_ULAW) |
Like ast_callerid_generate but with additional parameters.
Definition at line 1247 of file callerid.c.
int ast_callerid_full_tz_generate | ( | unsigned char * | buf, |
const char * | name, | ||
const char * | number, | ||
const char * | ddn, | ||
int | redirecting, | ||
int | pres, | ||
int | qualifier, | ||
int | format, | ||
struct ast_format * | codec, | ||
const char * | tz | ||
) |
Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format)
buf | buffer for output samples. See callerid_generate() for details regarding buffer. |
name | Caller-ID Name |
number | Caller-ID Number |
ddn | Dialable Directory Number (or NULL) |
redirecting | Redirecting Reason (-1 if N/A) |
pres | Presentation (0 for default) |
qualifier | Call Qualifier (0 for no, 1 for yes) |
format | Message Format |
codec | Asterisk codec (either AST_FORMAT_ALAW or AST_FORMAT_ULAW) |
tz | TZ-format time zone name to use for date/time (NULL for system default) |
Like ast_callerid_generate but with additional parameters.
Definition at line 1260 of file callerid.c.
int ast_callerid_generate | ( | unsigned char * | buf, |
const char * | name, | ||
const char * | number, | ||
struct ast_format * | codec | ||
) |
Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format)
buf | buffer for output samples. See callerid_generate() for details regarding buffer. |
name | Caller-ID Name |
number | Caller-ID Number |
codec | Asterisk codec (either AST_FORMAT_ALAW or AST_FORMAT_ULAW) |
Acts like callerid_generate except uses an asterisk format callerid string.
Definition at line 1237 of file callerid.c.
References CID_TYPE_MDMF.
int ast_callerid_parse | ( | char * | instr, |
char ** | name, | ||
char ** | location | ||
) |
Destructively parse inbuf into name and location (or number)
Parses callerid stream from inbuf and changes into useable form, outputted in name and location.
instr | buffer of callerid stream (in audio form) to be parsed. Warning, data in buffer is changed. |
name | address of a pointer-to-char for the name value of the stream. |
location | address of a pointer-to-char for the phone number value of the stream. |
0 | on success |
-1 | on failure |
Definition at line 1162 of file callerid.c.
References ast_copy_string(), ast_isphonenumber(), ast_shrink_phone_number(), ast_strip(), ast_strip_quoted(), and ast_unescape_quoted().
Referenced by advanced_options(), dial_exec_full(), and unistim_new().
int ast_callerid_vmwi_generate | ( | unsigned char * | buf, |
int | active, | ||
int | type, | ||
struct ast_format * | codec, | ||
const char * | name, | ||
const char * | number, | ||
int | flags | ||
) |
Generate message waiting indicator.
buf | |
active | The message indicator state – either 0 no messages in mailbox or 1 messages in mailbox |
type | Format of message (any of CID_MWI_TYPE_*) |
codec | |
name | |
number | |
flags |
Definition at line 952 of file callerid.c.
References CID_MWI_TYPE_MDMF, CID_MWI_TYPE_MDMF_FULL, and CID_TYPE_MDMF.
const char* ast_connected_line_source_describe | ( | int | data | ) |
Convert connected line update source value to explanatory string.
data | AST_CONNECTED_LINE_UPDATE_SOURCE from callerid.h |
Definition at line 1492 of file callerid.c.
const char* ast_connected_line_source_name | ( | int | data | ) |
Convert connected line update source value to text code.
data | AST_CONNECTED_LINE_UPDATE_SOURCE from callerid.h |
Definition at line 1505 of file callerid.c.
int ast_connected_line_source_parse | ( | const char * | data | ) |
Convert connected line update source text code to value (used in config file parsing)
data | text string from config file |
AST_CONNECTED_LINE_UPDATE_SOURCE | from callerid.h |
-1 | if not in table |
Definition at line 1479 of file callerid.c.
const char* ast_describe_caller_presentation | ( | int | data | ) |
Convert caller ID pres value to explanatory string.
data | AST_PRES_ value from callerid.h |
Definition at line 1364 of file callerid.c.
Referenced by ast_json_party_id().
int ast_gen_cas | ( | unsigned char * | outbuf, |
int | sas, | ||
int | len, | ||
struct ast_format * | codec | ||
) |
Generate a CAS (CPE Alert Signal) tone for 'n' samples.
outbuf | Allocated buffer for data. Must be at least 2400 bytes unless no SAS is desired |
sas | Non-zero if CAS should be preceeded by SAS |
len | How many samples to generate. |
codec | Which codec (AST_FORMAT_ALAW or AST_FORMAT_ULAW) |
-1 | on error (if len is less than 2400) |
0 | on success |
Definition at line 271 of file callerid.c.
int ast_is_shrinkable_phonenumber | ( | const char * | exten | ) |
Check if a string consists only of digits and + # ( ) - . (meaning it can be cleaned with ast_shrink_phone_number)
exten | The extension (or URI) to be checked. |
1 | if exten is valid AST shrinkable phone number |
0 | if not |
Definition at line 1157 of file callerid.c.
References ast_is_valid_string().
int ast_isphonenumber | ( | const char * | n | ) |
Check if a string consists only of digits and + #.
n | number to be checked. |
0 | if n is a number |
1 | if not |
Definition at line 1152 of file callerid.c.
References ast_is_valid_string().
Referenced by ast_callerid_parse(), and hfp_parse_clip().
const char* ast_named_caller_presentation | ( | int | data | ) |
Convert caller ID pres value to text code.
data | AST_PRES_ value from callerid.h |
Definition at line 1382 of file callerid.c.
int ast_parse_caller_presentation | ( | const char * | data | ) |
Convert caller ID text code to value (used in config file parsing)
data | text string from config file |
value | AST_PRES_ from callerid.h |
-1 | if not in table |
Definition at line 1343 of file callerid.c.
Referenced by dial_exec_full().
const char* ast_party_name_charset_describe | ( | int | data | ) |
Convert ast_party_name.char_set value to explanatory string.
data | AST_PARTY_CHAR_SET from channel.h |
Definition at line 1547 of file callerid.c.
int ast_party_name_charset_parse | ( | const char * | data | ) |
Convert ast_party_name.char_set text code to value (used in config file parsing)
data | text string from config file |
AST_PARTY_CHAR_SET | from channel.h |
-1 | if not in table |
Definition at line 1534 of file callerid.c.
const char* ast_party_name_charset_str | ( | int | data | ) |
Convert ast_party_name.char_set value to text code.
data | AST_PARTY_CHAR_SET from channel.h |
Definition at line 1560 of file callerid.c.
const char* ast_redirecting_reason_describe | ( | int | data | ) |
Convert redirecting reason value to explanatory string.
data | Q931_REDIRECTING_REASON from callerid.h |
Definition at line 1436 of file callerid.c.
const char* ast_redirecting_reason_name | ( | const struct ast_party_redirecting_reason * | data | ) |
Convert redirecting reason value to text code.
data | ast_party_redirecting_reason structure from channel.h |
Definition at line 1449 of file callerid.c.
References ast_party_redirecting_reason::code, and ast_party_redirecting_reason::str.
int ast_redirecting_reason_parse | ( | const char * | data | ) |
Convert redirecting reason text code to value (used in config file parsing)
data | text string from config file |
Q931_REDIRECTING_REASON | from callerid.h |
-1 | if not in table |
Definition at line 1423 of file callerid.c.
void ast_shrink_phone_number | ( | char * | n | ) |
Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s...
n | The number to be stripped/shrunk |
Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s...
Remove '(', ' ', ')', non-trailing '.', and '-' not in square brackets. Basically, remove anything that could be invalid in a pattern.
Definition at line 1101 of file callerid.c.
Referenced by ast_callerid_parse(), setup_privacy_args(), and write_metadata().
int callerid_feed | ( | struct callerid_state * | cid, |
unsigned char * | ubuf, | ||
int | samples, | ||
struct ast_format * | codec | ||
) |
Read samples into the state machine.
cid | Which state machine to act upon |
ubuf | containing your samples |
samples | number of samples contained within the buffer. |
codec | which codec (AST_FORMAT_ALAW or AST_FORMAT_ULAW) |
Send received audio to the Caller*ID demodulator.
-1 | on error |
0 | for "needs more samples" |
1 | if the CallerID spill reception is complete. |
Definition at line 570 of file callerid.c.
References ast_alloca, ast_copy_string(), ast_debug, and fsk_serial().
int callerid_feed_jp | ( | struct callerid_state * | cid, |
unsigned char * | ubuf, | ||
int | samples, | ||
struct ast_format * | codec | ||
) |
Read samples into the state machine.
cid | Which state machine to act upon |
ubuf | containing your samples |
samples | number of samples contained within the buffer. |
codec | which codec (AST_FORMAT_ALAW or AST_FORMAT_ULAW) |
Send received audio to the Caller*ID demodulator (for japanese style lines).
-1 | on error |
0 | for "needs more samples" |
1 | if the CallerID spill reception is complete. |
Definition at line 316 of file callerid.c.
References ast_alloca, ast_copy_string(), ast_debug, and fsk_serial().
void callerid_free | ( | struct callerid_state * | cid | ) |
This function frees callerid_state cid.
cid | This is the callerid_state state machine to free |
Definition at line 833 of file callerid.c.
int callerid_full_generate | ( | unsigned char * | buf, |
const char * | number, | ||
const char * | name, | ||
const char * | ddn, | ||
int | redirecting, | ||
int | flags, | ||
int | format, | ||
int | callwaiting, | ||
struct ast_format * | codec | ||
) |
Generates a CallerID FSK stream in ulaw format suitable for transmission.
buf | Buffer to use. If "buf" is supplied, it will use that buffer instead of allocating its own. "buf" must be at least 32000 bytes in size of you want to be sure you don't have an overrun. |
number | Use NULL for no number or "P" for "private" |
name | name to be used |
ddn | Dialable Directory Number (or NULL) |
redirecting | Redirecting reason |
flags | passed flags |
format | Message format |
callwaiting | callwaiting flag |
codec | – either AST_FORMAT_ULAW or AST_FORMAT_ALAW |
This function creates a stream of callerid (a callerid spill) data in ulaw format.
Definition at line 1044 of file callerid.c.
References callerid_full_tz_generate().
Referenced by callerid_generate().
int callerid_full_tz_generate | ( | unsigned char * | buf, |
const char * | number, | ||
const char * | name, | ||
const char * | ddn, | ||
int | redirecting, | ||
int | flags, | ||
int | format, | ||
int | callwaiting, | ||
struct ast_format * | codec, | ||
const char * | tz | ||
) |
Generates a CallerID FSK stream in ulaw format suitable for transmission.
buf | Buffer to use. If "buf" is supplied, it will use that buffer instead of allocating its own. "buf" must be at least 32000 bytes in size of you want to be sure you don't have an overrun. |
number | Use NULL for no number or "P" for "private" |
name | name to be used |
ddn | Dialable Directory Number (or NULL) |
redirecting | Redirecting reason |
flags | passed flags |
format | Message format |
callwaiting | callwaiting flag |
codec | – either AST_FORMAT_ULAW or AST_FORMAT_ALAW |
tz | TZ-format time zone to use for date/time (NULL for system default) |
This function creates a stream of callerid (a callerid spill) data in ulaw format.
Definition at line 1051 of file callerid.c.
Referenced by callerid_full_generate().
int callerid_generate | ( | unsigned char * | buf, |
const char * | number, | ||
const char * | name, | ||
int | flags, | ||
int | callwaiting, | ||
struct ast_format * | codec | ||
) |
Generates a CallerID FSK stream in ulaw format suitable for transmission.
buf | Buffer to use. If "buf" is supplied, it will use that buffer instead of allocating its own. "buf" must be at least 32000 bytes in size of you want to be sure you don't have an overrun. |
number | Use NULL for no number or "P" for "private" |
name | name to be used |
flags | passed flags |
callwaiting | callwaiting flag |
codec | – either AST_FORMAT_ULAW or AST_FORMAT_ALAW |
This function creates a stream of callerid (a callerid spill) data in ulaw format.
Definition at line 1039 of file callerid.c.
References callerid_full_generate(), and CID_TYPE_MDMF.
void callerid_get | ( | struct callerid_state * | cid, |
char ** | number, | ||
char ** | name, | ||
int * | flags | ||
) |
Extract info out of callerID state machine. Flags are listed above.
cid | Callerid state machine to act upon |
number | Pass the address of a pointer-to-char (will contain the phone number) |
name | Pass the address of a pointer-to-char (will contain the name) |
flags | Pass the address of an int variable (will contain the various callerid flags - presentation flags and call qualifier) |
This function extracts a callerid string out of a callerid_state state machine. If no number is found, *number will be set to NULL. Likewise for the name. Flags can contain any of the following: CID_PRIVATE_NAME, CID_PRIVATE_NUMBER, CID_UNKNOWN_NAME, CID_UNKNOWN_NUMBER, CID_MSGWAITING, CID_NOMSGWAITING, CID_QUALIFIER
Definition at line 205 of file callerid.c.
References callerid_get_with_redirecting().
void callerid_get_dtmf | ( | char * | cidstring, |
char * | number, | ||
int * | flags | ||
) |
Get and parse DTMF-based callerid.
cidstring | The actual transmitted string. |
number | The cid number is returned here. |
flags | The cid flags are returned here. |
Definition at line 211 of file callerid.c.
References ast_debug.
void callerid_get_with_redirecting | ( | struct callerid_state * | cid, |
char ** | name, | ||
char ** | number, | ||
int * | flags, | ||
int * | redirecting | ||
) |
Extract info out of callerID state machine. Flags are listed above.
cid | Callerid state machine to act upon | |
[out] | number | Pass the address of a pointer-to-char (will contain the phone number) |
[out] | name | Pass the address of a pointer-to-char (will contain the name) |
[out] | flags | Pass the address of an int variable (will contain the various callerid flags) |
[out] | redirecting | Pass the address of an int variable (will contain the redirecting reason, if received - presentation flags and call qualifier) |
This function extracts a callerid string out of a callerid_state state machine. If no number is found, *number will be set to NULL. Likewise for the name. Flags can contain any of the following: CID_PRIVATE_NAME, CID_PRIVATE_NUMBER, CID_UNKNOWN_NAME, CID_UNKNOWN_NUMBER, CID_MSGWAITING, CID_NOMSGWAITING, CID_QUALIFIER
Definition at line 189 of file callerid.c.
Referenced by callerid_get().
void callerid_init | ( | void | ) |
CallerID Initialization.
CallerID Initialization.
Definition at line 116 of file callerid.c.
References CALLERID_MARK, and CALLERID_SPACE.
struct callerid_state* callerid_new | ( | int | cid_signalling | ) |
Create a callerID state machine.
cid_signalling | Type of signalling in use |
This function returns a malloc'd instance of the callerid_state data structure.
Definition at line 130 of file callerid.c.
References ast_calloc, fsk_data::bw, fsk_data::f_mark_idx, fsk_data::f_space_idx, fsk_data::instop, fsk_data::nbit, fsk_data::nstop, fsk_data::pllispb, and fsk_data::spb.