2
eXosip - This is the eXtended osip library.
3
Copyright (C) 2002, 2003 Aymeric MOIZARD - jack@atosc.org
5
eXosip is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
eXosip 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.
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
27
#include <eXosip_cfg.h>
29
extern eXosip_t eXosip;
31
int eXosip_call_find(int cid, eXosip_call_t **jc)
33
for (*jc=eXosip.j_calls; *jc!=NULL; *jc=(*jc)->next)
45
eXosip_call_init(eXosip_call_t **jc)
47
*jc = (eXosip_call_t *)osip_malloc(sizeof(eXosip_call_t));
48
if (*jc == NULL) return -1;
49
memset(*jc, 0, sizeof(eXosip_call_t));
51
(*jc)->c_id = -1; /* make sure the eXosip_update will assign a valid id to the call */
52
osip_negotiation_ctx_init(&(*jc)->c_ctx);
57
__eXosip_call_remove_dialog_reference_in_call(eXosip_call_t *jc, eXosip_dialog_t *jd)
65
for (_jd = jc->c_dialogs; _jd!=NULL; _jd=jc->c_dialogs)
72
/* dialog not found??? */
75
ji = osip_transaction_get_your_instance(jc->c_inc_tr);
76
if (ji!=NULL && ji->jd==jd)
78
ji = osip_transaction_get_your_instance(jc->c_out_tr);
79
if (ji!=NULL && ji->jd==jd)
84
eXosip_call_free(eXosip_call_t *jc)
90
for (jd = jc->c_dialogs; jd!=NULL; jd=jc->c_dialogs)
92
REMOVE_ELEMENT(jc->c_dialogs, jd);
93
eXosip_dialog_free(jd);
96
__eXosip_delete_jinfo(jc->c_inc_tr);
97
__eXosip_delete_jinfo(jc->c_out_tr);
98
if (jc->c_inc_tr!=NULL)
99
osip_list_add(eXosip.j_transactions, jc->c_inc_tr, 0);
100
if (jc->c_out_tr!=NULL)
101
osip_list_add(eXosip.j_transactions, jc->c_out_tr, 0);
103
__eXosip_delete_jinfo(jc->c_inc_options_tr);
104
__eXosip_delete_jinfo(jc->c_out_options_tr);
105
if (jc->c_inc_options_tr!=NULL)
106
osip_list_add(eXosip.j_transactions, jc->c_inc_options_tr, 0);
107
if (jc->c_out_options_tr!=NULL)
108
osip_list_add(eXosip.j_transactions, jc->c_out_options_tr, 0);
111
osip_negotiation_ctx_free(jc->c_ctx);
117
eXosip_call_set_subject(eXosip_call_t *jc, char *subject)
119
if (jc==NULL||subject==NULL||subject[0]=='\0') return;
120
snprintf(jc->c_subject, 99, "%s", subject);