libamsip 4.6.0
Data Structures | Functions

amsip init interface

General purpose API.

Data Structures

struct  am_audio_stats

Functions

int am_init (const char *name, int debug_level)
int am_reset (const char *name, int debug_level)
int am_option_debug (const char *log_file, int debug_level)
int am_quit (void)
char * am_option_get_version (void)
int am_option_set_option (int opt, void *arg)
int am_option_set_user_agent (const char *user_agent)
int am_option_set_initial_audio_port (int initial_port)
int am_option_enable_stun_server (const char *stun_server, int use_stun_server)
int am_option_enable_turn_server (const char *turn_server, int use_turn_server)
int am_option_enable_relay_server (const char *relay_server, int use_relay_server)
int am_option_set_ipv4_for_gateway (const char *ipv4_for_gateway)
int am_option_enable_rport (int enable)
int am_option_set_dns_capabilities (int dns_capabilities)
int am_option_enable_outbound_proxy (const char *outbound)
int am_option_enable_keepalive (int interval)
int am_option_set_audio_profile (const char *profile)
int am_option_set_video_profile (const char *profile)
int am_option_set_text_profile (const char *profile)
int am_option_set_udpftp_profile (const char *profile)
int am_option_enable_101 (int enable)
int am_option_enable_session_timers (int session_expires)
int am_option_enable_sdp_in_ack (int enable)
int am_option_enable_symmetric_rtp (int enable)
int am_option_find_out_sound_card (struct am_sndcard *sndcard)
int am_option_find_in_sound_card (struct am_sndcard *sndcard)
int am_option_select_in_sound_card (int card)
int am_option_select_out_sound_card (int card)
int am_option_select_in_custom_sound_card (MSSndCard *captcard)
int am_option_select_out_custom_sound_card (MSSndCard *playcard)
int am_option_set_volume_out_sound_card (int card, int mixer, int percent)
int am_option_get_volume_out_sound_card (int card, int mixer)
int am_option_set_volume_in_sound_card (int card, int percent)
int am_option_get_volume_in_sound_card (int card)
int am_option_set_mute_out_sound_card (int card, int mixer, int val)
int am_option_set_mute_in_sound_card (int card, int val)
int am_option_enable_echo_canceller (int enable, int frame_size, int tail_length)
int am_option_enable_vad (int enable, int vad_prob_start, int vad_prob_continue)
int am_option_enable_agc (int enable, int agc_level, int max_gain)
int am_option_set_password (const char *realm, const char *login, const char *passwd)
int am_option_set_password_for_username (const char *from_username, const char *realm, const char *login, const char *passwd)
int am_option_remove_password (void)
int am_option_load_plugins (const char *directory)
int am_option_enable_optionnal_encryption (int optionnal_encryption)
int am_option_add_nortpproxy (int add_nortpproxy)
int am_option_set_dscp_value (int dscp_value)
int am_option_set_sip_dscp (int dscp_value)
int am_option_set_audio_dscp (int dscp_value)
int am_option_set_video_dscp (int dscp_value)
int am_option_set_text_dscp (int dscp_value)
int am_option_set_udpftp_dscp (int dscp_value)
int am_option_add_dns_cache (const char *host, const char *ip)
int am_option_set_supported_extensions (const char *supported_extensions)
int am_option_set_accepted_types (const char *accepted_types)
int am_option_set_allowed_methods (const char *allowed_methods)
int am_option_set_allowed_events (const char *allowed_events)
int am_option_set_input_video_size (int width, int height)
int am_option_set_window_display (MSDisplayDesc *desc, long handle, int width, int height)
int am_option_set_window_handle (long handle, int width, int height)
int am_option_set_window_preview_handle (long handle, int width, int height)
int am_option_set_nowebcam (const char *nowebcam_image)
int am_option_enable_preview (int enable)
int am_option_set_image_callback (on_video_module_new_image_cb func)
int am_option_set_rate (int rate)
int am_option_set_callback (unsigned int id, MSFilterNotifyFunc speex_pp_process, void *userdata)
int am_option_set_volume_gain (float capture_gain, float playback_gain)
int am_option_set_echo_limitation (int enabled, float threshold, float speed, float force, int sustain)
int am_option_set_noise_gate_threshold (int enabled, float threshold)
int am_option_set_equalizer_state (int enable)
int am_option_set_equalizer_params (float freq, float gain, float width)
int am_option_set_mic_equalizer_state (int enable)
int am_option_set_mic_equalizer_params (float freq, float gain, float width)
int am_option_geteventsocket (void)

Function Documentation

int am_init ( const char *  name,
int  debug_level 
)

Initialize amsip library

Parameters:
nameText information for logging. (like vendor id)
debug_levelDebug level for application.
int am_reset ( const char *  name,
int  debug_level 
)

Reset amsip library

Parameters:
nameText information for logging. (like vendor id)
debug_levelDebug level for application.
int am_option_debug ( const char *  log_file,
int  debug_level 
)

Initialize log facility of library This method MUST be called only ONCE.

Parameters:
log_fileFile name for debugging
debug_levelDebug level for application.
int am_quit ( void  )

Close amsip library & release ressource.

char* am_option_get_version ( void  )

Get amsip version.

int am_option_set_option ( int  opt,
void *  arg 
)

Configure amsip options.

Parameters:
optoption.
argpointer to option value.
int am_option_set_user_agent ( const char *  user_agent)

Configure amsip to use User-Agent header value.

Parameters:
user_agentUser-Agent header.
int am_option_set_initial_audio_port ( int  initial_port)

Configure amsip to use a specific audio port.

Parameters:
initial_portinitial audio port.
int am_option_enable_stun_server ( const char *  stun_server,
int  use_stun_server 
)

Configure amsip to use stun server.

Parameters:
stun_serverIP of stun server.
use_stun_serverenable use of stun server
int am_option_enable_turn_server ( const char *  turn_server,
int  use_turn_server 
)

Configure amsip to use stun server. INCOMPLETE: the server MUST be actually a STUN server, this options currently ask for enabling STUN connectivity checks and candidates handling in SDP.

This is currently used to use ICE without TURN/relay server: Only STUN and LOCAL candidates.

Parameters:
turn_serverIP of stun server.
use_turn_serverenable use of stun server
int am_option_enable_relay_server ( const char *  relay_server,
int  use_relay_server 
)

Configure amsip to use turn server for relay.

EXPERIMENTAL: support for a real TURN server.

Parameters:
relay_serverIP of relay (turn) server.
use_relay_serverenable use of relay server
int am_option_set_ipv4_for_gateway ( const char *  ipv4_for_gateway)

Configure amsip to detect interface with a specific IP to reach. This method will have an impact on the IP put in the Via header, Contact header, and in the SDP connection address.

Parameters:
ipv4_for_gatewayspecific IP to reach.
int am_option_enable_rport ( int  enable)

Configure amsip to add "rport" parameter.

Parameters:
enable0: disable 1: enable
int am_option_set_dns_capabilities ( int  dns_capabilities)

Configure amsip and DNS capabilities:

use '2' for NAPTR+SRV support. use '1' for SRV support. use '0' for neither NAPTR nor SRV.

Parameters:
dns_capabilities0, 1 or 2
int am_option_enable_outbound_proxy ( const char *  outbound)

Configure amsip to use an outbound proxy (PLEASE DO NOT USE)

Parameters:
outboundproxy parameter.
int am_option_enable_keepalive ( int  interval)

Configure amsip to send empty UDP packets to keep alive binding behind NATs

Parameters:
interval0: disable X: interval in ms between each UDP packets (default: 25000)
int am_option_set_audio_profile ( const char *  profile)

Configure amsip to enable SRTP profile.

Parameters:
profileprofile string (RTP/AVP or RTP/SAVP)
int am_option_set_video_profile ( const char *  profile)

Configure amsip to enable SRTP profile.

Parameters:
profileprofile string (RTP/AVP or RTP/SAVP)
int am_option_set_text_profile ( const char *  profile)

Configure amsip to enable SRTP profile.

Parameters:
profileprofile string (RTP/AVP or RTP/SAVP)
int am_option_set_udpftp_profile ( const char *  profile)

Configure amsip to enable SRTP profile.

Parameters:
profileprofile string (RTP/AVP or RTP/SAVP)
int am_option_enable_101 ( int  enable)

Configure amsip to send 101

Parameters:
enable0: disable 1: enable
int am_option_enable_session_timers ( int  session_expires)

Configure amsip to enable session timer and set expiration interval

Parameters:
session_expires0: disable >0: set expiration interval
int am_option_enable_sdp_in_ack ( int  enable)

Configure amsip to put SDP in ACK

Parameters:
enable0: disable 1: enable
int am_option_enable_symmetric_rtp ( int  enable)

Configure amsip to use symmetric RTP for streaming

Parameters:
enable0: disable 1: enable
int am_option_find_out_sound_card ( struct am_sndcard *  sndcard)

Retreive card name from id number: sndcard.card = 0; am_option_find_out_sound_card(&sndcard);

Parameters:
card-1: default 0 to N: for selecting audio input
int am_option_find_in_sound_card ( struct am_sndcard *  sndcard)

Retreive card name from id number: sndcard.card = 0; am_option_find_in_sound_card(&sndcard);

Parameters:
card-1: default 0 to N: for selecting audio input
int am_option_select_in_sound_card ( int  card)

Configure amsip to use a specific audio card for recording audio

Parameters:
card-1: default 0 to N: for selecting audio input
int am_option_select_out_sound_card ( int  card)

Configure amsip to use a specific audio card for playing audio

Parameters:
card-1: default 0 to N: for selecting audio output
int am_option_select_in_custom_sound_card ( MSSndCard *  captcard)

Configure amsip to use a specific audio card for recording audio

Parameters:
captcardMSSndCard object pointer
int am_option_select_out_custom_sound_card ( MSSndCard *  playcard)

Configure amsip to use a specific audio card for playing audio

Parameters:
playcardMSSndCard object pointer
int am_option_set_volume_out_sound_card ( int  card,
int  mixer,
int  percent 
)

Configure amsip to set volume of playback card

Parameters:
card-1: default 0 to N: for selecting audio output
mixer0: master, 1: playback
percent0: no volume, 100: maximum volume
int am_option_get_volume_out_sound_card ( int  card,
int  mixer 
)

Configure amsip to get volume of playback card

Parameters:
card-1: default 0 to N: for selecting audio output
mixer0: master, 1: playback
int am_option_set_volume_in_sound_card ( int  card,
int  percent 
)

Configure amsip to set volume of capture card

Parameters:
card-1: default 0 to N: for selecting audio input
percent0: no volume, 100: maximum volume
int am_option_get_volume_in_sound_card ( int  card)

Configure amsip to get volume of capture card

Parameters:
card-1: default 0 to N: for selecting audio input
int am_option_set_mute_out_sound_card ( int  card,
int  mixer,
int  val 
)

Configure amsip to mute/unmute playback card

Parameters:
card-1: default 0 to N: for selecting audio output
mixer0: mixer, 1: playback
val0: unmute, 1: mute
int am_option_set_mute_in_sound_card ( int  card,
int  val 
)

Configure amsip to mute/unmute capture card

Parameters:
card-1: default 0 to N: for selecting audio output
val0: unmute, 1: mute
int am_option_enable_echo_canceller ( int  enable,
int  frame_size,
int  tail_length 
)

Configure amsip to enable or disable echo canceller.

Parameters:
enable0 to disable, 1 to enable
frame_sizeframe size for echo canceller (should be 128 or 160)
tail_lengthtail_length for echo canceller (should be 2048 or 4096)
int am_option_enable_vad ( int  enable,
int  vad_prob_start,
int  vad_prob_continue 
)

Configure amsip to enable or disable internal VAD -used to discard silence packets upon buffer overflow-. Please refer to speex documentation for values.

Parameters:
enable0 to disable, 1 to enable
vad_prob_startvalue for speex VAD_PROB_START (between 0 and 100)
vad_prob_continuevalue for speex VAD_PROB_CONTINUE (between 0 and 100)
int am_option_enable_agc ( int  enable,
int  agc_level,
int  max_gain 
)

Configure amsip to use AGC on MIC input. Please refer to speex documentation for values.

Parameters:
enable0 to disable, 1 to enable
agc_levelvalue for speex AGC_LEVEL
max_gainvalue for speex MAX_GAIN
int am_option_set_password ( const char *  realm,
const char *  login,
const char *  passwd 
)

Configure amsip to add new SĪP realm/login/password entry.

Parameters:
realmSIP realm on server.
loginSIP login on server.
passwdSIP password on server.
int am_option_set_password_for_username ( const char *  from_username,
const char *  realm,
const char *  login,
const char *  passwd 
)

Configure amsip to add new SĪP realm/login/password entry.

Parameters:
from_usernameSIP username which appears in From headers.
realmSIP realm on server.
loginSIP login on server.
passwdSIP password on server.
int am_option_remove_password ( void  )

Configure amsip to remove all previous SIP realm/login/password entries.

int am_option_load_plugins ( const char *  directory)

Configure amsip to read mediastreamer2 plugins from a specific directory.

Parameters:
directorydirectory on host.
int am_option_enable_optionnal_encryption ( int  optionnal_encryption)

Configure amsip to suppport optionnal encryption (using RTP/AVP).

Parameters:
optionnal_encryption0 to disable, 1 to enable.
int am_option_add_nortpproxy ( int  add_nortpproxy)

Configure amsip to add a=nortpproxy attribute in SDP.

Parameters:
add_nortpproxy0 to not add, 1 to add the attribute.
int am_option_set_dscp_value ( int  dscp_value)

Configure amsip to use a specific DSCP value in RTP streams. DEPRECATED: use instead: am_option_set_audio_dscp am_option_set_video_dscp am_option_set_text_dscp am_option_set_udpftp_dscp

Parameters:
dscp_valueDSCP value to use in RTP streams.
int am_option_set_sip_dscp ( int  dscp_value)

Configure amsip to use a specific DSCP value in SIP streams. Note: may not work on windows platform.

Parameters:
dscp_valueDSCP value to use in SIP streams.
int am_option_set_audio_dscp ( int  dscp_value)

Configure amsip to use a specific DSCP value in audio RTP streams (default is 0x38).

Parameters:
dscp_valueDSCP value to use in audio RTP streams.
int am_option_set_video_dscp ( int  dscp_value)

Configure amsip to use a specific DSCP value in video RTP streams (default is 0x28).

Parameters:
dscp_valueDSCP value to use in video RTP streams.
int am_option_set_text_dscp ( int  dscp_value)

Configure amsip to use a specific DSCP value in text RTP streams (default is 0x38).

Parameters:
dscp_valueDSCP value to use in text RTP streams.
int am_option_set_udpftp_dscp ( int  dscp_value)

Configure amsip to use a specific DSCP value in udpftp RTP streams (default is 0x28).

Parameters:
dscp_valueDSCP value to use in udpftp RTP streams.
int am_option_add_dns_cache ( const char *  host,
const char *  ip 
)

Configure amsip to resolv host argument to this IP.

Parameters:
hosthost that will be resolved to ip.
ipip for resolution of host.
int am_option_set_supported_extensions ( const char *  supported_extensions)

Configure amsip to support those extensions. Supported header will be added in OPTIONS and request/response initiating dialogs and REGISTER.

Parameters:
supported_extensionslist of supported extensions.
int am_option_set_accepted_types ( const char *  accepted_types)

Configure amsip to accept those content-types. Accepted header will be added in OPTIONS

Parameters:
accepted_typeslist of accepted types.
int am_option_set_allowed_methods ( const char *  allowed_methods)

Configure amsip to support those METHODS. Allow header will be added in OPTIONS and request/response initiating dialogs.

Parameters:
allowed_methodslist of supported METHODS.
int am_option_set_allowed_events ( const char *  allowed_events)

Configure amsip to support those Events. Allow-events header will be added in OPTIONS and request/response initiating dialogs and in REGISTER.

Parameters:
allowed_methodslist of supported Events.
int am_option_set_input_video_size ( int  width,
int  height 
)

Configure amsip to TRY to open webcam using the specified size. WINDOWS PLATFORM ONLY

Parameters:
handlehandle of a window.
widthwidth size of window.
heightheight size of window.
int am_option_set_window_display ( MSDisplayDesc *  desc,
long  handle,
int  width,
int  height 
)

Configure amsip to output video on this windows.

Parameters:
descDisplay plugin description
handlehandle of a window. (native windows only)
widthwidth size of window.
heightheight size of window.
int am_option_set_window_handle ( long  handle,
int  width,
int  height 
)

Configure amsip to output video on this windows. handle is set on WINDOWS PLATFORM ONLY

Parameters:
handlehandle of a window.
widthwidth size of window.
heightheight size of window.
int am_option_set_window_preview_handle ( long  handle,
int  width,
int  height 
)

Configure amsip to output video preview on this windows. ** NOT IMPLEMENTED IN AMSIP, video preview is inserted inside main view**

Parameters:
handlehandle of a window.
widthwidth size of window.
heightheight size of window.
int am_option_set_nowebcam ( const char *  nowebcam_image)

Configure amsip to use this image when no webcam is used.

Parameters:
enableopen or close preview.
int am_option_enable_preview ( int  enable)

Configure amsip to start/stop video preview.

Parameters:
enableopen or close preview.
int am_option_set_image_callback ( on_video_module_new_image_cb  func)

Configure amsip to provide images to application via a callback.

Parameters:
functhe callback
int am_option_set_rate ( int  rate)

Configure amsip to use 16kHz internally and allow wideband codecs.

Parameters:
rateinternal rate to use.
int am_option_set_callback ( unsigned int  id,
MSFilterNotifyFunc  speex_pp_process,
void *  userdata 
)

Set callback to analyse mic/speaker signal.

Parameters:
speex_pp_processCallback.
int am_option_set_volume_gain ( float  capture_gain,
float  playback_gain 
)

Set capture and playback amplification.

1 -> no change >1 -> amplify volume <1 -> decrease volume

Parameters:
capture_gainLinear amplification to recorded signal.
playback_gainLinear amplification to plback signal.
int am_option_set_echo_limitation ( int  enabled,
float  threshold,
float  speed,
float  force,
int  sustain 
)

Activate and Set Echo Limiter with parameters.

Parameters:
enabled0 disabled / 1 enabled.
thresholdthreshold parameter for capture.
speedspeed parameter for capture.
forceforce parameter for capture.
sustaindelay (ms) for which e.l. remains active after resuming from speech to silence.
int am_option_set_noise_gate_threshold ( int  enabled,
float  threshold 
)

Activate and set noise gate parameter for Echo Limiter.

Parameters:
enabled0 disabled / 1 enabled.
thresholdthreshold parameter.
int am_option_set_equalizer_state ( int  enable)

Enable equalizer to control gain on some specific frequency.

Parameters:
enable0: Disabled, 1: Enabled
int am_option_set_equalizer_params ( float  freq,
float  gain,
float  width 
)

Set equalizer parameter for a specific frequency.

Parameters:
freqfrequency.
gaingain to apply to frequency.
widthwidth.
int am_option_set_mic_equalizer_state ( int  enable)

Enable equalizer to control gain on some specific frequency (on microphone side).

Parameters:
enable0: Disabled, 1: Enabled
int am_option_set_mic_equalizer_params ( float  freq,
float  gain,
float  width 
)

Set equalizer parameter for a specific frequency (on microphone side).

Parameters:
freqfrequency.
gaingain to apply to frequency.
widthwidth.
int am_option_geteventsocket ( void  )

Retreive a socket where data is written when a eXosip_event is available in amsip/eXosip2 fifo.