]> sjero.net Git - linphone/blob - coreapi/sal_eXosip2.h
68a2d05ef845e5efc0063d0ab9acbf3d3f0bfd42
[linphone] / coreapi / sal_eXosip2.h
1 /*
2 linphone
3 Copyright (C) 2010  Simon MORLAT (simon.morlat@free.fr)
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 #ifndef sal_exosip2_h
21 #define sal_exosip2_h
22
23 #include "sal.h"
24 #include <eXosip2/eXosip.h>
25
26
27
28 sdp_message_t *media_description_to_sdp(const SalMediaDescription *sal);
29 int sdp_to_media_description(sdp_message_t *sdp, SalMediaDescription *desc);
30
31 struct Sal{
32         SalCallbacks callbacks;
33         SalTransport transport;
34         MSList *calls; /*MSList of SalOp */
35         MSList *registers;/*MSList of SalOp */
36         MSList *out_subscribes;/*MSList of SalOp */
37         MSList *in_subscribes;/*MSList of SalOp */
38         MSList *pending_auths;/*MSList of SalOp */
39         MSList *other_transactions; /*MSList of SalOp */
40         int running;
41         int session_expires;
42         int keepalive_period;
43         void *up; /*user pointer*/
44         char* rootCa; /* File _or_ folder containing root CA */
45         int dscp;
46         bool_t one_matching_codec;
47         bool_t double_reg;
48         bool_t use_rports;
49         bool_t use_101;
50         bool_t reuse_authorization;
51         bool_t verify_server_certs;
52         bool_t verify_server_cn;
53         bool_t expire_old_contact;
54         bool_t add_dates;
55         bool_t tcp_tls_keepalive;
56 };
57
58 struct SalOp{
59         SalOpBase base;
60         int cid;
61         int did;
62         int tid;
63         int rid;
64         int sid;
65         int nid;
66         int expires;
67         SalMediaDescription *result;
68         sdp_message_t *sdp_answer;
69         eXosip_event_t *pending_auth;
70         osip_call_id_t *call_id; /*used for out of calls transaction in order
71                                 to retrieve the operation when receiving a response*/
72         char *replaces;
73         char *referred_by;
74         const SalAuthInfo *auth_info;
75         const char *sipfrag_pending;
76         bool_t supports_session_timers;
77         bool_t sdp_offering;
78         bool_t reinvite;
79         bool_t masquerade_via;
80         bool_t auto_answer_asked;
81         bool_t terminated;
82 };
83
84 void sal_remove_out_subscribe(Sal *sal, SalOp *op);
85 void sal_remove_in_subscribe(Sal *sal, SalOp *op);
86 void sal_add_other(Sal *sal, SalOp *op,  osip_message_t *request);
87
88 void sal_exosip_subscription_recv(Sal *sal, eXosip_event_t *ev);
89 void sal_exosip_subscription_answered(Sal *sal,eXosip_event_t *ev);
90 void sal_exosip_notify_recv(Sal *sal,eXosip_event_t *ev);
91 void sal_exosip_subscription_closed(Sal *sal,eXosip_event_t *ev);
92
93 void sal_exosip_in_subscription_closed(Sal *sal, eXosip_event_t *ev);
94 SalOp * sal_find_out_subscribe(Sal *sal, int sid);
95 SalOp * sal_find_in_subscribe(Sal *sal, int nid);
96 void sal_exosip_fix_route(SalOp *op);
97 void sal_exosip_add_custom_headers(osip_message_t *msg, SalCustomHeader *ch);
98 SalCustomHeader * sal_exosip_get_custom_headers(osip_message_t *msg);
99
100 void _osip_list_set_empty(osip_list_t *l, void (*freefunc)(void*));
101
102 #endif