source: mediastreamer2/linphone/coreapi/sipsetup.h @ 295:7c2d63cfbe15

Last change on this file since 295:7c2d63cfbe15 was 295:7c2d63cfbe15, checked in by smorlat <smorlat@…>, 4 years ago

fix bug when adding contacts
sipsetup plugins work in progress.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@298 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

File size: 3.8 KB
Line 
1/*
2linphone
3Copyright (C) 2000  Simon MORLAT (simon.morlat@linphone.org)
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18*/
19
20
21#ifndef sipsetup_h
22#define sipsetup_h
23
24#include "mediastreamer2/mscommon.h"
25
26struct _SipSetup;
27
28struct _BuddyInfo;
29
30
31struct _SipSetupContext{
32        struct _SipSetup *funcs;
33        struct _LinphoneProxyConfig *cfg;
34        char domain[128];
35        char username[128];
36        void *data;
37};
38
39typedef struct _SipSetupContext SipSetupContext;
40
41#define SIP_SETUP_CAP_PROXY_PROVIDER    (1)
42#define SIP_SETUP_CAP_STUN_PROVIDER     (1<<1)
43#define SIP_SETUP_CAP_RELAY_PROVIDER    (1<<2)
44#define SIP_SETUP_CAP_BUDDY_LOOKUP      (1<<3)
45#define SIP_SETUP_CAP_ACCOUNT_MANAGER   (1<<4)
46
47typedef enum _BuddyLookupStatus{
48        BuddyLookupNone,
49        BuddyLookupConnecting,
50        BuddyLookupConnected,
51        BuddyLookupReceivingResponse,
52        BuddyLookupDone,
53        BuddyLookupFailure
54}BuddyLookupStatus;
55
56typedef struct _BuddyAddress{
57        char street[64];
58        char zip[64];
59        char town[64];
60        char country[64];
61} BuddyAddress;
62
63typedef struct _BuddyInfo{
64        char firstname[64];
65        char lastname[64];
66        char displayname[64];
67        char sip_uri[128];
68        BuddyAddress address;
69}BuddyInfo;
70
71
72struct _SipSetup{
73        char *name;
74        unsigned int capabilities;
75        bool_t (*init)(void);
76        int (*init_instance)(SipSetupContext *ctx);
77        int (*create_account)( const char *uri, const char *passwd);
78        int (*login_account)(SipSetupContext *ctx, const char *uri, const char *passwd);
79        int (*get_proxy)(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz);
80        int (*get_stun_servers)(SipSetupContext *ctx, char *stun1, char *stun2, size_t size);
81        int (*get_relay)(SipSetupContext *ctx, char *relay, size_t size);
82        int (*lookup_buddy)(SipSetupContext *ctx, const char *key);
83        BuddyLookupStatus (*get_buddy_lookup_status)(SipSetupContext *ctx);
84        int (*get_buddy_lookup_results)(SipSetupContext *ctx, MSList **results);
85        void (*exit)(void);
86        bool_t initialized;
87};
88
89typedef struct _SipSetup SipSetup;
90
91
92#ifdef __cplusplus
93extern "C"{
94#endif
95
96void sip_setup_register(SipSetup *ss);
97void sip_setup_register_all(void);
98SipSetup *sip_setup_lookup(const char *type_name);
99void sip_setup_unregister_all(void);
100
101int sip_setup_new_account(SipSetup *s, const char *uri, const char *passwd);
102SipSetupContext * sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig *cfg);
103int sip_setup_context_get_capabilities(SipSetupContext *ctx);
104int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd);
105int sip_setup_context_get_proxy(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz);
106int sip_setup_context_get_stun_servers(SipSetupContext *ctx, char *stun1, char *stun2, size_t size);
107int sip_setup_context_get_relay(SipSetupContext *ctx, char *relay, size_t size);
108int sip_setup_context_lookup_buddy(SipSetupContext *ctx, const char *key);
109BuddyLookupStatus sip_setup_context_get_buddy_lookup_status(SipSetupContext *ctx);
110int sip_setup_context_get_buddy_lookup_results(SipSetupContext *ctx, MSList **results /*of BuddyInfo */);
111void sip_setup_context_free_results(MSList *results);
112void sip_setup_context_free(SipSetupContext *ctx);
113
114/*internal methods*/
115struct _LinphoneProxyConfig *sip_setup_context_get_proxy_config(const SipSetupContext *ctx);
116
117
118#ifdef __cplusplus
119}
120#endif
121
122
123#endif
124
125
Note: See TracBrowser for help on using the repository browser.