SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eXosip.h
Go to the documentation of this file.
1 /*
2  eXosip - This is the eXtended osip library.
3  Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
4 
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.
9 
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.
14 
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
18 */
19 
20 
21 #ifdef ENABLE_MPATROL
22 #include <mpatrol.h>
23 #endif
24 
25 #ifndef __EXOSIP_H__
26 #define __EXOSIP_H__
27 
28 #include <eXosip2/eX_setup.h>
29 #include <eXosip2/eX_register.h>
30 #include <eXosip2/eX_call.h>
31 #include <eXosip2/eX_options.h>
32 #include <eXosip2/eX_subscribe.h>
33 #include <eXosip2/eX_refer.h>
34 #include <eXosip2/eX_message.h>
35 #include <eXosip2/eX_publish.h>
36 
39 #include <time.h>
40 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
81  typedef struct eXosip_event eXosip_event_t;
82 
101  int eXosip_add_authentication_info (struct eXosip_t *excontext, const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm);
102 
110  int eXosip_remove_authentication_info (struct eXosip_t *excontext, const char *username, const char *realm);
111 
117  int eXosip_clear_authentication_info (struct eXosip_t *excontext);
118 
132  int eXosip_default_action (struct eXosip_t *excontext, eXosip_event_t * je);
133 
143  void eXosip_automatic_refresh (struct eXosip_t *excontext);
144 
156  void eXosip_automatic_action (struct eXosip_t *excontext);
157 
158 #ifndef MINISIZE
159 
165  int eXosip_insubscription_automatic (struct eXosip_t *excontext, eXosip_event_t * evt);
166 #endif
167 
174  int eXosip_generate_random (char *buf, int buf_size);
175 
191  sdp_message_t *eXosip_get_remote_sdp (struct eXosip_t *excontext, int did);
192 
199  sdp_message_t *eXosip_get_local_sdp (struct eXosip_t *excontext, int did);
200 
207  sdp_message_t *eXosip_get_previous_local_sdp (struct eXosip_t *excontext, int did);
208 
215  sdp_message_t *eXosip_get_remote_sdp_from_tid (struct eXosip_t *excontext, int tid);
216 
223  sdp_message_t *eXosip_get_local_sdp_from_tid (struct eXosip_t *excontext, int tid);
224 
231 
238 
245 
252 
259 
266  sdp_connection_t *eXosip_get_connection (sdp_message_t * sdp, const char *media);
267 
274  sdp_media_t *eXosip_get_media (sdp_message_t * sdp, const char *media);
275 
288  typedef enum eXosip_event_type {
289  /* REGISTER related events */
293  /* INVITE related events within calls */
309  /* request related events within calls (except INVITE) */
320  /* for both UAS & UAC events */
323  /* response received for request outside calls */
332  /* Presence and Instant Messaging */
354 
359  struct eXosip_event {
361  char textinfo[256];
368  int tid;
369  int did;
371  int rid;
372  int cid;
373  int sid;
374  int nid;
376  int ss_status;
377  int ss_reason;
378  };
379 
385  void eXosip_event_free (eXosip_event_t * je);
386 
394  eXosip_event_t *eXosip_event_wait (struct eXosip_t *excontext, int tv_s, int tv_ms);
395 
396 
407  eXosip_event_t *eXosip_event_get (struct eXosip_t *excontext);
408 
416  int eXosip_event_geteventsocket (struct eXosip_t *excontext);
417 
420 #ifdef __cplusplus
421 }
422 #endif
423 #endif
Structure for SIP Message (REQUEST and RESPONSE).
Definition: osip_message.h:55
announce a failure.
Definition: eXosip.h:316
user is successfully registred.
Definition: eXosip.h:290
announce a failure.
Definition: eXosip.h:329
ACK received for 200ok to INVITE.
Definition: eXosip.h:305
announce a server failure
Definition: eXosip.h:303
announce a 200ok
Definition: eXosip.h:346
announce a server failure
Definition: eXosip.h:349
announce new NOTIFY request
Definition: eXosip.h:340
sdp_message_t * eXosip_get_sdp_info(osip_message_t *message)
Get local SDP body for the given message.
eXosip call API
Structure for event description.
Definition: eXosip.h:359
int did
unique id for SIP dialogs
Definition: eXosip.h:369
void eXosip_event_free(eXosip_event_t *je)
Free ressource in an eXosip event.
int eXosip_default_action(struct eXosip_t *excontext, eXosip_event_t *je)
Initiate some default actions:
sdp_media_t * eXosip_get_audio_media(sdp_message_t *sdp)
Get audio media information for call.
announce a global failure
Definition: eXosip.h:339
sdp_connection_t * eXosip_get_video_connection(sdp_message_t *sdp)
Get video connection information for call.
user is not registred.
Definition: eXosip.h:291
int eXosip_insubscription_automatic(struct eXosip_t *excontext, eXosip_event_t *evt)
Automatic internal handling of dialog package.
announce processing by a remote app
Definition: eXosip.h:298
announce a 1xx for request.
Definition: eXosip.h:311
announce a request failure
Definition: eXosip.h:302
oSIP SDP parser Routines
announce a redirection
Definition: eXosip.h:301
announce new incoming request.
Definition: eXosip.h:310
call context is cleared.
Definition: eXosip.h:321
announce a global failure
Definition: eXosip.h:350
announce a 1xx for request.
Definition: eXosip.h:325
announce a redirection
Definition: eXosip.h:347
sdp_connection_t * eXosip_get_connection(sdp_message_t *sdp, const char *media)
Get media connection information for call.
announce a failure.
Definition: eXosip.h:330
eXosip transfer outside of calls API
announce new incoming request.
Definition: eXosip.h:324
int cid
unique id for SIP calls (but multiple dialogs!)
Definition: eXosip.h:372
announce a failure.
Definition: eXosip.h:315
SDP connection definition.
Definition: sdp_message.h:164
int ss_status
current Subscription-State for subscription
Definition: eXosip.h:376
announce a new call
Definition: eXosip.h:294
MAX number of events.
Definition: eXosip.h:352
int nid
unique id for incoming subscriptions
Definition: eXosip.h:374
int eXosip_event_geteventsocket(struct eXosip_t *excontext)
This socket receive some data yhen an event happens internally.
int eXosip_remove_authentication_info(struct eXosip_t *excontext, const char *username, const char *realm)
Remove authentication credentials.
announce a request failure
Definition: eXosip.h:337
int eXosip_add_authentication_info(struct eXosip_t *excontext, const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm)
Add authentication credentials.
void eXosip_automatic_refresh(struct eXosip_t *excontext)
Initiate some automatic actions:
announce a 200ok
Definition: eXosip.h:326
eXosip options request API
sdp_message_t * eXosip_get_remote_sdp_from_tid(struct eXosip_t *excontext, int tid)
Get remote SDP body for the latest INVITE of call.
announce new incoming SUBSCRIBE.
Definition: eXosip.h:342
int sid
unique id for outgoing subscriptions
Definition: eXosip.h:373
announce a failure.
Definition: eXosip.h:328
osip_message_t * request
request within current transaction
Definition: eXosip.h:364
announce a server failure
Definition: eXosip.h:338
announce no answer
Definition: eXosip.h:344
SDP media definition.
Definition: sdp_message.h:195
announce a failure.
Definition: eXosip.h:314
announce a new INVITE within call
Definition: eXosip.h:295
eXosip_event_t * eXosip_event_get(struct eXosip_t *excontext)
Wait for next eXosip event.
announce that call has been cancelled
Definition: eXosip.h:307
announce no answer within the timeout
Definition: eXosip.h:297
eXosip_event_t * eXosip_event_wait(struct eXosip_t *excontext, int tv_s, int tv_ms)
Wait for an eXosip event.
sdp_message_t * eXosip_get_local_sdp(struct eXosip_t *excontext, int did)
Get local SDP body for the latest INVITE of call.
announce no answer
Definition: eXosip.h:333
eXosip_event_type
Structure for event type description.
Definition: eXosip.h:288
int eXosip_generate_random(char *buf, int buf_size)
Generate random string:
SDP message definition.
Definition: sdp_message.h:233
sdp_message_t * eXosip_get_remote_sdp(struct eXosip_t *excontext, int did)
Get remote SDP body for the latest INVITE of call.
void eXosip_automatic_action(struct eXosip_t *excontext)
Initiate some automatic actions:
sdp_connection_t * eXosip_get_audio_connection(sdp_message_t *sdp)
Get audio connection information for call.
announce a failure.
Definition: eXosip.h:313
a BYE was received for this call
Definition: eXosip.h:318
announce ringback
Definition: eXosip.h:299
sdp_message_t * eXosip_get_previous_local_sdp(struct eXosip_t *excontext, int did)
Get local SDP body for the previous latest INVITE of call.
announce a 200ok
Definition: eXosip.h:312
announce a global failure
Definition: eXosip.h:304
oSIP SIP Parser additionnal Routines
osip_message_t * ack
ack within current transaction
Definition: eXosip.h:366
eXosip subscribe request API
eXosip request API
int ss_reason
current Reason status for subscription
Definition: eXosip.h:377
announce a 200ok
Definition: eXosip.h:335
int tid
unique id for transactions (to be used for answers)
Definition: eXosip.h:368
sdp_media_t * eXosip_get_video_media(sdp_message_t *sdp)
Get video media information for call.
announce a redirection
Definition: eXosip.h:336
char textinfo[256]
text description of event
Definition: eXosip.h:361
int rid
unique id for registration
Definition: eXosip.h:371
osip_message_t * response
last response within current transaction
Definition: eXosip.h:365
eXosip registration API
announce start of call
Definition: eXosip.h:300
eXosip_event_type_t type
type of the event
Definition: eXosip.h:360
sdp_media_t * eXosip_get_media(sdp_message_t *sdp, const char *media)
Get media information for call.
announce a failure.
Definition: eXosip.h:327
announce a request failure
Definition: eXosip.h:348
enum eXosip_event_type eXosip_event_type_t
sdp_message_t * eXosip_get_local_sdp_from_tid(struct eXosip_t *excontext, int tid)
Get local SDP body for the latest INVITE of call.
eXosip setup API
void * external_reference
external reference (for calls)
Definition: eXosip.h:362
int eXosip_clear_authentication_info(struct eXosip_t *excontext)
Clear all authentication credentials stored in eXosip.
eXosip publish request API