sofia-sip/soa.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the Sofia-SIP package
00003  *
00004  * Copyright (C) 2005 Nokia Corporation.
00005  *
00006  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  *
00023  */
00024 
00025 #ifndef SOA_H
00026 
00027 #define SOA_H
00028 
00036 #ifndef SU_WAIT_H
00037 #include <sofia-sip/su_wait.h>
00038 #endif
00039 #ifndef SU_TAG_H
00040 #include <sofia-sip/su_tag.h>
00041 #endif
00042 
00043 SOFIA_BEGIN_DECLS
00044 
00045 typedef struct soa_session soa_session_t;
00046 
00047 struct sdp_session_s;
00048 
00049 #ifndef SOA_MAGIC_T
00050 #define SOA_MAGIC_T void
00051 #endif
00052 
00053 typedef SOA_MAGIC_T soa_magic_t;
00054 
00055 typedef int soa_callback_f(soa_magic_t *arg, soa_session_t *session);
00056 
00057 SOFIAPUBFUN soa_session_t *soa_create(char const *name, su_root_t *, soa_magic_t *);
00058 
00059 SOFIAPUBFUN soa_session_t *soa_clone(soa_session_t *, su_root_t *, soa_magic_t *);
00060 
00061 SOFIAPUBFUN void soa_destroy(soa_session_t *);
00062 
00063 SOFIAPUBFUN int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...);
00064 SOFIAPUBFUN int soa_get_params(soa_session_t const *ss, 
00065                                tag_type_t tag, tag_value_t value, ...);
00066 
00067 SOFIAPUBFUN tagi_t *soa_get_paramlist(soa_session_t const *ss,
00068                                       tag_type_t tag, tag_value_t value, ...);
00069 
00070 SOFIAPUBFUN int soa_error_as_sip_response(soa_session_t *soa, 
00071                                           char const **return_phrase);
00072 
00073 SOFIAPUBFUN char const *soa_error_as_sip_reason(soa_session_t *soa);
00074 
00075 SOFIAPUBFUN int soa_get_warning(soa_session_t *ss, char const **return_phrase);
00076 
00077 SOFIAPUBFUN int soa_set_capability_sdp(soa_session_t *ss, 
00078                                        struct sdp_session_s const *sdp,
00079                                        char const *str, int len);
00080 
00081 SOFIAPUBFUN int soa_get_capability_sdp(soa_session_t const *ss,
00082                                        struct sdp_session_s const **return_sdp,
00083                                        char const **return_sdp_str,
00084                                        int *return_len);
00085 
00086 SOFIAPUBFUN int soa_set_remote_sdp(soa_session_t *ss, 
00087                                    struct sdp_session_s const *sdp,
00088                                    char const *str, int len);
00089 
00090 SOFIAPUBFUN int soa_get_remote_sdp(soa_session_t const *ss,
00091                                    struct sdp_session_s const **return_sdp,
00092                                    char const **return_sdp_str,
00093                                    int *return_len);
00094 
00095 SOFIAPUBFUN int soa_clear_remote_sdp(soa_session_t *ss);
00096 
00097 SOFIAPUBFUN int soa_get_remote_version(soa_session_t const *ss);
00098 
00099 SOFIAPUBFUN int soa_set_user_sdp(soa_session_t *ss, 
00100                                  struct sdp_session_s const *sdp,
00101                                  char const *str, int len);
00102 
00103 SOFIAPUBFUN int soa_get_user_sdp(soa_session_t const *ss,
00104                                  struct sdp_session_s const **return_sdp,
00105                                  char const **return_sdp_str,
00106                                  int *return_len);
00107 
00108 SOFIAPUBFUN int soa_get_user_version(soa_session_t const *ss);
00109 
00110 SOFIAPUBFUN int soa_get_local_sdp(soa_session_t const *ss,
00111                                   struct sdp_session_s const **return_sdp,
00112                                   char const **return_sdp_str,
00113                                   int *return_len);
00114 
00115 SOFIAPUBFUN char const * const * soa_sip_require(soa_session_t const *ss);
00116 SOFIAPUBFUN char const * const * soa_sip_supported(soa_session_t const *ss);
00117 
00118 SOFIAPUBFUN int soa_remote_sip_features(soa_session_t *ss,
00119                                         char const * const * support,
00120                                         char const * const * required);
00121 
00122 SOFIAPUBFUN char **soa_media_features(soa_session_t *ss, int live, su_home_t *home);
00123 
00124 /* Generate offer */
00125 SOFIAPUBFUN int soa_generate_offer(soa_session_t *, int always, soa_callback_f *);
00126 /* Process offer, generate answer */
00127 SOFIAPUBFUN int soa_generate_answer(soa_session_t *, soa_callback_f *);
00128 /* Process answer */
00129 SOFIAPUBFUN int soa_process_answer(soa_session_t *, soa_callback_f *);
00130 /* Process rejected offer */
00131 SOFIAPUBFUN int soa_process_reject(soa_session_t *, soa_callback_f *);
00132 
00133 SOFIAPUBFUN int soa_activate(soa_session_t *, char const *option);
00134 SOFIAPUBFUN int soa_deactivate(soa_session_t *, char const *option);
00135 
00136 SOFIAPUBFUN void soa_terminate(soa_session_t *, char const *option);
00137 
00138 SOFIAPUBFUN int soa_is_complete(soa_session_t const *ss);
00139 
00140 SOFIAPUBFUN int soa_init_offer_answer(soa_session_t *ss);
00141 
00142 SOFIAPUBFUN int soa_is_audio_active(soa_session_t const *ss);
00143 SOFIAPUBFUN int soa_is_video_active(soa_session_t const *ss);
00144 SOFIAPUBFUN int soa_is_image_active(soa_session_t const *ss);
00145 SOFIAPUBFUN int soa_is_chat_active(soa_session_t const *ss);
00146 
00147 SOFIAPUBFUN int soa_is_remote_audio_active(soa_session_t const *ss);
00148 SOFIAPUBFUN int soa_is_remote_video_active(soa_session_t const *ss);
00149 SOFIAPUBFUN int soa_is_remote_image_active(soa_session_t const *ss);
00150 SOFIAPUBFUN int soa_is_remote_chat_active(soa_session_t const *ss);
00151 
00152 SOFIA_END_DECLS
00153 
00154 #endif

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