| 1 | /* |
|---|
| 2 | linphone |
|---|
| 3 | Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) |
|---|
| 4 | |
|---|
| 5 | This program is free software; you can redistribute it and/or |
|---|
| 6 | modify it under the terms of the GNU General Public License |
|---|
| 7 | as published by the Free Software Foundation; either version 2 |
|---|
| 8 | of the License, or (at your option) any later version. |
|---|
| 9 | |
|---|
| 10 | This program is distributed in the hope that it will be useful, |
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | GNU General Public License for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU General Public License |
|---|
| 16 | along with this program; if not, write to the Free Software |
|---|
| 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | #ifndef sipsetup_h |
|---|
| 22 | #define sipsetup_h |
|---|
| 23 | #include "linphonecore.h" |
|---|
| 24 | |
|---|
| 25 | struct _SipSetup; |
|---|
| 26 | |
|---|
| 27 | struct _SipSetupContext{ |
|---|
| 28 | struct _SipSetup *funcs; |
|---|
| 29 | char domain[128]; |
|---|
| 30 | char username[128]; |
|---|
| 31 | void *data; |
|---|
| 32 | }; |
|---|
| 33 | |
|---|
| 34 | typedef struct _SipSetupContext SipSetupContext; |
|---|
| 35 | |
|---|
| 36 | struct _SipSetup{ |
|---|
| 37 | char *name; |
|---|
| 38 | bool_t (*init)(void); |
|---|
| 39 | int (*create_account)( const char *uri, const char *passwd); |
|---|
| 40 | int (*login_account)(SipSetupContext *ctx, const char *uri, const char *passwd); |
|---|
| 41 | int (*get_proxy)(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz); |
|---|
| 42 | int (*get_stun_servers)(SipSetupContext *ctx, char *stun1, char *stun2, size_t size); |
|---|
| 43 | int (*get_relay)(SipSetupContext *ctx, char *relay, size_t size); |
|---|
| 44 | void (*exit)(void); |
|---|
| 45 | bool_t initialized; |
|---|
| 46 | }; |
|---|
| 47 | |
|---|
| 48 | typedef struct _SipSetup SipSetup; |
|---|
| 49 | |
|---|
| 50 | void sip_setup_register_all(void); |
|---|
| 51 | SipSetup *sip_setup_lookup(const char *type_name); |
|---|
| 52 | void sip_setup_unregister_all(void); |
|---|
| 53 | |
|---|
| 54 | int sip_setup_new_account(SipSetup *s, const char *uri, const char *passwd); |
|---|
| 55 | SipSetupContext * sip_setup_context_new(SipSetup *s); |
|---|
| 56 | int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd); |
|---|
| 57 | int sip_setup_context_get_proxy(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz); |
|---|
| 58 | int sip_setup_context_get_stun_servers(SipSetupContext *ctx, char *stun1, char *stun2, size_t size); |
|---|
| 59 | int sip_setup_context_get_relay(SipSetupContext *ctx,char *relay, size_t size); |
|---|
| 60 | void sip_setup_context_free(SipSetupContext *ctx); |
|---|
| 61 | #endif |
|---|
| 62 | |
|---|