Asterisk - The Open Source Telephony Project
18.5.0
|
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.
Typedefs | |
typedef struct callerid_state | CIDSTATE |
Functions | |
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_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_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... | |
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 AST_LIN2X | ( | a | ) | ((ast_format_cmp(codec, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) ? (AST_LIN2A(a)) : (AST_LIN2MU(a))) |
Definition at line 78 of file callerid.h.
Referenced by gen_tone(), and gen_tones().
#define AST_PRES_ALLOWED 0x00 |
Definition at line 324 of file callerid.h.
Referenced by add_id_headers(), add_privacy_header(), add_privacy_params(), add_rpid(), ast_party_id_presentation(), ast_to_misdn_pres(), handle_response_invite(), initreqprep(), is_colp_update_allowed(), misdn_facility_ie_handler(), misdn_to_ast_pres(), push_callinfo(), send_callinfo(), set_from_header(), set_id_from_rpid(), setsubstate(), and sip_call().
#define AST_PRES_ALLOWED_NETWORK_NUMBER (AST_PRES_ALLOWED | AST_PRES_NETWORK_NUMBER) |
Definition at line 338 of file callerid.h.
Referenced by add_rpid().
#define AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN (AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_FAILED_SCREEN) |
Definition at line 335 of file callerid.h.
Referenced by add_rpid().
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED (AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED) |
Definition at line 329 of file callerid.h.
Referenced by __ast_request_and_dial(), add_rpid(), ari_channels_handle_originate_with_id(), ast_party_name_init(), ast_party_number_init(), get_pai(), get_rpid(), pbx_outgoing_attempt(), privacy_exec(), and set_id_from_pai().
#define AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN (AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_PASSED_SCREEN) |
Definition at line 332 of file callerid.h.
Referenced by add_rpid(), check_access(), dial_exec_full(), and get_rpid().
#define AST_PRES_NETWORK_NUMBER 0x03 |
Definition at line 321 of file callerid.h.
Referenced by ast_to_misdn_screen(), and misdn_to_ast_screen().
#define AST_PRES_NUMBER_NOT_AVAILABLE (AST_PRES_UNAVAILABLE | AST_PRES_NETWORK_NUMBER) |
Definition at line 353 of file callerid.h.
Referenced by add_rpid(), ast_party_id_presentation(), check_access(), and iax2_call().
#define AST_PRES_NUMBER_TYPE 0x03 |
Definition at line 317 of file callerid.h.
Referenced by add_privacy_params(), ast_party_id_presentation(), and ast_to_misdn_screen().
#define AST_PRES_PROHIB_NETWORK_NUMBER (AST_PRES_RESTRICTED | AST_PRES_NETWORK_NUMBER) |
Definition at line 350 of file callerid.h.
Referenced by add_rpid().
#define AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN (AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_FAILED_SCREEN) |
Definition at line 347 of file callerid.h.
Referenced by add_rpid().
#define AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED (AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED) |
Definition at line 341 of file callerid.h.
Referenced by add_rpid(), get_pai(), get_rpid(), and set_id_from_pai().
#define AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN (AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_PASSED_SCREEN) |
Definition at line 344 of file callerid.h.
Referenced by add_rpid(), and get_rpid().
#define AST_PRES_RESERVED 0x60 |
Definition at line 327 of file callerid.h.
#define AST_PRES_RESTRICTED 0x20 |
Definition at line 325 of file callerid.h.
Referenced by ast_party_id_presentation(), ast_to_misdn_pres(), cb_events(), dialog_info_generate_body_content(), misdn_facility_ie_handler(), misdn_to_ast_pres(), set_id_from_rpid(), and state_notify_build_xml().
#define AST_PRES_RESTRICTION 0x60 |
Definition at line 323 of file callerid.h.
Referenced by add_id_headers(), add_privacy_header(), add_privacy_params(), add_rpid(), ast_party_id_presentation(), ast_to_misdn_pres(), dialog_info_generate_body_content(), handle_response_invite(), initreqprep(), is_colp_update_allowed(), push_callinfo(), send_callinfo(), set_from_header(), setsubstate(), sip_call(), and state_notify_build_xml().
#define AST_PRES_UNAVAILABLE 0x40 |
Definition at line 326 of file callerid.h.
Referenced by ast_party_id_presentation(), ast_to_misdn_pres(), and misdn_to_ast_pres().
#define AST_PRES_USER_NUMBER_FAILED_SCREEN 0x02 |
Definition at line 320 of file callerid.h.
Referenced by ast_to_misdn_screen(), and misdn_to_ast_screen().
#define AST_PRES_USER_NUMBER_PASSED_SCREEN 0x01 |
Definition at line 319 of file callerid.h.
Referenced by add_privacy_params(), ast_to_misdn_screen(), misdn_to_ast_screen(), and set_id_from_rpid().
#define AST_PRES_USER_NUMBER_UNSCREENED 0x00 |
Definition at line 318 of file callerid.h.
Referenced by ast_party_id_presentation(), ast_to_misdn_screen(), cb_events(), misdn_facility_ie_handler(), misdn_to_ast_screen(), and set_id_from_rpid().
#define AST_XLAW | ( | a | ) | ((ast_format_cmp(codec, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) ? (AST_ALAW(a)) : (AST_MULAW(a))) |
Definition at line 79 of file callerid.h.
Referenced by callerid_feed(), and callerid_feed_jp().
#define CID_MSGWAITING (1 << 4) |
Definition at line 56 of file callerid.h.
Referenced by callerid_feed(), mwi_thread(), and my_handle_notify_message().
#define CID_MWI_TYPE_MDMF 0x01 |
MWI MDMF format – generate only MWI field
Definition at line 74 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 76 of file callerid.h.
Referenced by ast_callerid_vmwi_generate(), and mwi_send_init().
#define CID_MWI_TYPE_SDMF 0x00 |
MWI SDMF format
Definition at line 72 of file callerid.h.
#define CID_NOMSGWAITING (1 << 5) |
Definition at line 57 of file callerid.h.
Referenced by callerid_feed(), mwi_thread(), and my_handle_notify_message().
#define CID_PRIVATE_NAME (1 << 0) |
Definition at line 52 of file callerid.h.
Referenced by callerid_feed(), callerid_genmsg(), and callerid_get().
#define CID_PRIVATE_NUMBER (1 << 1) |
Definition at line 53 of file callerid.h.
Referenced by callerid_feed(), callerid_genmsg(), callerid_get(), and callerid_get_dtmf().
#define CID_SIG_BELL 1 |
Definition at line 59 of file callerid.h.
Referenced by analog_new(), dahdi_chan_conf_default(), and process_dahdi().
#define CID_SIG_DTMF 3 |
Definition at line 61 of file callerid.h.
Referenced by __analog_ss_thread(), analog_ss_thread(), and process_dahdi().
#define CID_SIG_SMDI 5 |
Definition at line 63 of file callerid.h.
Referenced by __analog_ss_thread(), analog_ss_thread(), mkintf(), and process_dahdi().
#define CID_SIG_V23 2 |
Definition at line 60 of file callerid.h.
Referenced by __analog_ss_thread(), analog_ss_thread(), and process_dahdi().
#define CID_SIG_V23_JP 4 |
Definition at line 62 of file callerid.h.
Referenced by __analog_ss_thread(), analog_ss_thread(), my_get_callerid(), and process_dahdi().
#define CID_START_DTMF_NOALERT 4 |
Definition at line 68 of file callerid.h.
Referenced by analog_ss_thread(), do_monitor(), mkintf(), and process_dahdi().
#define CID_START_POLARITY 2 |
Definition at line 66 of file callerid.h.
Referenced by analog_ss_thread(), handle_init_event(), mkintf(), and process_dahdi().
#define CID_START_POLARITY_IN 3 |
Definition at line 67 of file callerid.h.
Referenced by analog_ss_thread(), handle_init_event(), mkintf(), and process_dahdi().
#define CID_START_RING 1 |
Definition at line 65 of file callerid.h.
Referenced by analog_ss_thread(), dahdi_chan_conf_default(), and process_dahdi().
#define CID_UNKNOWN_NAME (1 << 2) |
Definition at line 54 of file callerid.h.
Referenced by callerid_feed(), callerid_genmsg(), callerid_get(), and callerid_new().
#define CID_UNKNOWN_NUMBER (1 << 3) |
Definition at line 55 of file callerid.h.
Referenced by callerid_feed(), callerid_feed_jp(), callerid_genmsg(), callerid_get(), callerid_get_dtmf(), and callerid_new().
#define MAX_CALLERID_SIZE 32000 |
Definition at line 50 of file callerid.h.
Referenced by mwi_send_init(), my_send_callerid(), and send_cwcidspill().
#define PUT_AUDIO_SAMPLE | ( | y | ) |
Definition at line 283 of file callerid.h.
#define PUT_BYTE | ( | a | ) |
Definition at line 278 of file callerid.h.
Referenced by ast_callerid_vmwi_generate(), and callerid_generate().
#define PUT_CLID | ( | byte | ) |
Definition at line 304 of file callerid.h.
Referenced by adsi_generate(), ast_callerid_vmwi_generate(), callerid_generate(), and dahdi_sendtext().
#define PUT_CLID_BAUD | ( | bit | ) |
Definition at line 295 of file callerid.h.
#define PUT_CLID_MARKMS |
Definition at line 289 of file callerid.h.
Referenced by adsi_generate(), ast_callerid_vmwi_generate(), callerid_generate(), and dahdi_sendtext().
typedef struct callerid_state CIDSTATE |
Definition at line 83 of file callerid.h.
Connected line update source code.
Definition at line 442 of file callerid.h.
redirecting reason codes.
This list attempts to encompass redirecting reasons as defined by several channel technologies.
Definition at line 390 of file callerid.h.
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 1068 of file callerid.c.
References __ast_callerid_generate().
Referenced by my_send_callerid(), and send_cwcidspill().
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 1063 of file callerid.c.
References __ast_callerid_generate().
Referenced by my_send_callerid().
char* ast_callerid_merge | ( | char * | buf, |
int | bufsiz, | ||
const char * | name, | ||
const char * | num, | ||
const char * | unknown | ||
) |
Definition at line 1073 of file callerid.c.
References ast_copy_string(), ast_escape_quoted(), and buf.
Referenced by _sip_show_peer(), _skinny_show_line(), caller_id_to_str(), cdr_object_create_public_records(), cdr_object_format_property(), cli_show_channel(), cli_show_subscriptions_detail(), handle_cli_iax2_show_peer(), launch_monitor_thread(), leave_voicemail(), prep_email_sub_vars(), sip_show_user(), and sip_subscription_to_ami().
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, outputed 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. |
Definition at line 1008 of file callerid.c.
References ast_copy_string(), ast_isphonenumber(), ast_shrink_phone_number(), ast_strip(), ast_strip_quoted(), ast_unescape_quoted(), NULL, and tmp().
Referenced by action_originate(), adsi_message(), advanced_options(), ari_channels_handle_originate_with_id(), ast_callerid_split(), ast_privacy_check(), ast_privacy_set(), AST_TEST_DEFINE(), dial_exec_full(), handle_setcallerid(), misdn_new(), play_message_callerid(), read_config(), sip_msg_send(), unistim_new(), and vm_allocate_dh().
int ast_callerid_split | ( | const char * | src, |
char * | name, | ||
int | namelen, | ||
char * | num, | ||
int | numlen | ||
) |
Definition at line 1092 of file callerid.c.
References ast_callerid_parse(), ast_copy_string(), ast_shrink_phone_number(), ast_strdupa, NULL, and tmp().
Referenced by build_gateway(), build_peer(), build_user(), caller_id_handler(), callerid_read(), config_parse_variables(), disa_exec(), load_module(), parse_line(), party_id_write(), prep_email_sub_vars(), process_dahdi(), and store_callerid().
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 810 of file callerid.c.
References callerid_genmsg(), CID_MWI_TYPE_MDMF, CID_MWI_TYPE_MDMF_FULL, callerid_state::len, PUT_BYTE, PUT_CLID, and PUT_CLID_MARKMS.
Referenced by mwi_send_init().
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 1292 of file callerid.c.
References ARRAY_LEN, ast_value_translation::description, and value.
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 1305 of file callerid.c.
References ARRAY_LEN, ast_value_translation::name, and value.
Referenced by connectedline_read().
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 1279 of file callerid.c.
References ARRAY_LEN, callerid_state::name, and ast_value_translation::value.
Referenced by connectedline_write().
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 1164 of file callerid.c.
References ARRAY_LEN, ast_value_translation::description, and value.
Referenced by _sip_show_peer(), ast_json_party_id(), channel_callerid(), channel_new_callerid(), json_party_name(), json_party_number(), and sip_show_user().
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) |
Definition at line 261 of file callerid.c.
References casdi1, casdi2, casdr1, casdr2, gen_tone(), gen_tones(), callerid_state::pos, sasdi, and sasdr.
Referenced by __adsi_transmit_messages(), dahdi_callwait(), and my_callwait().
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 string is valid AST shrinkable phone number |
0 | if not |
Definition at line 1003 of file callerid.c.
References ast_is_valid_string().
Referenced by ari_channels_handle_originate_with_id(), check_peer_ok(), check_user_full(), get_pai(), and get_rpid().
int ast_isphonenumber | ( | const char * | n | ) |
Check if a string consists only of digits and + #.
n | number to be checked. |
Definition at line 998 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 1182 of file callerid.c.
References ARRAY_LEN, ast_value_translation::name, and value.
Referenced by caller_id_privacy_to_str(), cb_events(), party_id_read(), party_name_read(), party_number_read(), and redirecting_read().
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 1143 of file callerid.c.
References ARRAY_LEN, callerid_state::name, and ast_value_translation::value.
Referenced by build_peer(), caller_id_privacy_handler(), dial_exec_full(), party_id_write(), party_name_write(), party_number_write(), and redirecting_write().
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 1347 of file callerid.c.
References ARRAY_LEN, ast_value_translation::description, and value.
Referenced by json_party_name().
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 1334 of file callerid.c.
References ARRAY_LEN, callerid_state::name, and ast_value_translation::value.
Referenced by party_name_write().
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 1360 of file callerid.c.
References ARRAY_LEN, ast_value_translation::name, and value.
Referenced by party_name_read().
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 1236 of file callerid.c.
References ARRAY_LEN, ast_value_translation::description, and value.
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 1249 of file callerid.c.
References ARRAY_LEN, ast_strlen_zero, ast_party_redirecting_reason::code, ast_value_translation::name, ast_party_redirecting_reason::str, and value.
Referenced by redirecting_read().
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 1223 of file callerid.c.
References ARRAY_LEN, callerid_state::name, and ast_value_translation::value.
Referenced by get_rdnis(), handle_response_invite(), redirecting_write(), and set_redirecting_reason().
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 947 of file callerid.c.
Referenced by __analog_ss_thread(), action_originate(), analog_ss_thread(), ari_channels_handle_originate_with_id(), ast_callerid_parse(), ast_callerid_split(), ast_privacy_check(), ast_privacy_set(), check_access(), check_peer_ok(), check_user_full(), get_pai(), get_rpid(), handle_setcallerid(), pbx_load_config(), 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 545 of file callerid.c.
References ast_alloca, ast_copy_string(), ast_log, ast_strlen_zero, AST_XLAW, b, buf, CID_MSGWAITING, CID_NOMSGWAITING, CID_PRIVATE_NAME, CID_PRIVATE_NUMBER, CID_UNKNOWN_NAME, CID_UNKNOWN_NUMBER, callerid_state::cksum, callerid_state::flags, fsk_serial(), callerid_state::fskd, callerid_state::len, LOG_ERROR, LOG_NOTICE, LOG_WARNING, callerid_state::name, callerid_state::number, callerid_state::oldlen, callerid_state::oldstuff, callerid_state::pos, callerid_state::rawdata, callerid_state::sawflag, and callerid_state::type.
Referenced by analog_ss_thread(), mwi_thread(), and my_get_callerid().
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 306 of file callerid.c.
References ast_alloca, ast_copy_string(), ast_debug, ast_log, AST_XLAW, b, buf, calc_crc(), CID_UNKNOWN_NUMBER, callerid_state::crc, DEBUG_ATLEAST, callerid_state::flags, fsk_serial(), callerid_state::fskd, callerid_state::len, LOG_ERROR, LOG_NOTICE, LOG_WARNING, callerid_state::name, callerid_state::number, callerid_state::oldlen, callerid_state::oldstuff, callerid_state::pos, callerid_state::rawdata, callerid_state::sawflag, and callerid_state::skipflag.
Referenced by analog_ss_thread(), and my_get_callerid().
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 734 of file callerid.c.
References ast_free.
Referenced by analog_ss_thread(), mwi_thread(), and my_stop_cid_detect().
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 898 of file callerid.c.
References callerid_genmsg(), callerid_state::len, PUT_BYTE, PUT_CLID, and PUT_CLID_MARKMS.
Referenced by __ast_callerid_generate().
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) |
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:
Definition at line 188 of file callerid.c.
References CID_PRIVATE_NAME, CID_PRIVATE_NUMBER, CID_UNKNOWN_NAME, CID_UNKNOWN_NUMBER, callerid_state::flags, callerid_state::name, NULL, and callerid_state::number.
Referenced by analog_ss_thread(), mwi_thread(), and my_get_callerid().
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 201 of file callerid.c.
References ast_debug, ast_log, CID_PRIVATE_NUMBER, CID_UNKNOWN_NUMBER, and LOG_WARNING.
Referenced by __analog_ss_thread(), and analog_ss_thread().
|
inlinestatic |
void callerid_init | ( | void | ) |
CallerID Initialization.
CallerID Initialization.
Definition at line 115 of file callerid.c.
References CALLERID_MARK, CALLERID_SPACE, CAS_FREQ1, CAS_FREQ2, casdi1, casdi2, casdr1, casdr2, cid_di, cid_dr, cos, M_PI, SAS_FREQ, sasdi, and sasdr.
Referenced by asterisk_daemon().
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 129 of file callerid.c.
References ast_calloc, fsk_data::bw, CID_UNKNOWN_NAME, CID_UNKNOWN_NUMBER, fsk_data::f_mark_idx, fsk_data::f_space_idx, callerid_state::flags, callerid_state::fskd, fskmodem_init(), fsk_data::icont, fsk_data::instop, fsk_data::ispb, fsk_data::nbit, fsk_data::nstop, fsk_data::pllids, fsk_data::pllispb, fsk_data::pllispb2, and fsk_data::spb.
Referenced by analog_ss_thread(), mwi_thread(), and my_start_cid_detect().
float cid_di[4] |
Definition at line 64 of file callerid.c.
Referenced by callerid_getcarrier(), and callerid_init().
float cid_dr[4] |
Definition at line 64 of file callerid.c.
Referenced by callerid_getcarrier(), and callerid_init().
float clidsb |
Definition at line 65 of file callerid.c.