soa.c File Reference


Detailed Description

Sofia SDP Offer/Answer Engine interface.

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>
Date:
Created: Wed Aug 3 20:27:15 EEST 2005

#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sofia-sip/su_tag_class.h>
#include <sofia-sip/su_wait.h>
#include "sofia-sip/soa.h"
#include "sofia-sip/sdp.h"
#include "sofia-sip/soa_session.h"
#include "sofia-sip/soa_add.h"
#include <sofia-sip/hostdomain.h>
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/su_localinfo.h>
#include <sofia-sip/su_uniqueid.h>
#include <sofia-sip/string0.h>
#include <sofia-sip/su_errno.h>
#include <sofia-sip/sip_status.h>

Include dependency graph for soa.c:


Functions

int soa_add (char const *name, struct soa_session_actions const *actions)
 Add a named soa backend.
soa_session_actions const * soa_find (char const *name)
 Search for a named backend.
soa_session_t * soa_session_ref (soa_session_t *ss)
 Increase reference count.
void soa_session_unref (soa_session_t *ss)
 Decrease reference count.
void soa_destroy (soa_session_t *ss)
 Destroy a session.
int soa_set_params (soa_session_t *ss, tag_type_t tag, tag_value_t value,...)
 Set tagged parameters.
int soa_get_params (soa_session_t const *ss, tag_type_t tag, tag_value_t value,...)
 Get tagged parameters.
tagi_tsoa_get_paramlist (soa_session_t const *ss, tag_type_t tag, tag_value_t value,...)
 Return a list of parameters.
int soa_get_warning (soa_session_t *ss, char const **return_text)
 Return warning code and text.
int soa_get_capability_sdp (soa_session_t const *ss, sdp_session_t const **return_sdp, char const **return_sdp_str, int *return_len)
 Return SDP description of capabilities.
int soa_base_set_capability_sdp (soa_session_t *ss, sdp_session_t *sdp, char const *str0, int len0)
 Set capabilities.
int soa_get_user_sdp (soa_session_t const *ss, sdp_session_t const **return_sdp, char const **return_sdp_str, int *return_len)
 Return SDP description of the session.
int soa_get_user_version (soa_session_t const *ss)
 Returns the version number of user session description.
int soa_base_set_user_sdp (soa_session_t *ss, sdp_session_t *sdp, char const *str0, int len0)
 Set user SDP (base version).
int soa_get_remote_sdp (soa_session_t const *ss, sdp_session_t const **return_sdp, char const **return_sdp_str, int *return_len)
 Return remote SDP description of the session.
int soa_get_remote_version (soa_session_t const *ss)
 Returns the version number of remote session description.
int soa_set_remote_sdp (soa_session_t *ss, sdp_session_t const *sdp, char const *str, int len)
 Set remote SDP (offer or answer).
int soa_base_set_remote_sdp (soa_session_t *ss, int new_version, sdp_session_t *sdp, char const *str0, int len0)
 Set remote SDP (base version).
int soa_get_local_sdp (soa_session_t const *ss, sdp_session_t const **return_sdp, char const **return_sdp_str, int *return_len)
 Get local SDP.
int soa_init_offer_answer (soa_session_t *ss)
 Initialize offer/answer state machine.
int soa_generate_offer (soa_session_t *ss, int always, soa_callback_f *completed)
 Run Offer step.
int soa_generate_answer (soa_session_t *ss, soa_callback_f *completed)
int soa_process_answer (soa_session_t *ss, soa_callback_f *completed)
 Complete offer-answer after receiving answer.
int soa_base_process_answer (soa_session_t *ss, soa_callback_f *completed)
 Processes answer from remote end.
int soa_process_reject (soa_session_t *ss, soa_callback_f *completed)
 Process rejection of offer.
int soa_base_process_reject (soa_session_t *ss, soa_callback_f *completed)
 Process reject from remote end.
int soa_activate (soa_session_t *ss, char const *option)
 Activate session.
int soa_deactivate (soa_session_t *ss, char const *option)
 Deactivate session.
void soa_terminate (soa_session_t *ss, char const *option)
 Terminate session.
int soa_description_set (soa_session_t *ss, struct soa_description *ssd, sdp_session_t *sdp, char const *sdp_str, int str_len)
 Set session descriptions.
int soa_description_dup (su_home_t *home, struct soa_description *ssd, struct soa_description const *ssd0)
 Duplicate a session descriptions.
void soa_description_free (soa_session_t *ss, struct soa_description *ssd)
 Free session descriptions.
int soa_init_sdp_origin (soa_session_t *ss, sdp_origin_t *o, char buffer[64])
 Initialize SDP o= line.
int soa_init_sdp_connection (soa_session_t *ss, sdp_connection_t *c, char buffer[64])
 Obtain a local address for SDP connection structure.

Variables

char const SOA_DEBUG []
 Environment variable determining the default debug log level.
su_log_t soa_log []
 Debug log for soa module.

Function Documentation

int soa_activate ( soa_session_t *  ss,
char const *  option 
)

Activate session.

EFAULT Bad address as ss.

int soa_deactivate ( soa_session_t *  ss,
char const *  option 
)

Deactivate session.

EFAULT Bad address as ss.

int soa_generate_answer ( soa_session_t *  ss,
soa_callback_f *  completed 
)

int soa_generate_offer ( soa_session_t *  ss,
int  always,
soa_callback_f *  completed 
)

Run Offer step.

Parameters:
ss pointer to session object
always always send offer (even if offer/answer has been completed)
completed pointer to callback function which is invoked when operation is completed
Return values:
1 when operation is successful
0 when operation is not needed
-1 upon an error
Errors:

EFAULT Bad address.
An operation is already in progress
EPROTO We have received offer, now we should send answer
EPROTO We have received SDP, but it has not been processed
EPROTO We have sent an offer, but have received no answer
EPROTO We have received offer.

int soa_get_capability_sdp ( soa_session_t const *  ss,
sdp_session_t const **  return_sdp,
char const **  return_sdp_str,
int *  return_len 
)

Return SDP description of capabilities.

Return values:
0 if there is no description to return
1 if description is returned
-1 upon an error

int soa_get_local_sdp ( soa_session_t const *  ss,
sdp_session_t const **  return_sdp,
char const **  return_sdp_str,
int *  return_len 
)

Get local SDP.

The local SDP is usually result of SDP negotiation.

int soa_get_remote_sdp ( soa_session_t const *  ss,
sdp_session_t const **  return_sdp,
char const **  return_sdp_str,
int *  return_len 
)

Return remote SDP description of the session.

Return values:
0 if there is no description to return
1 if description is returned
-1 upon an error

int soa_get_remote_version ( soa_session_t const *  ss  ) 

Returns the version number of remote session description.

The version numbering starts from zero and is incremented for each modification.

int soa_get_user_sdp ( soa_session_t const *  ss,
sdp_session_t const **  return_sdp,
char const **  return_sdp_str,
int *  return_len 
)

Return SDP description of the session.

Return values:
0 if there is no description to return
1 if description is returned
-1 upon an error

int soa_get_user_version ( soa_session_t const *  ss  ) 

Returns the version number of user session description.

The version numbering starts from zero and is incremented for each modification.

int soa_process_answer ( soa_session_t *  ss,
soa_callback_f *  completed 
)

Complete offer-answer after receiving answer.

EFAULT Bad address as ss.
An operation is already in progress.
EPROTO We have not sent an offer or already have received answer.
EPROTO We have not received answer.

int soa_process_reject ( soa_session_t *  ss,
soa_callback_f *  completed 
)

Process rejection of offer.

EFAULT Bad address as ss.
An operation is already in progress.
EPROTO We have not sent an offer or already have received answer.

void soa_terminate ( soa_session_t *  ss,
char const *  option 
)

Terminate session.

EFAULT Bad address as ss.


Variable Documentation

SOA_DEBUG

Environment variable determining the default debug log level.

The SOA_DEBUG environment variable is used to determine the default debug logging level. The normal level is 3.

See also:
<su_debug.h>, su_log_global, SOFIA_DEBUG

su_log_t soa_log[]

Debug log for soa module.

The soa_log is the log object used by soa module. The level of soa_log is set using SOA_DEBUG environment variable.


Sofia-SIP 1.12.1 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.