6 * Copyright (C) 2009-11 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
24 * Interface dependencies:
29 /* Forward declarations */
32 /* Helper macros to iterate over dialog list in a SIP session */
33 #define SIPE_DIALOG_FOREACH { \
34 GSList *entry = session->dialogs; \
36 struct sip_dialog *dialog = entry->data; \
38 #define SIPE_DIALOG_FOREACH_END }}
40 /* dialog is the new term for call-leg */
42 gchar
*with
; /* URI */
47 * 0 - didn't participate
56 GSList
*supported
; /* counterparty capabilities */
57 GSList
*filetransfers
;
59 /** corresponds to Session-Expires SIP header value */
61 gboolean is_established
;
62 struct transaction
*outgoing_invite
;
65 /* Forward declaration */
69 * Free dialog structure
71 * @param dialog (in) Dialog to be freed. May be NULL.
73 void sipe_dialog_free(struct sip_dialog
*dialog
);
76 * Add a new, empty dialog to a session
80 * @return dialog the new dialog structure
82 struct sip_dialog
*sipe_dialog_add(struct sip_session
*session
);
85 * Find a dialog in a session
87 * @param session (in) may be NULL
88 * @param who (in) dialog identifier. May be NULL
90 * @return dialog the requested dialog or NULL
92 struct sip_dialog
*sipe_dialog_find(struct sip_session
*session
,
96 * Remove a dialog from a session
98 * @param session (in) may be NULL
99 * @param who (in) dialog identifier. May be NULL
101 void sipe_dialog_remove(struct sip_session
*session
, const gchar
*who
);
104 * Remove a dialog from a session
106 * @param session (in) may be NULL
107 * @param dialog (in) dialog identifier. Should contain Call-ID, to-tag and from-tag
108 * to unambiguously identify dialog. May be NULL
111 sipe_dialog_remove_3(struct sip_session
*session
,
112 struct sip_dialog
*dialog_in
);
115 * Remove all dialogs from a session
117 * @param session (in)
119 void sipe_dialog_remove_all(struct sip_session
*session
);
122 * Does a session have any dialogs?
124 * @param session (in)
126 #define sipe_dialog_any(session) (session->dialogs != NULL)
129 * Return first dialog of a session
131 * @param session (in)
133 #define sipe_dialog_first(session) ((struct sip_dialog *)session->dialogs->data)
136 * Fill dialog structure from SIP message
138 * @param dialog (in,out) dialog to fill
139 * @param msg (in) mesage
140 * @param outgoing (in) outgoing or incoming message
142 void sipe_dialog_parse(struct sip_dialog
*dialog
,
143 const struct sipmsg
*msg
,