2 * @file sip-transport.h
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 */
26 struct sipe_core_private
;
29 /* Transaction that can be associated with a SIP request */
30 typedef gboolean (*TransCallback
) (struct sipe_core_private
*,
32 struct transaction
*);
34 struct transaction_payload
{
35 GDestroyNotify destroy
;
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)
48 struct transaction_payload
*payload
;
51 /* Send SIP response */
52 void sip_transport_response(struct sipe_core_private
*sipe_private
,
58 /* Send SIP request */
59 struct transaction
*sip_transport_request(struct sipe_core_private
*sipe_private
,
63 const gchar
*addheaders
,
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
,
76 struct sip_dialog
*dialog
,
77 TransCallback callback
);
78 struct transaction
*sip_transport_invite(struct sipe_core_private
*sipe_private
,
79 const gchar
*addheaders
,
81 struct sip_dialog
*dialog
,
82 TransCallback callback
);
83 struct transaction
*sip_transport_service(struct sipe_core_private
*sipe_private
,
85 const gchar
*addheaders
,
87 TransCallback callback
);
88 void sip_transport_subscribe(struct sipe_core_private
*sipe_private
,
90 const gchar
*addheaders
,
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
);