2 * @file sip-transport.h
6 * Copyright (C) 2010-2017 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
;
41 TransCallback timeout_callback
;
43 /** Not yet perfect, but surely better then plain CSeq
44 * Format is: <Call-ID><CSeq>
45 * (RFC3261 17.2.3 for matching server transactions: Request-URI, To tag, From tag, Call-ID, CSeq, and top Via)
50 struct transaction_payload
*payload
;
53 /* Send SIP response */
54 void sip_transport_response(struct sipe_core_private
*sipe_private
,
60 /* Send SIP request */
61 struct transaction
*sip_transport_request(struct sipe_core_private
*sipe_private
,
65 const gchar
*addheaders
,
67 struct sip_dialog
*dialog
,
68 TransCallback callback
);
70 /* Send SIP request with timeout [in seconds] */
71 struct transaction
*sip_transport_request_timeout(struct sipe_core_private
*sipe_private
,
75 const gchar
*addheaders
,
77 struct sip_dialog
*dialog
,
78 TransCallback callback
,
80 TransCallback timeout_callback
);
82 /* Common SIP request types */
83 void sip_transport_ack(struct sipe_core_private
*sipe_private
,
84 struct sip_dialog
*dialog
);
85 void sip_transport_bye(struct sipe_core_private
*sipe_private
,
86 struct sip_dialog
*dialog
);
87 struct transaction
*sip_transport_info(struct sipe_core_private
*sipe_private
,
88 const gchar
*addheaders
,
90 struct sip_dialog
*dialog
,
91 TransCallback callback
);
92 struct transaction
*sip_transport_invite(struct sipe_core_private
*sipe_private
,
93 const gchar
*addheaders
,
95 struct sip_dialog
*dialog
,
96 TransCallback callback
);
97 struct transaction
*sip_transport_service(struct sipe_core_private
*sipe_private
,
99 const gchar
*addheaders
,
101 TransCallback callback
);
102 void sip_transport_subscribe(struct sipe_core_private
*sipe_private
,
104 const gchar
*addheaders
,
106 struct sip_dialog
*dialog
,
107 TransCallback callback
);
108 void sip_transport_update(struct sipe_core_private
*sipe_private
,
109 struct sip_dialog
*dialog
,
110 TransCallback callback
);
112 /* Misc. SIP transport stuff */
113 guint
sip_transport_port(struct sipe_core_private
*sipe_private
);
114 void sip_transport_deregister(struct sipe_core_private
*sipe_private
);
115 void sip_transport_disconnect(struct sipe_core_private
*sipe_private
);
116 void sip_transport_authentication_completed(struct sipe_core_private
*sipe_private
);
118 int sip_transaction_cseq(struct transaction
*trans
);
120 const gchar
*sip_transport_epid(struct sipe_core_private
*sipe_private
);
121 const gchar
*sip_transport_ip_address(struct sipe_core_private
*sipe_private
);
122 const gchar
*sip_transport_sdp_address_marker(struct sipe_core_private
*sipe_private
);