libamsip 4.6.0
Functions

amsip session interface

SIP messages and call control API

Functions

int am_session_start (const char *identity, const char *url, const char *proxy, const char *outbound_proxy)
int am_session_start_text_conversation (const char *identity, const char *url, const char *proxy, const char *outbound_proxy)
int am_session_start_file_transfer (const char *identity, const char *url, const char *proxy, const char *outbound_proxy)
int am_session_get_udpftp (int did, MST140Block *_blk)
int am_session_send_udpftp (int did, MST140Block *_blk)
int am_session_get_text (int did, MST140Block *_blk)
int am_session_send_text (int did, MST140Block *_blk)
void am_free_t140block (MST140Block *_blk)
int am_session_hold (int did, const char *wav_file)
int am_session_off_hold (int did)
int am_session_inactive (int did)
int am_session_inactive_0_0_0_0 (int did)
int am_session_mute (int did)
int am_session_unmute (int did)
int am_session_add_in_conference (const char *identity, const char *url, const char *proxy, const char *outbound_proxy, const char *conf_name)
int am_session_answer (int tid, int did, int code, int enable_audio)
int am_session_answer_with_video (int tid, int did, int code, int enable_audio, int enable_video)
int am_session_redirect (int tid, int did, int code, const char *url)
int am_session_stop (int cid, int did, int code)
int am_session_refer (int did, const char *url, const char *referred_by)
int am_session_get_referto (int did, char *refer_to, size_t refer_to_len)
int am_session_find_by_replaces (osip_message_t *request)
int am_session_answer_request (int tid, int did, int code)
int am_session_send_notify (int did, const char *sub_state, const char *content_type, const char *body, int size)
int am_session_send_request (int did, const char *method, const char *content_type, const char *body, int size)
int am_session_play_file (int did, const char *wav_file)
int am_session_playfile (int did, const char *wav_file, int repeat, MSFilterNotifyFunc cb_fileplayer_eof)
int am_session_send_inband_dtmf (int did, char dtmf_number)
int am_session_send_rtp_dtmf (int did, char dtmf_number)
int am_session_send_dtmf (int did, char dtmf_number)
int am_session_send_dtmf_with_duration (int did, char dtmf_number, int duration)
int am_session_get_dtmf_event (int did, struct am_dtmf_event *dtmf_event)
int am_session_get_audio_remote (int did, char *remote_info)
int am_session_get_udpftp_bandwidth (int did, struct am_bandwidth_stats *band_stats)
int am_session_get_text_bandwidth (int did, struct am_bandwidth_stats *band_stats)
int am_session_get_audio_bandwidth (int did, struct am_bandwidth_stats *band_stats)
int am_session_get_audio_statistics (int did, struct am_audio_stats *audio_stats)
int am_session_modify_bitrate (int did, const char *preferred_codec, int compress_more)
int am_session_record (int did, const char *recfile)
int am_session_stop_record (int did)
int am_session_add_t140 (int did)
int am_session_receive_file (int cid, int did, const char *filename)
int am_session_file_info (int cid, int did, struct am_fileinfo *fileinfo)
int am_session_send_file (int cid, int did, const char *filename, const char *filename_short)
int am_session_stop_transfer (int cid, int did)
int am_session_add_external_rtpdata (int did, MSFilter *external_rtpdata)
int am_session_build_req (int did, const char *method, osip_message_t **request)
int am_session_send_req (int did, const char *method, osip_message_t *request)

Function Documentation

int am_session_start ( const char *  identity,
const char *  url,
const char *  proxy,
const char *  outbound_proxy 
)

Configure amsip to start a SIP session.

Parameters:
identityCaller SIP identity
urlCallee SIP identity
proxySet the proxy server
outbound_proxyOutBound Proxy
int am_session_start_text_conversation ( const char *  identity,
const char *  url,
const char *  proxy,
const char *  outbound_proxy 
)

Configure amsip to start a SIP session with text.

Parameters:
identityCaller SIP identity
urlCallee SIP identity
proxySet the proxy server
outbound_proxyOutBound Proxy
int am_session_start_file_transfer ( const char *  identity,
const char *  url,
const char *  proxy,
const char *  outbound_proxy 
)

Configure amsip to start a file transfer using UDP/RTP.

Parameters:
identityCaller SIP identity
urlCallee SIP identity
proxySet the proxy server
outbound_proxyOutBound Proxy
int am_session_get_udpftp ( int  did,
MST140Block *  _blk 
)

Get UDP/RTP data from remote party.

Parameters:
didSession identifier.
_blkBlock that contains text data.
int am_session_send_udpftp ( int  did,
MST140Block *  _blk 
)

Send UDP/RTP data from remote party.

Parameters:
didSession identifier.
_blkBlock that contains text data.
int am_session_get_text ( int  did,
MST140Block *  _blk 
)

Get UDP/RTP text from remote party.

Parameters:
didSession identifier.
_blkBlock that contains text data.
int am_session_send_text ( int  did,
MST140Block *  _blk 
)

Send UDP/RTP text from remote party.

Parameters:
didSession identifier.
_blkBlock that contains text data.
void am_free_t140block ( MST140Block *  _blk)

Release allocated string inside MST140Block.

Parameters:
_blkBlock that contains text data.
int am_session_hold ( int  did,
const char *  wav_file 
)

Configure amsip to put on hold a SIP session. (send wav_file)

Parameters:
didSession identifier.
wav_fileWav file to play.
int am_session_off_hold ( int  did)

Configure amsip to put off hold a SIP session.

Parameters:
didSession identifier.
int am_session_inactive ( int  did)

Configure amsip to make streams inactive.

Parameters:
didSession identifier.
int am_session_inactive_0_0_0_0 ( int  did)

Configure amsip to make streams inactive. Note: put ip=0_0_0_0 and port=0 for the audio SDP media block. Note2: THIS IS NOT POSSIBLE TO RETREIVE BACK THIS CALL. THIS METHOD MUST ONLY BE USED BEFORE MAKING A CALL TRANSFER WITH SOME UNCOMPLIANT SIP-PBX.

Parameters:
didSession identifier.
int am_session_mute ( int  did)

Configure amsip to mute a SIP session. (send silence)

Parameters:
didSession identifier.
int am_session_unmute ( int  did)

Configure amsip to unmute a SIP session.

Parameters:
didSession identifier.
int am_session_add_in_conference ( const char *  identity,
const char *  url,
const char *  proxy,
const char *  outbound_proxy,
const char *  conf_name 
)

Configure amsip to start a SIP session and add user in an existing conference.

Parameters:
identityCaller SIP identity
urlCallee SIP identity
proxySet the proxy server
outbound_proxyOutBound Proxy
conf_nameConference name
int am_session_answer ( int  tid,
int  did,
int  code,
int  enable_audio 
)

Configure amsip to establish a SIP session.

Parameters:
tidTransaction identifier.
didSession identifier.
codeCode to use.
enable_audiostart audio if available.
int am_session_answer_with_video ( int  tid,
int  did,
int  code,
int  enable_audio,
int  enable_video 
)

Configure amsip to establish a SIP session.

Parameters:
tidTransaction identifier.
didSession identifier.
codeCode to use.
enable_audiostart audio if available.
enable_videostart video if available.
int am_session_redirect ( int  tid,
int  did,
int  code,
const char *  url 
)

Configure amsip to redirect a SIP session.

Parameters:
tidTransaction identifier.
didSession identifier.
codeCode to use.
urlSIP (or other url) address for redirection.
int am_session_stop ( int  cid,
int  did,
int  code 
)

Configure amsip to establish a SIP session.

Parameters:
ciddialog identifier.
didSession identifier.
codeCode to use (if answer needed).
int am_session_refer ( int  did,
const char *  url,
const char *  referred_by 
)

Configure amsip to transfer a SIP session.

Parameters:
didSession identifier.
urlSIP (or other url) address for redirection.
int am_session_get_referto ( int  did,
char *  refer_to,
size_t  refer_to_len 
)

Add Replaces parameter to refer-to url.

Parameters:
didSession identifier.
refer_toString to carry refer_to.
refer_to_lenSize of refer_to string.
int am_session_find_by_replaces ( osip_message_t *  request)

Find the call that relates to the Replaces header.

Parameters:
requestrequet containging a replace header.
int am_session_answer_request ( int  tid,
int  did,
int  code 
)

Configure amsip to establish a SIP session.

Parameters:
tidTransaction identifier.
didSession identifier.
codeCode to use.
int am_session_send_notify ( int  did,
const char *  sub_state,
const char *  content_type,
const char *  body,
int  size 
)

Send a request during a session

Parameters:
didSession identifier.
sub_stateSubscription-State parameter.
content_typeContent-type of the body
bodyAttached content
sizeSize of body
int am_session_send_request ( int  did,
const char *  method,
const char *  content_type,
const char *  body,
int  size 
)

Send a request during a session

Parameters:
didSession identifier.
methodSIP method (e.g. INVITE)
content_typeContent-type of the body
bodyAttached content
sizeSize of body
int am_session_play_file ( int  did,
const char *  wav_file 
)

Configure amsip to play a file in an outgoing RTP session.

Parameters:
didSession identifier.
wav_fileFile to play.
int am_session_playfile ( int  did,
const char *  wav_file,
int  repeat,
MSFilterNotifyFunc  cb_fileplayer_eof 
)

Configure amsip to play a file in an outgoing RTP session.

Parameters:
didSession identifier.
wav_fileFile to play.
repeatrepeat: -2 to play once, >0 delai between replay
cb_fileplayer_eofcallback to indicate endoffile
int am_session_send_inband_dtmf ( int  did,
char  dtmf_number 
)

Configure amsip to send an in-band DTMF in an outgoing RTP session.

Parameters:
didSession identifier.
dtmf_numberDTMF to send.
int am_session_send_rtp_dtmf ( int  did,
char  dtmf_number 
)

Configure amsip to send a RTP telephone-event in an outgoing RTP session.

Parameters:
didSession identifier.
dtmf_numberDTMF to send.
int am_session_send_dtmf ( int  did,
char  dtmf_number 
)

Configure amsip to send an INFO with dtmf attachement.

Parameters:
didSession identifier.
dtmf_numberDTMF to send.
int am_session_send_dtmf_with_duration ( int  did,
char  dtmf_number,
int  duration 
)

Configure amsip to send an INFO with dtmf attachement.

Parameters:
didSession identifier.
dtmf_numberDTMF to send.
durationDTMF duration.
int am_session_get_dtmf_event ( int  did,
struct am_dtmf_event *  dtmf_event 
)

Get dtmf from RTP session.

Parameters:
didSession identifier.
dtmf_eventdtmf_event structure.
int am_session_get_audio_remote ( int  did,
char *  remote_info 
)

Find out the destination IP/PORT for audio stream. return >0 remote SDP ip/port used return ==0 remote SDP candidate ip/port used (probably for direct comunication) return <0 undefined error.

Parameters:
didSession identifier.
remote_infostring of size 256 to get the remote IP/PORT for audio stream.
int am_session_get_udpftp_bandwidth ( int  did,
struct am_bandwidth_stats *  band_stats 
)

Get statistics for RTP udpftp stream.

Parameters:
didSession identifier.
band_statsstruct to hold information.
int am_session_get_text_bandwidth ( int  did,
struct am_bandwidth_stats *  band_stats 
)

Get statistics for RTP text stream.

Parameters:
didSession identifier.
band_statsstruct to hold information.
int am_session_get_audio_bandwidth ( int  did,
struct am_bandwidth_stats *  band_stats 
)

Get statistics for RTP audio stream.

Parameters:
didSession identifier.
band_statsstruct to hold information.
int am_session_get_audio_statistics ( int  did,
struct am_audio_stats audio_stats 
)

Get statistics for RTP audio stream.

Parameters:
didSession identifier.
audio_statsstruct to hold statistics.
int am_session_modify_bitrate ( int  did,
const char *  preferred_codec,
int  compress_more 
)

Get statistics for RTP audio stream.

Parameters:
didSession identifier.
preferred_codecPreferred codec to use.
compress_morecompress_more. (0 means you want to use more bandwidth)
int am_session_record ( int  did,
const char *  recfile 
)

Record both audio stream (incoming+outgoing).

Parameters:
didSession identifier.
recfileFile Name for recording.
int am_session_stop_record ( int  did)

Stop recording the call.

Parameters:
didSession identifier.
int am_session_add_t140 ( int  did)

Add t140 chat session in the call.

Parameters:
didSession identifier.
int am_session_receive_file ( int  cid,
int  did,
const char *  filename 
)

Receive file within a text conversation (t140) established call.

Parameters:
cidSession identifier.
didSession identifier.
filenamefilename of the file to receive.
int am_session_file_info ( int  cid,
int  did,
struct am_fileinfo *  fileinfo 
)

Receive file within a text conversation (t140) established call.

Parameters:
cidSession identifier.
didSession identifier.
fileinfoinformation about file transfer.
int am_session_send_file ( int  cid,
int  did,
const char *  filename,
const char *  filename_short 
)

Send file within a text conversation (t140) established call.

Parameters:
cidSession identifier.
didSession identifier.
filenamefilename of the file to receive.
int am_session_stop_transfer ( int  cid,
int  did 
)

Release udpftp transfer resources.

Parameters:
cidSession identifier.
didSession identifier.
int am_session_add_external_rtpdata ( int  did,
MSFilter *  external_rtpdata 
)

Add new source for sending RTP data.

Parameters:
didSession identifier.
external_rtpdataExternal filter.
int am_session_build_req ( int  did,
const char *  method,
osip_message_t **  request 
)

Send a request during a session (NOTE: NOT FOR INVITE, ACK, BYE, CANCEL)

Parameters:
didSession identifier.
methodSIP method (e.g. MESSAGE, REFER, NOTIFY, INFO...)
int am_session_send_req ( int  did,
const char *  method,
osip_message_t *  request 
)

Send a request during a session (NOTE: NOT FOR INVITE, ACK, BYE, CANCEL)

Parameters:
didSession identifier.
methodSIP method (e.g. MESSAGE, REFER, NOTIFY, INFO...)