Fix logout from OCS
[siplcs.git] / src / core / sip-transport.h
blob0dfff5ec9ea14272be2bc775538cecbbeb9f7187
1 /**
2 * @file sip-transport.h
4 * pidgin-sipe
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct sipmsg;
25 struct sip_dialog;
26 struct sipe_core_private;
27 struct transaction;
29 /* Transaction that can be associated with a SIP request */
30 typedef gboolean (*TransCallback) (struct sipe_core_private *,
31 struct sipmsg *,
32 struct transaction *);
34 struct transaction_payload {
35 GDestroyNotify destroy;
36 void *data;
39 struct transaction {
40 TransCallback callback;
42 /** Not yet perfect, but surely better then plain CSeq
43 * Format is: <Call-ID><CSeq>
44 * (RFC3261 17.2.3 for matching server transactions: Request-URI, To tag, From tag, Call-ID, CSeq, and top Via)
46 gchar *key;
47 struct sipmsg *msg;
48 struct transaction_payload *payload;
51 /* Send SIP response */
52 void sip_transport_response(struct sipe_core_private *sipe_private,
53 struct sipmsg *msg,
54 guint code,
55 const char *text,
56 const char *body);
58 /* Send SIP request */
59 struct transaction *sip_transport_request(struct sipe_core_private *sipe_private,
60 const gchar *method,
61 const gchar *url,
62 const gchar *to,
63 const gchar *addheaders,
64 const gchar *body,
65 struct sip_dialog *dialog,
66 TransCallback callback);
68 /* Common SIP request types */
69 void sip_transport_ack(struct sipe_core_private *sipe_private,
70 struct sip_dialog *dialog);
71 void sip_transport_bye(struct sipe_core_private *sipe_private,
72 struct sip_dialog *dialog);
73 void sip_transport_info(struct sipe_core_private *sipe_private,
74 const gchar *addheaders,
75 const gchar *body,
76 struct sip_dialog *dialog,
77 TransCallback callback);
78 struct transaction *sip_transport_invite(struct sipe_core_private *sipe_private,
79 const gchar *addheaders,
80 const gchar *body,
81 struct sip_dialog *dialog,
82 TransCallback callback);
83 struct transaction *sip_transport_service(struct sipe_core_private *sipe_private,
84 const gchar *uri,
85 const gchar *addheaders,
86 const gchar *body,
87 TransCallback callback);
88 void sip_transport_subscribe(struct sipe_core_private *sipe_private,
89 const gchar *uri,
90 const gchar *addheaders,
91 const gchar *body,
92 struct sip_dialog *dialog,
93 TransCallback callback);
95 /* Misc. SIP transport stuff */
96 const gchar *sip_transport_user_agent(struct sipe_core_private *sipe_private);
97 guint sip_transport_port(struct sipe_core_private *sipe_private);
98 void sip_transport_deregister(struct sipe_core_private *sipe_private);
99 void sip_transport_disconnect(struct sipe_core_private *sipe_private);
100 void sip_transport_flush(struct sipe_core_private *sipe_private);
103 Local Variables:
104 mode: c
105 c-file-style: "bsd"
106 indent-tabs-mode: t
107 tab-width: 8
108 End: