~ubuntu-branches/ubuntu/quantal/linphone/quantal

« back to all changes in this revision

Viewing changes to osipua/src/osipdialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2006-11-15 10:34:50 UTC
  • mfrom: (1.2.1 upstream) (2.1.8 feisty)
  • Revision ID: james.westby@ubuntu.com-20061115103450-qgafwcks2lkhctlj
* New upstream release.
* Enable video support.
* Fix mismatched #endif in mscommon.h, closes: #398307.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
  The osipua library is a library based on oSIP that implements CallLeg and User Agent
3
 
  level.
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.
10
 
 
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.
15
 
 
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
19
 
*/
20
 
 
21
 
#ifndef OSIPUA_H
22
 
#error "You must not include osipcallleg.h in an application. Use osipua.h instead."
23
 
#endif
24
 
 
25
 
#ifndef OSIP_CALL_LEG_H
26
 
#define OSIP_CALL_LEG_H
27
 
 
28
 
#include <osip/smsgtypes.h>
29
 
 
30
 
#include "regctxt.h"
31
 
 
32
 
/* status for call-legs*/
33
 
enum { DIALOG_NEW, DIALOG_INVITING, DIALOG_INVITED, DIALOG_ESTABLISHED, DIALOG_CANCELLING, DIALOG_CANCELLED,
34
 
                         DIALOG_TERMINATED, DIALOG_FAKE};
35
 
 
36
 
/* the list of call-legs handled by the stack*/
37
 
extern list_t callleg_list;
38
 
 
39
 
 
40
 
/* create a new call-leg managed by an existing use agent*/
41
 
OsipDialog *osip_dialog_new(struct _OsipUA *ua);
42
 
 
43
 
OsipDialog *osip_dialog_new_from_incoming_trn(transaction_t *trn);
44
 
 
45
 
void osip_dialog_update_from_response(OsipDialog *call,sip_t *resp);
46
 
 
47
 
void osip_dialog_update_from_request(OsipDialog *dia, sip_t *sipmsg);
48
 
 
49
 
#define osip_dialog_set_state(call, state) (call)->status=(state)
50
 
 
51
 
#define osip_dialog_get_state(call) ((call)->status)
52
 
 
53
 
/* returns 1 if call leg exists*/
54
 
int osip_dialog_exists(OsipDialog *call);
55
 
 
56
 
/* returns the ua that owns the call leg*/
57
 
#define osip_dialog_get_ua(call) ((struct _OsipUA*)(call->ua))
58
 
 
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);
61
 
 
62
 
/* find an existing call leg using a transaction id*/
63
 
//OsipDialog *osip_dialog_find_with_tid(int tid);
64
 
 
65
 
 
66
 
/* accept an invitation for an existing call-leg*/
67
 
void osip_dialog_accept_invite(OsipDialog *call_leg,transaction_t *trn);
68
 
 
69
 
/* invite somebody */
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);
73
 
 
74
 
/* register your identity to a registrar */
75
 
int osip_dialog_register(OsipDialog *call_leg, RegistrationCtxt *ctxt);
76
 
/* action can be :*/
77
 
 
78
 
int osip_dialog_register_with_authentication(OsipDialog *call_leg,sip_t *previous_answer, char *password);
79
 
 
80
 
/* unregister user's identity to a registrar*/
81
 
int osip_dialog_unregister(OsipDialog *call, RegistrationCtxt *ctxt);
82
 
 
83
 
/* get the list media streams with their profile when a call is starting*/
84
 
//list_t * osip_dialog_get_streams(OsipDialog *call_leg);
85
 
 
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);
90
 
 
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,
94
 
                                 char *method_name,
95
 
                                 char *callee, sip_t **dest);
96
 
                                 
97
 
int osip_dialog_send_request(OsipDialog *call_leg,sip_t *sipmsg);
98
 
 
99
 
int
100
 
osip_dialog_generate_response_default(OsipDialog *call_leg,
101
 
                                      int status, sip_t *request, sip_t **dest);
102
 
 
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);
105
 
 
106
 
void osip_dialog_send_response(OsipDialog *call,transaction_t *trn, sip_t *resp);
107
 
 
108
 
void osip_dialog_release(OsipDialog *call); 
109
 
 
110
 
/* Destroy a call-leg and remove it from ua list and stack list*/
111
 
int osip_dialog_destroy(OsipDialog *call);
112
 
 
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);
116
 
 
117
 
/* possible requests*/
118
 
#define INVITE 0
119
 
#define BYE 1
120
 
#define REGISTER 2
121
 
#define ACK 3
122
 
 
123
 
/* returns 1 if call is handled by ua*/
124
 
int osip_ua_call_leg_exists(OsipUA *ua,OsipDialog *call);
125
 
 
126
 
 
127
 
void osip_dialog_add_body_context(OsipDialog *call, BodyContext *handler);
128
 
 
129
 
BodyContext * osip_dialog_get_body_context(OsipDialog *call, char *body_mime, int pos);
130
 
 
131
 
int osip_dialog_add_body_to_request(OsipDialog *call, sip_t *msg, char *body_mime);
132
 
 
133
 
#endif