2
The osipua library is a library based on oSIP that implements CallLeg and User Agent
4
Copyright (C) 2001 Simon MORLAT simon.morlat@free.fr
5
Aymeric MOIZARD jack@atosc.org
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
#error "You must not include osipcallleg.h in an application. Use osipua.h instead."
25
#ifndef OSIP_CALL_LEG_H
26
#define OSIP_CALL_LEG_H
28
#include <osip/smsgtypes.h>
32
/* status for call-legs*/
33
enum { DIALOG_NEW, DIALOG_INVITING, DIALOG_INVITED, DIALOG_ESTABLISHED, DIALOG_CANCELLING, DIALOG_CANCELLED,
34
DIALOG_TERMINATED, DIALOG_FAKE};
36
/* the list of call-legs handled by the stack*/
37
extern list_t callleg_list;
40
/* create a new call-leg managed by an existing use agent*/
41
OsipDialog *osip_dialog_new(struct _OsipUA *ua);
43
OsipDialog *osip_dialog_new_from_incoming_trn(transaction_t *trn);
45
void osip_dialog_update_from_response(OsipDialog *call,sip_t *resp);
47
void osip_dialog_update_from_request(OsipDialog *dia, sip_t *sipmsg);
49
#define osip_dialog_set_state(call, state) (call)->status=(state)
51
#define osip_dialog_get_state(call) ((call)->status)
53
/* returns 1 if call leg exists*/
54
int osip_dialog_exists(OsipDialog *call);
56
/* returns the ua that owns the call leg*/
57
#define osip_dialog_get_ua(call) ((struct _OsipUA*)(call->ua))
59
/* find an existing call_leg in the stack list using an incmoing sip message. Returns NULL if not found*/
60
int osip_dialog_find(sip_t *sipmsg, OsipDialog **ret_dialog);
62
/* find an existing call leg using a transaction id*/
63
//OsipDialog *osip_dialog_find_with_tid(int tid);
66
/* accept an invitation for an existing call-leg*/
67
void osip_dialog_accept_invite(OsipDialog *call_leg,transaction_t *trn);
70
int osip_dialog_invite(OsipDialog *call_leg, char *callee, char *body_mime);
71
int osip_dialog_reinvite_with_authentication(OsipDialog *call_leg,
72
sip_t *previous_answer, char *password);
74
/* register your identity to a registrar */
75
int osip_dialog_register(OsipDialog *call_leg, RegistrationCtxt *ctxt);
78
int osip_dialog_register_with_authentication(OsipDialog *call_leg,sip_t *previous_answer, char *password);
80
/* unregister user's identity to a registrar*/
81
int osip_dialog_unregister(OsipDialog *call, RegistrationCtxt *ctxt);
83
/* get the list media streams with their profile when a call is starting*/
84
//list_t * osip_dialog_get_streams(OsipDialog *call_leg);
86
void osip_dialog_ack(OsipDialog *call,transaction_t *trn);
87
/* bye and destroy the call-leg*/
88
int osip_dialog_bye(OsipDialog *call_leg);
89
int osip_dialog_reject_invite (OsipDialog * call_leg);
91
int osip_dialog_generate_request_within_dialog( OsipDialog *call_leg,
92
char *method_name,sip_t **dest);
93
int generating_request_out_of_dialog(OsipDialog * call_leg,
95
char *callee, sip_t **dest);
97
int osip_dialog_send_request(OsipDialog *call_leg,sip_t *sipmsg);
100
osip_dialog_generate_response_default(OsipDialog *call_leg,
101
int status, sip_t *request, sip_t **dest);
103
/* respond to a request that is part from a call-leg : ex 200OK (INVITE)*/
104
void osip_dialog_respond(OsipDialog *call, transaction_t *trn, int code);
106
void osip_dialog_send_response(OsipDialog *call,transaction_t *trn, sip_t *resp);
108
void osip_dialog_release(OsipDialog *call);
110
/* Destroy a call-leg and remove it from ua list and stack list*/
111
int osip_dialog_destroy(OsipDialog *call);
113
/* extract all media descriptors from a sdp_t, and find compatible profiles for each one*/
114
/* if compatible profile is found for ALL medias, return 0, else -1. The list of MediaDesc is stored in OsipDialog::media_list*/
115
//int osip_dialog_extract_media(OsipDialog *call,sdp_t *remote_sdp);
117
/* possible requests*/
123
/* returns 1 if call is handled by ua*/
124
int osip_ua_call_leg_exists(OsipUA *ua,OsipDialog *call);
127
void osip_dialog_add_body_context(OsipDialog *call, BodyContext *handler);
129
BodyContext * osip_dialog_get_body_context(OsipDialog *call, char *body_mime, int pos);
131
int osip_dialog_add_body_to_request(OsipDialog *call, sip_t *msg, char *body_mime);