Asterisk - The Open Source Telephony Project
18.5.0
|
Asterisk internal frame definitions. More...
#include <sys/time.h>
#include "asterisk/format.h"
#include "asterisk/endian.h"
#include "asterisk/linkedlists.h"
Go to the source code of this file.
Data Structures | |
struct | ast_control_pvt_cause_code |
struct | ast_control_read_action_payload |
struct | ast_control_t38_parameters |
struct | ast_frame |
Data structure associated with a single frame of data. More... | |
struct | ast_frame_subclass |
struct | ast_option_header |
struct | oprmode |
Macros | |
#define | ast_frame_byteswap_be(fr) do { ; } while(0) |
#define | ast_frame_byteswap_le(fr) do { struct ast_frame *__f = (fr); ast_swapcopy_samples(__f->data.ptr, __f->data.ptr, __f->samples); } while(0) |
#define | AST_FRAME_DTMF AST_FRAME_DTMF_END |
#define | AST_FRAME_SET_BUFFER(fr, _base, _ofs, _datalen) |
#define | ast_frdup(fr) __ast_frdup(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Copies a frame. More... | |
#define | ast_frfree(fr) ast_frame_free(fr, 1) |
#define | AST_FRIENDLY_OFFSET 64 |
Offset into a frame's data buffer. More... | |
#define | ast_frisolate(fr) __ast_frisolate(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Makes a frame independent of any static storage. More... | |
#define | AST_HTML_BEGIN 4 |
#define | AST_HTML_DATA 2 |
#define | AST_HTML_END 8 |
#define | AST_HTML_LDCOMPLETE 16 |
#define | AST_HTML_LINKREJECT 20 |
#define | AST_HTML_LINKURL 18 |
#define | AST_HTML_NOSUPPORT 17 |
#define | AST_HTML_UNLINK 19 |
#define | AST_HTML_URL 1 |
#define | AST_MALLOCD_DATA (1 << 1) |
#define | AST_MALLOCD_HDR (1 << 0) |
#define | AST_MALLOCD_SRC (1 << 2) |
#define | AST_MIN_OFFSET 32 /*! Make sure we keep at least this much handy */ |
#define | AST_MODEM_T38 1 |
#define | AST_MODEM_V150 2 |
#define | AST_OPTION_AUDIO_MODE 4 |
#define | AST_OPTION_CC_AGENT_TYPE 17 |
#define | AST_OPTION_CHANNEL_WRITE 9 |
Handle channel write data If a channel needs to process the data from a func_channel write operation after func_channel_write executes, it can define the setoption callback and process this option. A pointer to an ast_chan_write_info_t will be passed. More... | |
#define | AST_OPTION_DEVICE_NAME 16 |
#define | AST_OPTION_DIGIT_DETECT 14 |
#define | AST_OPTION_ECHOCAN 8 |
#define | AST_OPTION_FAX_DETECT 15 |
#define | AST_OPTION_FLAG_ACCEPT 1 |
#define | AST_OPTION_FLAG_ANSWER 5 |
#define | AST_OPTION_FLAG_QUERY 4 |
#define | AST_OPTION_FLAG_REJECT 2 |
#define | AST_OPTION_FLAG_REQUEST 0 |
#define | AST_OPTION_FLAG_WTF 6 |
#define | AST_OPTION_FORMAT_READ 11 |
#define | AST_OPTION_FORMAT_WRITE 12 |
#define | AST_OPTION_MAKE_COMPATIBLE 13 |
#define | AST_OPTION_OPRMODE 7 |
#define | AST_OPTION_RELAXDTMF 3 |
#define | AST_OPTION_RXGAIN 6 |
#define | AST_OPTION_SECURE_MEDIA 19 |
#define | AST_OPTION_SECURE_SIGNALING 18 |
#define | AST_OPTION_T38_STATE 10 |
#define | AST_OPTION_TDD 2 |
#define | AST_OPTION_TONE_VERIFY 1 |
#define | AST_OPTION_TXGAIN 5 |
Functions | |
struct ast_frame * | __ast_frdup (const struct ast_frame *fr, const char *file, int line, const char *func) |
struct ast_frame * | __ast_frisolate (struct ast_frame *fr, const char *file, int line, const char *func) |
'isolates' a frame by duplicating non-malloc'ed components (header, src, data). On return all components are malloc'ed More... | |
int | ast_frame_adjust_volume (struct ast_frame *f, int adjustment) |
Adjusts the volume of the audio samples contained in a frame. More... | |
int | ast_frame_adjust_volume_float (struct ast_frame *f, float adjustment) |
Adjusts the volume of the audio samples contained in a frame. More... | |
int | ast_frame_clear (struct ast_frame *frame) |
Clear all audio samples from an ast_frame. The frame must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR. More... | |
void | ast_frame_dtor (struct ast_frame *frame) |
NULL-safe wrapper for ast_frfree, good for RAII_VAR. More... | |
void | ast_frame_dump (const char *name, struct ast_frame *f, char *prefix) |
struct ast_frame * | ast_frame_enqueue (struct ast_frame *head, struct ast_frame *f, int maxlen, int dupe) |
Appends a frame to the end of a list of frames, truncating the maximum length of the list. More... | |
void | ast_frame_free (struct ast_frame *fr, int cache) |
Requests a frame to be allocated. More... | |
int | ast_frame_slinear_sum (struct ast_frame *f1, struct ast_frame *f2) |
Sums two frames of audio samples. More... | |
char * | ast_frame_subclass2str (struct ast_frame *f, char *subclass, size_t slen, char *moreinfo, size_t mlen) |
Copy the discription of a frame's subclass into the provided string. More... | |
char * | ast_frame_type2str (enum ast_frame_type frame_type, char *ftype, size_t len) |
Copy the discription of a frame type into the provided string. More... | |
void | ast_swapcopy_samples (void *dst, const void *src, int samples) |
Variables | |
struct ast_frame | ast_null_frame |
Asterisk internal frame definitions.
Definition in file include/asterisk/frame.h.
#define ast_frame_byteswap_be | ( | fr | ) | do { ; } while(0) |
Definition at line 597 of file include/asterisk/frame.h.
Referenced by ast_rtp_interpret(), and socket_process_helper().
#define ast_frame_byteswap_le | ( | fr | ) | do { struct ast_frame *__f = (fr); ast_swapcopy_samples(__f->data.ptr, __f->data.ptr, __f->samples); } while(0) |
Definition at line 596 of file include/asterisk/frame.h.
Referenced by phone_read().
#define AST_FRAME_DTMF AST_FRAME_DTMF_END |
Definition at line 139 of file include/asterisk/frame.h.
Referenced by __adsi_transmit_messages(), __analog_ss_thread(), __ast_play_and_record(), action_atxfer(), action_cancel_atxfer(), action_dahdidialoffhook(), analog_ss_thread(), ast_audiohook_write_list(), ast_dsp_process(), ast_jb_put(), AST_TEST_DEFINE(), attended_transfer_exec(), background_detect_exec(), cb_events(), chan_pjsip_read_stream(), channel_spy(), cli_console_dial(), conf_run(), console_dial(), detect_callback(), dictate_exec(), disa_exec(), do_immediate_setup(), dtmf_info_incoming_request(), echo_exec(), eivr_comm(), fax_detect_framehook(), handle_incoming_request(), handle_recordfile(), handle_request(), handle_request_info(), handle_speechrecognize(), iax2_key_rotate(), keypad_cfg_read(), manager_play_dtmf(), mgcp_rtp_read(), misdn_write(), mp3_exec(), NBScat_exec(), ooh323_onReceivedDigit(), ooh323_rtp_read(), phone_exception(), process_ast_dsp(), read_mf_digits(), read_sf_digits(), receive_dtmf_digits(), record_exec(), send_waveform_to_channel(), sip_rtp_read(), speech_background(), stream_echo_perform(), unistim_do_senddigit(), volume_callback(), wait_exec(), wait_for_answer(), and wait_for_winner().
#define AST_FRAME_SET_BUFFER | ( | fr, | |
_base, | |||
_ofs, | |||
_datalen | |||
) |
Set the various field of a frame to point to a buffer. Typically you set the base address of the buffer, the offset as AST_FRIENDLY_OFFSET, and the datalen as the amount of bytes queued. The remaining things (to be done manually) is set the number of samples, which cannot be derived from the datalen unless you know the number of bits per sample.
Definition at line 208 of file include/asterisk/frame.h.
Referenced by fax_generator_generate(), g719read(), g723_read(), g726_read(), g729_read(), generic_read(), gsm_read(), h263_read(), h264_read(), ilbc_read(), mp3_read(), ogg_speex_read(), ogg_vorbis_read(), pcm_read(), siren14read(), siren7read(), spandsp_fax_gw_t30_gen(), spandsp_fax_read(), t38_tx_packet_handler(), vox_read(), and wav_read().
#define ast_frdup | ( | fr | ) | __ast_frdup(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Copies a frame.
fr | frame to copy Duplicates a frame – should only rarely be used, typically frisolate is good enough |
Definition at line 585 of file include/asterisk/frame.h.
Referenced by __ast_queue_frame(), ast_bridge_channel_queue_frame(), ast_bridge_queue_action(), ast_indicate_data(), ast_jb_put(), ast_rtp_read(), ast_rtp_write(), ast_slinfactory_feed(), audiohook_read_frame_both(), audiohook_read_frame_single(), autoservice_run(), bridge_channel_write_frame(), generate_interpolated_slin(), hook_event_cb(), mock_channel_read(), multicast_rtp_write(), ooh323_rtp_read(), process_dtmf_rfc2833(), recordthread(), smart_bridge_operation(), and t38_parameters_task_data_alloc().
#define ast_frfree | ( | fr | ) | ast_frame_free(fr, 1) |
Definition at line 556 of file include/asterisk/frame.h.
Referenced by __adsi_transmit_messages(), __analog_ss_thread(), __ast_answer(), __ast_play_and_record(), __ast_queue_frame(), __ast_read(), __ast_request_and_dial(), adsi_careful_send(), analog_ss_thread(), ast_autoservice_stop(), ast_channel_clear_softhangup(), ast_channel_destructor(), ast_dsp_process(), ast_frame_dtor(), ast_framehook_attach(), ast_indicate_data(), ast_jb_destroy(), ast_jb_put(), ast_queue_cc_frame(), ast_readaudio_callback(), ast_readvideo_callback(), ast_recvtext(), ast_rtp_interpret(), ast_rtp_write(), ast_send_image(), ast_sendtext_data(), ast_slinfactory_destroy(), ast_slinfactory_feed(), ast_slinfactory_flush(), ast_slinfactory_read(), AST_TEST_DEFINE(), ast_tonepair(), ast_transfer_protocol(), ast_translate(), ast_waitfordigit_full(), ast_write_stream(), ast_writestream(), async_agi_read_frame(), audio_audiohook_write_list(), audiohook_read_frame_helper(), audiosocket_run(), autoservice_run(), background_detect_exec(), bridge_channel_destroy(), bridge_channel_queue_deferred_frames(), bridge_frame_free(), bridge_handle_actions(), chan_cleanup(), chan_pjsip_cng_tone_detected(), chan_pjsip_read_stream(), channel_spy(), conf_flush(), conf_free(), conf_run(), create_jb(), dahdi_read(), destroy_all_channels(), detect_callback(), dial_exec_full(), dictate_exec(), disa_exec(), disable_t38(), do_waiting(), echo_exec(), eivr_comm(), fax_detect_framehook(), fax_gateway_framehook(), find_cache(), framehook_detach(), gen_generate(), generate_computational_cost(), generic_fax_exec(), handle_cli_file_convert(), handle_recordfile(), handle_speechrecognize(), hold_intercept_framehook(), hook_event_cb(), iax2_key_rotate(), ices_exec(), isAnsweringMachine(), jack_exec(), jb_empty_and_reset_adaptive(), jb_empty_and_reset_fixed(), jb_framedata_destroy(), jb_get_and_deliver(), jingle_read(), load_stream_readqueue(), measurenoise(), milliwatt_generate(), moh_channel_thread(), moh_files_generator(), monitor_dial(), mp3_exec(), multicast_rtp_write(), NBScat_exec(), ooh323_rtp_read(), read_frame(), read_test(), receive_dtmf_digits(), receivefax_t38_init(), record_exec(), recordthread(), run_agi(), safe_sleep_conditional(), send_waveform_to_channel(), sendfax_t38_init(), sendurl_exec(), session_destroy(), sip_read(), sip_rtp_read(), sms_exec(), sms_generate(), softmix_translate_helper_cleanup(), softmix_translate_helper_free_entry(), spandsp_fax_gw_t30_gen(), speech_background(), spy_generate(), stream_echo_perform(), suppress_framehook_event_cb(), t38_parameters_task_data_destroy(), t38_tx_packet_handler(), test_read_frames(), transmit_audio(), transmit_t38(), wait_for_answer(), wait_for_hangup(), wait_for_winner(), waitforring_exec(), and waitstream_core().
#define AST_FRIENDLY_OFFSET 64 |
Offset into a frame's data buffer.
By providing some "empty" space prior to the actual data of an ast_frame, this gives any consumer of the frame ample space to prepend other necessary information without having to create a new buffer.
As an example, RTP can use the data from an ast_frame and simply prepend the RTP header information into the space provided by AST_FRIENDLY_OFFSET instead of having to create a new buffer with the necessary space allocated.
Definition at line 229 of file include/asterisk/frame.h.
Referenced by __ast_frdup(), __ast_frisolate(), __get_from_jb(), adjust_frame_for_plc(), alsa_read(), ast_prod(), ast_rtcp_interpret(), ast_rtcp_read(), ast_rtp_interpret(), ast_rtp_read(), ast_smoother_read(), ast_udptl_read(), conf_run(), dahdi_read(), fax_generator_generate(), g719read(), g723_read(), g726_read(), g729_read(), generate_interpolated_slin(), generic_read(), gsm_read(), h263_read(), h264_read(), hook_event_cb(), iax_frame_wrap(), ilbc_read(), jb_get_and_deliver(), linear_generator(), mbl_read(), milliwatt_generate(), moh_generate(), mohalloc(), mp3_exec(), mp3_read(), NBScat_exec(), newpvt(), ogg_speex_read(), ogg_vorbis_read(), oss_read(), pcm_read(), phone_read(), playtones_generator(), process_cn_rfc3389(), send_waveform_to_channel(), siren14read(), siren7read(), sms_generate(), spandsp_fax_gw_t30_gen(), spandsp_fax_read(), tonepair_generator(), vox_read(), and wav_read().
#define ast_frisolate | ( | fr | ) | __ast_frisolate(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Makes a frame independent of any static storage.
fr | frame to act upon Take a frame, and if it's not been malloc'd, make a malloc'd copy and if the data hasn't been malloced then make the data malloc'd. If you need to store frames, say for queueing, then you should call this function. |
Definition at line 577 of file include/asterisk/frame.h.
Referenced by __ast_answer(), ast_audiosocket_receive_frame(), ast_dsp_process(), ast_rtp_interpret(), ast_slinfactory_feed(), ast_trans_frameout(), ast_write_stream(), autoservice_run(), create_test_frame(), dahdi_decoder_frameout(), dahdi_encoder_frameout(), detect_callback(), fax_gateway_framehook(), fax_gateway_request_t38(), hook_event_cb(), lintospeex_frameout(), read_frame(), safe_sleep_conditional(), spandsp_fax_gw_t30_gen(), spandsp_fax_read(), and t38_tx_packet_handler().
#define AST_HTML_BEGIN 4 |
Beginning frame
Definition at line 251 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_HTML_DATA 2 |
Data frame
Definition at line 249 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_HTML_END 8 |
End frame
Definition at line 253 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_HTML_LDCOMPLETE 16 |
Load is complete
Definition at line 255 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str(), and sendurl_exec().
#define AST_HTML_LINKREJECT 20 |
Reject link request
Definition at line 263 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_HTML_LINKURL 18 |
Send URL, and track
Definition at line 259 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_HTML_NOSUPPORT 17 |
Peer is unable to support HTML
Definition at line 257 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str(), and sendurl_exec().
#define AST_HTML_UNLINK 19 |
No more HTML linkage
Definition at line 261 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_HTML_URL 1 |
Sending a URL
Definition at line 247 of file include/asterisk/frame.h.
Referenced by ast_channel_sendurl(), ast_frame_subclass2str(), and sip_sendhtml().
#define AST_MALLOCD_DATA (1 << 1) |
Need the data be free'd?
Definition at line 235 of file include/asterisk/frame.h.
Referenced by __ast_frisolate(), __frame_free(), ast_audiosocket_receive_frame(), ast_cc_build_frame(), ast_sendtext_data(), and create_video_frame().
#define AST_MALLOCD_HDR (1 << 0) |
Need the header be free'd?
Definition at line 233 of file include/asterisk/frame.h.
Referenced by __ast_frdup(), __ast_frisolate(), __frame_free(), create_video_frame(), and make_silence().
#define AST_MALLOCD_SRC (1 << 2) |
Need the source be free'd? (haha!)
Definition at line 237 of file include/asterisk/frame.h.
Referenced by __ast_frisolate(), __frame_free(), and speex_callback().
#define AST_MIN_OFFSET 32 /*! Make sure we keep at least this much handy */ |
Definition at line 230 of file include/asterisk/frame.h.
Referenced by __ast_smoother_feed().
#define AST_MODEM_T38 1 |
T.38 Fax-over-IP
Definition at line 241 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str(), ast_udptl_write(), fax_gateway_framehook(), generic_fax_exec(), spandsp_fax_gateway_process(), t38_tx_packet_handler(), transmit_t38(), and udptl_rx_packet().
#define AST_MODEM_V150 2 |
V.150 Modem-over-IP
Definition at line 243 of file include/asterisk/frame.h.
Referenced by ast_frame_subclass2str().
#define AST_OPTION_AUDIO_MODE 4 |
Set (or clear) Audio (Not-Clear) Mode Option data is a single signed char value 0 or 1
Definition at line 443 of file include/asterisk/frame.h.
Referenced by bridge_channel_handle_control(), dahdi_hangup(), dahdi_setoption(), and iax2_setoption().
#define AST_OPTION_CC_AGENT_TYPE 17 |
Get the CC agent type from the channel (Read only) Option data is a character buffer of suitable length
Definition at line 510 of file include/asterisk/frame.h.
Referenced by ast_channel_get_cc_agent_type(), and dahdi_queryoption().
#define AST_OPTION_CHANNEL_WRITE 9 |
Handle channel write data If a channel needs to process the data from a func_channel write operation after func_channel_write executes, it can define the setoption callback and process this option. A pointer to an ast_chan_write_info_t will be passed.
Definition at line 474 of file include/asterisk/frame.h.
Referenced by ast_unreal_setoption(), and func_channel_write().
#define AST_OPTION_DEVICE_NAME 16 |
Get the device name from the channel (Read only) Option data is a character buffer of suitable length
Definition at line 506 of file include/asterisk/frame.h.
Referenced by ast_channel_get_device_name(), and sip_queryoption().
#define AST_OPTION_DIGIT_DETECT 14 |
Get or set the digit detection state of the channel Option data is a single signed char value 0 or 1
Definition at line 498 of file include/asterisk/frame.h.
Referenced by bridge_channel_handle_control(), dahdi_queryoption(), dahdi_setoption(), iax2_setoption(), ooh323_queryoption(), rcvfax_exec(), sip_queryoption(), sip_setoption(), and sndfax_exec().
#define AST_OPTION_ECHOCAN 8 |
Explicitly enable or disable echo cancelation for the given channel Option data is a single signed char value 0 or 1
Definition at line 466 of file include/asterisk/frame.h.
Referenced by dahdi_setoption().
#define AST_OPTION_FAX_DETECT 15 |
Get or set the fax tone detection state of the channel Option data is a single signed char value 0 or 1
Definition at line 502 of file include/asterisk/frame.h.
Referenced by bridge_channel_handle_control(), dahdi_queryoption(), dahdi_setoption(), iax2_setoption(), rcvfax_exec(), and sndfax_exec().
#define AST_OPTION_FLAG_ACCEPT 1 |
Definition at line 422 of file include/asterisk/frame.h.
#define AST_OPTION_FLAG_ANSWER 5 |
Definition at line 425 of file include/asterisk/frame.h.
#define AST_OPTION_FLAG_QUERY 4 |
Definition at line 424 of file include/asterisk/frame.h.
#define AST_OPTION_FLAG_REJECT 2 |
Definition at line 423 of file include/asterisk/frame.h.
#define AST_OPTION_FLAG_REQUEST 0 |
Definition at line 421 of file include/asterisk/frame.h.
Referenced by bridge_channel_handle_control(), and iax2_setoption().
#define AST_OPTION_FLAG_WTF 6 |
Definition at line 426 of file include/asterisk/frame.h.
#define AST_OPTION_FORMAT_READ 11 |
Request that the channel driver deliver frames in a specific format Option data is a format_t
Definition at line 484 of file include/asterisk/frame.h.
Referenced by sip_setoption().
#define AST_OPTION_FORMAT_WRITE 12 |
Request that the channel driver be prepared to accept frames in a specific format Option data is a format_t
Definition at line 488 of file include/asterisk/frame.h.
Referenced by sip_setoption().
#define AST_OPTION_MAKE_COMPATIBLE 13 |
Request that the channel driver make two channels of the same tech type compatible if possible Option data is an ast_channel
Definition at line 494 of file include/asterisk/frame.h.
#define AST_OPTION_OPRMODE 7 |
Definition at line 459 of file include/asterisk/frame.h.
Referenced by dahdi_setoption(), dial_exec_full(), and iax2_setoption().
#define AST_OPTION_RELAXDTMF 3 |
Relax the parameters for DTMF reception (mainly for radio use) Option data is a single signed char value 0 or 1
Definition at line 439 of file include/asterisk/frame.h.
Referenced by bridge_channel_handle_control(), dahdi_setoption(), and iax2_setoption().
#define AST_OPTION_RXGAIN 6 |
Set channel receive gain Option data is a single signed char representing number of decibels (dB) to set gain to (on top of any gain specified in channel driver)
Definition at line 453 of file include/asterisk/frame.h.
Referenced by dahdi_setoption(), func_channel_write_real(), iax2_setoption(), play_record_review(), reset_volumes(), set_talk_volume(), and vm_forwardoptions().
#define AST_OPTION_SECURE_MEDIA 19 |
Definition at line 515 of file include/asterisk/frame.h.
Referenced by iax2_queryoption(), iax2_setoption(), local_setoption(), set_security_requirements(), sip_queryoption(), and sip_setoption().
#define AST_OPTION_SECURE_SIGNALING 18 |
Get or set the security options on a channel Option data is an integer value of 0 or 1
Definition at line 514 of file include/asterisk/frame.h.
Referenced by iax2_queryoption(), iax2_setoption(), local_setoption(), set_security_requirements(), sip_queryoption(), and sip_setoption().
#define AST_OPTION_T38_STATE 10 |
Definition at line 480 of file include/asterisk/frame.h.
Referenced by ast_channel_get_t38_state(), ast_unreal_queryoption(), chan_pjsip_queryoption(), ooh323_queryoption(), and sip_queryoption().
#define AST_OPTION_TDD 2 |
Put a compatible channel into TDD (TTY for the hearing-impared) mode Option data is a single signed char value 0 or 1
Definition at line 435 of file include/asterisk/frame.h.
Referenced by analog_hangup(), bridge_channel_handle_control(), dahdi_hangup(), dahdi_setoption(), handle_tddmode(), and iax2_setoption().
#define AST_OPTION_TONE_VERIFY 1 |
Verify touchtones by muting audio transmission (and reception) and verify the tone is still present Option data is a single signed char value 0 or 1
Definition at line 431 of file include/asterisk/frame.h.
Referenced by analog_hangup(), bridge_channel_handle_control(), conf_run(), dahdi_hangup(), dahdi_setoption(), iax2_setoption(), and try_calling().
#define AST_OPTION_TXGAIN 5 |
Set channel transmit gain Option data is a single signed char representing number of decibels (dB) to set gain to (on top of any gain specified in channel driver)
Definition at line 448 of file include/asterisk/frame.h.
Referenced by common_exec(), dahdi_setoption(), func_channel_write_real(), iax2_setoption(), reset_volumes(), and set_listen_volume().
anonymous enum |
Definition at line 141 of file include/asterisk/frame.h.
Internal control frame subtype field values.
Enumerator | |
---|---|
AST_CONTROL_HANGUP | Other end has hungup |
AST_CONTROL_RING | Local ring |
AST_CONTROL_RINGING | Remote end is ringing |
AST_CONTROL_ANSWER | Remote end has answered |
AST_CONTROL_BUSY | Remote end is busy |
AST_CONTROL_TAKEOFFHOOK | Make it go off hook |
AST_CONTROL_OFFHOOK | Line is off hook |
AST_CONTROL_CONGESTION | Congestion (circuits busy) |
AST_CONTROL_FLASH | Flash hook |
AST_CONTROL_WINK | Wink |
AST_CONTROL_OPTION | Set a low-level option |
AST_CONTROL_RADIO_KEY | Key Radio |
AST_CONTROL_RADIO_UNKEY | Un-Key Radio |
AST_CONTROL_PROGRESS | Indicate PROGRESS |
AST_CONTROL_PROCEEDING | Indicate CALL PROCEEDING |
AST_CONTROL_HOLD | Indicate call is placed on hold |
AST_CONTROL_UNHOLD | Indicate call is left from hold |
AST_CONTROL_VIDUPDATE | Indicate video frame update |
_XXX_AST_CONTROL_T38 | T38 state change request/notification
|
AST_CONTROL_SRCUPDATE | Indicate source of media has changed |
AST_CONTROL_TRANSFER | Indicate status of a transfer request |
AST_CONTROL_CONNECTED_LINE | Indicate connected line has changed |
AST_CONTROL_REDIRECTING | Indicate redirecting id has changed |
AST_CONTROL_T38_PARAMETERS | T38 state change request/notification with parameters |
AST_CONTROL_CC | Indication that Call completion service is possible |
AST_CONTROL_SRCCHANGE | Media source has changed and requires a new RTP SSRC |
AST_CONTROL_READ_ACTION | Tell ast_read to take a specific action |
AST_CONTROL_AOC | Advice of Charge with encoded generic AOC payload |
AST_CONTROL_END_OF_Q | Indicate that this position was the end of the channel queue for a softhangup. |
AST_CONTROL_INCOMPLETE | Indication that the extension dialed is incomplete |
AST_CONTROL_MCID | Indicate that the caller is being malicious. |
AST_CONTROL_UPDATE_RTP_PEER | Interrupt the bridge and have it update the peer |
AST_CONTROL_PVT_CAUSE_CODE | Contains an update to the protocol-specific cause-code stored for branching dials |
AST_CONTROL_MASQUERADE_NOTIFY | A masquerade is about to begin/end. (Never sent as a frame but directly with ast_indicate_data().) |
AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE | Channel indication that a stream topology change has been requested |
AST_CONTROL_STREAM_TOPOLOGY_CHANGED | Channel indication that a stream topology change has occurred |
AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED | Channel indication that one of the source streams has changed its source |
AST_CONTROL_STREAM_STOP | Indicate to a channel in playback to stop the stream |
AST_CONTROL_STREAM_SUSPEND | Indicate to a channel in playback to suspend the stream |
AST_CONTROL_STREAM_RESTART | Indicate to a channel in playback to restart the stream |
AST_CONTROL_STREAM_REVERSE | Indicate to a channel in playback to rewind |
AST_CONTROL_STREAM_FORWARD | Indicate to a channel in playback to fast forward |
AST_CONTROL_RECORD_CANCEL | Indicated to a channel in record to stop recording and discard the file |
AST_CONTROL_RECORD_STOP | Indicated to a channel in record to stop recording |
AST_CONTROL_RECORD_SUSPEND | Indicated to a channel in record to suspend/unsuspend recording |
AST_CONTROL_RECORD_MUTE | Indicated to a channel in record to mute/unmute (i.e. write silence) recording |
Definition at line 277 of file include/asterisk/frame.h.
enum ast_control_t38 |
Definition at line 370 of file include/asterisk/frame.h.
enum ast_control_t38_rate |
Enumerator | |
---|---|
AST_T38_RATE_2400 | |
AST_T38_RATE_4800 | |
AST_T38_RATE_7200 | |
AST_T38_RATE_9600 | |
AST_T38_RATE_12000 | |
AST_T38_RATE_14400 |
Definition at line 379 of file include/asterisk/frame.h.
Enumerator | |
---|---|
AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF | |
AST_T38_RATE_MANAGEMENT_LOCAL_TCF |
Definition at line 392 of file include/asterisk/frame.h.
enum ast_control_transfer |
Enumerator | |
---|---|
AST_TRANSFER_SUCCESS | Transfer request on the channel worked |
AST_TRANSFER_FAILED | Transfer request on the channel failed |
Definition at line 408 of file include/asterisk/frame.h.
Actions to indicate to, and be handled on channel read.
The subtype to specify for an AST_CONTROL_READ_ACTION frame. These frames are then to be enacted on within a channel's read thread.
Enumerator | |
---|---|
AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO | |
AST_FRAME_READ_ACTION_SEND_TEXT | |
AST_FRAME_READ_ACTION_SEND_TEXT_DATA |
Definition at line 351 of file include/asterisk/frame.h.
enum ast_frame_type |
Frame types.
Enumerator | |
---|---|
AST_FRAME_DTMF_END | DTMF end event, subclass is the digit |
AST_FRAME_VOICE | Voice data, subclass is AST_FORMAT_* |
AST_FRAME_VIDEO | Video frame, maybe?? :) |
AST_FRAME_CONTROL | A control frame, subclass is AST_CONTROL_* |
AST_FRAME_NULL | An empty, useless frame |
AST_FRAME_IAX | Inter Asterisk Exchange private frame type |
AST_FRAME_TEXT | Text messages. The character data may not be zero-terminated, so care should be taken when passing it to functions that expect a zero-terminated string. The frame's datalen member should be used as it indicates the actual number of bytes available. |
AST_FRAME_IMAGE | Image Frames |
AST_FRAME_HTML | HTML Frame |
AST_FRAME_CNG | Comfort Noise frame (subclass is level of CNG in -dBov), body may include zero or more 8-bit quantization coefficients |
AST_FRAME_MODEM | Modem-over-IP data streams |
AST_FRAME_DTMF_BEGIN | DTMF begin event, subclass is the digit |
AST_FRAME_BRIDGE_ACTION | Internal bridge module action. |
AST_FRAME_BRIDGE_ACTION_SYNC | Internal synchronous bridge module action. Synchronous bridge actions may be queued onto bridge channels, but they absolutely must not ever be written directly into bridges. |
AST_FRAME_RTCP | RTCP feedback (the subclass will contain the payload type) |
AST_FRAME_TEXT_DATA | Text message in an ast_msg_data structure |
Definition at line 97 of file include/asterisk/frame.h.
struct ast_frame* __ast_frdup | ( | const struct ast_frame * | fr, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 305 of file main/frame.c.
References __ast_calloc(), ao2_bump, AST_CONTROL_ANSWER, ast_copy_flags, AST_FLAGS_ALL, AST_FRAME_CONTROL, AST_FRAME_IMAGE, AST_FRAME_TEXT, AST_FRAME_VIDEO, AST_FRAME_VOICE, AST_FRIENDLY_OFFSET, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_MALLOCD_HDR, ast_threadstorage_get(), buf, ast_frame::data, ast_frame::datalen, ast_frame::delivery, ast_frame_subclass::format, frame_cache, frames, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::len, len(), ast_frame_cache::list, ast_frame::mallocd, ast_frame::mallocd_hdr_len, NULL, ast_frame::offset, out, ast_frame::ptr, ast_frame::samples, ast_frame::seqno, ast_frame_cache::size, ast_frame::src, ast_frame::stream_num, ast_frame::subclass, ast_frame_subclass::topology, ast_frame::ts, and ast_frame::uint32.
Referenced by __ast_frisolate().
struct ast_frame* __ast_frisolate | ( | struct ast_frame * | fr, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
'isolates' a frame by duplicating non-malloc'ed components (header, src, data). On return all components are malloc'ed
Definition at line 197 of file main/frame.c.
References __ast_frdup(), ao2_bump, AST_CONTROL_ANSWER, ast_copy_flags, AST_FLAGS_ALL, ast_frame_free(), ast_frame_header_new(), AST_FRAME_IMAGE, AST_FRAME_TEXT, AST_FRAME_VIDEO, AST_FRAME_VOICE, AST_FRFLAG_HAS_TIMING_INFO, AST_FRIENDLY_OFFSET, ast_malloc, AST_MALLOCD_DATA, AST_MALLOCD_HDR, AST_MALLOCD_SRC, ast_strdup, ast_test_flag, ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::len, ast_frame::mallocd, NULL, ast_frame::offset, out, ast_frame::ptr, ast_frame::samples, ast_frame::seqno, ast_frame::src, ast_frame::stream_num, ast_frame::subclass, ast_frame_subclass::topology, ast_frame::ts, and ast_frame::uint32.
int ast_frame_adjust_volume | ( | struct ast_frame * | f, |
int | adjustment | ||
) |
Adjusts the volume of the audio samples contained in a frame.
f | The frame containing the samples (must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR) |
adjustment | The number of dB to adjust up or down. |
Definition at line 787 of file main/frame.c.
References abs, ast_format_cache_is_slinear(), AST_FRAME_VOICE, ast_slinear_saturated_divide(), ast_slinear_saturated_multiply(), ast_frame::data, ast_frame_subclass::format, ast_frame::frametype, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
Referenced by audiohook_read_frame_single(), audiohook_volume_callback(), and conf_run().
int ast_frame_adjust_volume_float | ( | struct ast_frame * | f, |
float | adjustment | ||
) |
Adjusts the volume of the audio samples contained in a frame.
f | The frame containing the samples (must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR) |
adjustment | The number of dB to adjust up or down. |
Definition at line 812 of file main/frame.c.
References ast_format_cache_is_slinear(), AST_FRAME_VOICE, ast_slinear_saturated_divide_float(), ast_slinear_saturated_multiply_float(), ast_frame::data, ast_frame_subclass::format, ast_frame::frametype, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
Referenced by volume_callback().
int ast_frame_clear | ( | struct ast_frame * | frame | ) |
Clear all audio samples from an ast_frame. The frame must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR.
Definition at line 859 of file main/frame.c.
References AST_LIST_NEXT, ast_frame::data, ast_frame::datalen, ast_frame::next, NULL, and ast_frame::ptr.
Referenced by audiohook_read_frame_single().
void ast_frame_dtor | ( | struct ast_frame * | frame | ) |
NULL-safe wrapper for ast_frfree, good for RAII_VAR.
frame | Frame to free, or head of list to free. |
Definition at line 187 of file main/frame.c.
References ast_frfree.
Referenced by __ast_play_and_record(), snoop_read(), and stasis_app_exec().
void ast_frame_dump | ( | const char * | name, |
struct ast_frame * | f, | ||
char * | prefix | ||
) |
Dump a frame for debugging purposes
Definition at line 731 of file main/frame.c.
References AST_FRAME_RTCP, ast_frame_subclass2str(), ast_frame_type2str(), AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_strlen_zero, ast_verb, COLOR_BLACK, COLOR_BRCYAN, COLOR_BRGREEN, COLOR_BRMAGENTA, COLOR_BRRED, COLOR_YELLOW, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::subclass, and term_color().
Referenced by __ast_read(), and ast_write_stream().
struct ast_frame* ast_frame_enqueue | ( | struct ast_frame * | head, |
struct ast_frame * | f, | ||
int | maxlen, | ||
int | dupe | ||
) |
Appends a frame to the end of a list of frames, truncating the maximum length of the list.
void ast_frame_free | ( | struct ast_frame * | fr, |
int | cache | ||
) |
Requests a frame to be allocated.
source | Request a frame be allocated. source is an optional source of the frame, len is the requested length, or "0" if the caller will supply the buffer |
Frees a frame or list of frames
fr | Frame to free, or head of list to free |
cache | Whether to consider this frame for frame caching |
Definition at line 176 of file main/frame.c.
References __frame_free(), AST_LIST_NEXT, and ast_frame::next.
Referenced by __ast_frisolate(), ast_rtp_read(), and mixmonitor_thread().
Sums two frames of audio samples.
f1 | The first frame (which will contain the result) |
f2 | The second frame |
The frames must be AST_FRAME_VOICE and must contain AST_FORMAT_SLINEAR samples, and must contain the same number of samples.
Definition at line 837 of file main/frame.c.
References ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_slin, AST_FRAME_VOICE, ast_slinear_saturated_add(), ast_frame::data, ast_frame_subclass::format, ast_frame::frametype, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
char* ast_frame_subclass2str | ( | struct ast_frame * | f, |
char * | subclass, | ||
size_t | slen, | ||
char * | moreinfo, | ||
size_t | mlen | ||
) |
Copy the discription of a frame's subclass into the provided string.
f | The frame to get the information from |
subclass | Buffer to fill with subclass information |
slen | Length of subclass buffer |
moreinfo | Buffer to fill with additional information |
mlen | Length of moreinfo buffer |
Definition at line 406 of file main/frame.c.
References AST_CONTROL_ANSWER, AST_CONTROL_AOC, AST_CONTROL_BUSY, AST_CONTROL_CC, AST_CONTROL_CONGESTION, AST_CONTROL_CONNECTED_LINE, AST_CONTROL_END_OF_Q, AST_CONTROL_FLASH, AST_CONTROL_HANGUP, AST_CONTROL_HOLD, AST_CONTROL_INCOMPLETE, AST_CONTROL_MASQUERADE_NOTIFY, AST_CONTROL_MCID, AST_CONTROL_OFFHOOK, AST_CONTROL_OPTION, AST_CONTROL_PROCEEDING, AST_CONTROL_PROGRESS, AST_CONTROL_PVT_CAUSE_CODE, AST_CONTROL_RADIO_KEY, AST_CONTROL_RADIO_UNKEY, AST_CONTROL_READ_ACTION, AST_CONTROL_RECORD_CANCEL, AST_CONTROL_RECORD_MUTE, AST_CONTROL_RECORD_STOP, AST_CONTROL_RECORD_SUSPEND, AST_CONTROL_REDIRECTING, AST_CONTROL_RING, AST_CONTROL_RINGING, AST_CONTROL_SRCCHANGE, AST_CONTROL_SRCUPDATE, AST_CONTROL_STREAM_FORWARD, AST_CONTROL_STREAM_RESTART, AST_CONTROL_STREAM_REVERSE, AST_CONTROL_STREAM_STOP, AST_CONTROL_STREAM_SUSPEND, AST_CONTROL_STREAM_TOPOLOGY_CHANGED, AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE, AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED, AST_CONTROL_T38_PARAMETERS, AST_CONTROL_TAKEOFFHOOK, AST_CONTROL_TRANSFER, AST_CONTROL_UNHOLD, AST_CONTROL_UPDATE_RTP_PEER, AST_CONTROL_VIDUPDATE, AST_CONTROL_WINK, ast_copy_string(), ast_format_get_name(), AST_FRAME_BRIDGE_ACTION, AST_FRAME_BRIDGE_ACTION_SYNC, AST_FRAME_CONTROL, AST_FRAME_DTMF_BEGIN, AST_FRAME_DTMF_END, AST_FRAME_HTML, AST_FRAME_IAX, AST_FRAME_IMAGE, AST_FRAME_MODEM, AST_FRAME_NULL, AST_FRAME_RTCP, AST_FRAME_TEXT, AST_HTML_BEGIN, AST_HTML_DATA, AST_HTML_END, AST_HTML_LDCOMPLETE, AST_HTML_LINKREJECT, AST_HTML_LINKURL, AST_HTML_NOSUPPORT, AST_HTML_UNLINK, AST_HTML_URL, AST_MODEM_T38, AST_MODEM_V150, AST_T38_NEGOTIATED, AST_T38_REFUSED, AST_T38_REQUEST_NEGOTIATE, AST_T38_REQUEST_TERMINATE, AST_T38_TERMINATED, ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::ptr, ast_control_t38_parameters::request_response, and ast_frame::subclass.
Referenced by ast_frame_dump(), and chan_pjsip_indicate().
char* ast_frame_type2str | ( | enum ast_frame_type | frame_type, |
char * | ftype, | ||
size_t | len | ||
) |
Copy the discription of a frame type into the provided string.
frame_type | The frame type to be described |
ftype | Buffer to fill with frame type description |
len | Length of subclass buffer |
Definition at line 671 of file main/frame.c.
References ast_copy_string(), AST_FRAME_BRIDGE_ACTION, AST_FRAME_BRIDGE_ACTION_SYNC, AST_FRAME_CONTROL, AST_FRAME_DTMF_BEGIN, AST_FRAME_DTMF_END, AST_FRAME_HTML, AST_FRAME_IAX, AST_FRAME_IMAGE, AST_FRAME_MODEM, AST_FRAME_NULL, AST_FRAME_RTCP, AST_FRAME_TEXT, AST_FRAME_TEXT_DATA, AST_FRAME_VIDEO, and AST_FRAME_VOICE.
Referenced by ast_frame_dump(), softmix_bridge_write_text(), and stream_echo_write_error().
void ast_swapcopy_samples | ( | void * | dst, |
const void * | src, | ||
int | samples | ||
) |
Definition at line 396 of file main/frame.c.
Referenced by __ast_smoother_feed(), iax_frame_wrap(), phone_write_buf(), and smoother_frame_feed().
struct ast_frame ast_null_frame |
Queueing a null frame is fairly common, so we declare a global null frame object for this purpose instead of having to declare one on the stack
Definition at line 79 of file main/frame.c.
Referenced by __analog_handle_event(), __ast_read(), apply_negotiated_sdp_stream(), ast_audiosocket_receive_frame(), ast_channel_set_unbridged_nolock(), ast_channel_setwhentohangup_tv(), ast_rtcp_interpret(), ast_rtcp_read(), ast_rtp_interpret(), ast_rtp_read(), ast_softhangup_nolock(), AST_TEST_DEFINE(), ast_translate(), ast_udptl_read(), ast_unreal_read(), bridge_channel_internal_push_full(), bridge_channel_poke(), chan_msg_read(), chan_pjsip_cng_tone_detected(), chan_pjsip_read_stream(), channel_do_masquerade(), conf_run(), console_read(), create_dtmf_frame(), dahdi_handle_event(), dahdi_read(), fake_read(), fax_detect_framehook(), fax_gateway_detect_t38(), fax_gateway_framehook(), handle_negotiated_sdp(), handle_request_invite(), handle_response_invite(), hold_intercept_framehook(), hook_event_cb(), iax2_read(), jb_get_adaptive(), jb_get_fixed(), jingle_read(), mbl_read(), media_session_rtcp_read_callback(), media_session_rtp_read_callback(), media_session_udptl_read_callback(), mgcp_rtp_read(), multicast_rtp_read(), nbs_xread(), ooh323_rtp_read(), parking_test_read(), process_sdp(), rec_read(), rtp_read(), set_interval_hook(), sip_read(), sip_rtp_read(), skinny_rtp_read(), snoop_read(), spandsp_fax_read(), stream_periodic_frames(), suppress_framehook_event_cb(), test_sip_rtpqos_1_read(), test_vm_api_mock_channel_read(), unistim_rtp_read(), and wakeup_sub().