SIP Witch 1.9.15: eXosip.h Source File

SIP Witch 1.9.15
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 
37 #include <osipparser2/osip_parser.h>
38 #include <osipparser2/sdp_message.h>
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 
230  sdp_message_t *eXosip_get_sdp_info (osip_message_t * message);
231 
237  sdp_connection_t *eXosip_get_audio_connection (sdp_message_t * sdp);
238 
244  sdp_media_t *eXosip_get_audio_media (sdp_message_t * sdp);
245 
251  sdp_connection_t *eXosip_get_video_connection (sdp_message_t * sdp);
252 
258  sdp_media_t *eXosip_get_video_media (sdp_message_t * sdp);
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 */
290   EXOSIP_REGISTRATION_SUCCESS,
291   EXOSIP_REGISTRATION_FAILURE,
293  /* INVITE related events within calls */
294   EXOSIP_CALL_INVITE,
295   EXOSIP_CALL_REINVITE,
297   EXOSIP_CALL_NOANSWER,
298   EXOSIP_CALL_PROCEEDING,
299   EXOSIP_CALL_RINGING,
300   EXOSIP_CALL_ANSWERED,
301   EXOSIP_CALL_REDIRECTED,
302   EXOSIP_CALL_REQUESTFAILURE,
303   EXOSIP_CALL_SERVERFAILURE,
304   EXOSIP_CALL_GLOBALFAILURE,
305   EXOSIP_CALL_ACK,
307   EXOSIP_CALL_CANCELLED,
309  /* request related events within calls (except INVITE) */
310   EXOSIP_CALL_MESSAGE_NEW,
311   EXOSIP_CALL_MESSAGE_PROCEEDING,
312   EXOSIP_CALL_MESSAGE_ANSWERED,
313   EXOSIP_CALL_MESSAGE_REDIRECTED,
314   EXOSIP_CALL_MESSAGE_REQUESTFAILURE,
315   EXOSIP_CALL_MESSAGE_SERVERFAILURE,
316   EXOSIP_CALL_MESSAGE_GLOBALFAILURE,
318   EXOSIP_CALL_CLOSED,
320  /* for both UAS & UAC events */
321   EXOSIP_CALL_RELEASED,
323  /* response received for request outside calls */
324   EXOSIP_MESSAGE_NEW,
325   EXOSIP_MESSAGE_PROCEEDING,
326   EXOSIP_MESSAGE_ANSWERED,
327   EXOSIP_MESSAGE_REDIRECTED,
328   EXOSIP_MESSAGE_REQUESTFAILURE,
329   EXOSIP_MESSAGE_SERVERFAILURE,
330   EXOSIP_MESSAGE_GLOBALFAILURE,
332  /* Presence and Instant Messaging */
333   EXOSIP_SUBSCRIPTION_NOANSWER,
334   EXOSIP_SUBSCRIPTION_PROCEEDING,
335   EXOSIP_SUBSCRIPTION_ANSWERED,
336   EXOSIP_SUBSCRIPTION_REDIRECTED,
337   EXOSIP_SUBSCRIPTION_REQUESTFAILURE,
338   EXOSIP_SUBSCRIPTION_SERVERFAILURE,
339   EXOSIP_SUBSCRIPTION_GLOBALFAILURE,
340   EXOSIP_SUBSCRIPTION_NOTIFY,
342   EXOSIP_IN_SUBSCRIPTION_NEW,
344   EXOSIP_NOTIFICATION_NOANSWER,
345   EXOSIP_NOTIFICATION_PROCEEDING,
346   EXOSIP_NOTIFICATION_ANSWERED,
347   EXOSIP_NOTIFICATION_REDIRECTED,
348   EXOSIP_NOTIFICATION_REQUESTFAILURE,
349   EXOSIP_NOTIFICATION_SERVERFAILURE,
350   EXOSIP_NOTIFICATION_GLOBALFAILURE,
352   EXOSIP_EVENT_COUNT
353  } eXosip_event_type_t;
354 
359   struct eXosip_event {
360   eXosip_event_type_t type;
361   char textinfo[256];
362   void *external_reference;
364   osip_message_t *request;
365   osip_message_t *response;
366   osip_message_t *ack;
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
osip_message
Structure for SIP Message (REQUEST and RESPONSE).
Definition: osip_message.h:55
EXOSIP_CALL_MESSAGE_GLOBALFAILURE
announce a failure.
Definition: eXosip.h:316
EXOSIP_REGISTRATION_SUCCESS
user is successfully registred.
Definition: eXosip.h:290
EXOSIP_MESSAGE_SERVERFAILURE
announce a failure.
Definition: eXosip.h:329
EXOSIP_CALL_ACK
ACK received for 200ok to INVITE.
Definition: eXosip.h:305
EXOSIP_CALL_SERVERFAILURE
announce a server failure
Definition: eXosip.h:303
EXOSIP_NOTIFICATION_ANSWERED
announce a 200ok
Definition: eXosip.h:346
EXOSIP_NOTIFICATION_SERVERFAILURE
announce a server failure
Definition: eXosip.h:349
EXOSIP_SUBSCRIPTION_NOTIFY
announce new NOTIFY request
Definition: eXosip.h:340
eXosip_get_sdp_info
sdp_message_t * eXosip_get_sdp_info(osip_message_t *message)
Get local SDP body for the given message.
eX_call.h
eXosip call API
eXosip_event
Structure for event description.
Definition: eXosip.h:359
eXosip_event::did
int did
unique id for SIP dialogs
Definition: eXosip.h:369
eXosip_event_free
void eXosip_event_free(eXosip_event_t *je)
Free ressource in an eXosip event.
eXosip_default_action
int eXosip_default_action(struct eXosip_t *excontext, eXosip_event_t *je)
Initiate some default actions:
eXosip_get_audio_media
sdp_media_t * eXosip_get_audio_media(sdp_message_t *sdp)
Get audio media information for call.
EXOSIP_SUBSCRIPTION_GLOBALFAILURE
announce a global failure
Definition: eXosip.h:339
eXosip_get_video_connection
sdp_connection_t * eXosip_get_video_connection(sdp_message_t *sdp)
Get video connection information for call.
EXOSIP_REGISTRATION_FAILURE
user is not registred.
Definition: eXosip.h:291
eXosip_insubscription_automatic
int eXosip_insubscription_automatic(struct eXosip_t *excontext, eXosip_event_t *evt)
Automatic internal handling of dialog package.
EXOSIP_CALL_PROCEEDING
announce processing by a remote app
Definition: eXosip.h:298
EXOSIP_CALL_MESSAGE_PROCEEDING
announce a 1xx for request.
Definition: eXosip.h:311
EXOSIP_CALL_REQUESTFAILURE
announce a request failure
Definition: eXosip.h:302
sdp_message.h
oSIP SDP parser Routines
EXOSIP_CALL_REDIRECTED
announce a redirection
Definition: eXosip.h:301
EXOSIP_CALL_MESSAGE_NEW
announce new incoming request.
Definition: eXosip.h:310
EXOSIP_CALL_RELEASED
call context is cleared.
Definition: eXosip.h:321
EXOSIP_NOTIFICATION_GLOBALFAILURE
announce a global failure
Definition: eXosip.h:350
EXOSIP_MESSAGE_PROCEEDING
announce a 1xx for request.
Definition: eXosip.h:325
EXOSIP_NOTIFICATION_REDIRECTED
announce a redirection
Definition: eXosip.h:347
eXosip_get_connection
sdp_connection_t * eXosip_get_connection(sdp_message_t *sdp, const char *media)
Get media connection information for call.
EXOSIP_MESSAGE_GLOBALFAILURE
announce a failure.
Definition: eXosip.h:330
EXOSIP_SUBSCRIPTION_PROCEEDING
announce a 1xx
Definition: eXosip.h:334
eX_refer.h
eXosip transfer outside of calls API
EXOSIP_MESSAGE_NEW
announce new incoming request.
Definition: eXosip.h:324
eXosip_event::cid
int cid
unique id for SIP calls (but multiple dialogs!)
Definition: eXosip.h:372
EXOSIP_CALL_MESSAGE_SERVERFAILURE
announce a failure.
Definition: eXosip.h:315
sdp_connection
SDP connection definition.
Definition: sdp_message.h:164
eXosip_event::ss_status
int ss_status
current Subscription-State for subscription
Definition: eXosip.h:376
EXOSIP_CALL_INVITE
announce a new call
Definition: eXosip.h:294
EXOSIP_EVENT_COUNT
MAX number of events.
Definition: eXosip.h:352
eXosip_event::nid
int nid
unique id for incoming subscriptions
Definition: eXosip.h:374
eXosip_event_geteventsocket
int eXosip_event_geteventsocket(struct eXosip_t *excontext)
This socket receive some data yhen an event happens internally.
eXosip_remove_authentication_info
int eXosip_remove_authentication_info(struct eXosip_t *excontext, const char *username, const char *realm)
Remove authentication credentials.
EXOSIP_SUBSCRIPTION_REQUESTFAILURE
announce a request failure
Definition: eXosip.h:337
eXosip_add_authentication_info
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.
eXosip_automatic_refresh
void eXosip_automatic_refresh(struct eXosip_t *excontext)
Initiate some automatic actions:
EXOSIP_MESSAGE_ANSWERED
announce a 200ok
Definition: eXosip.h:326
eX_options.h
eXosip options request API
eXosip_get_remote_sdp_from_tid
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.
EXOSIP_IN_SUBSCRIPTION_NEW
announce new incoming SUBSCRIBE.
Definition: eXosip.h:342
EXOSIP_NOTIFICATION_PROCEEDING
announce a 1xx
Definition: eXosip.h:345
eXosip_event::sid
int sid
unique id for outgoing subscriptions
Definition: eXosip.h:373
EXOSIP_MESSAGE_REQUESTFAILURE
announce a failure.
Definition: eXosip.h:328
eXosip_event::request
osip_message_t * request
request within current transaction
Definition: eXosip.h:364
EXOSIP_SUBSCRIPTION_SERVERFAILURE
announce a server failure
Definition: eXosip.h:338
EXOSIP_NOTIFICATION_NOANSWER
announce no answer
Definition: eXosip.h:344
sdp_media
SDP media definition.
Definition: sdp_message.h:195
EXOSIP_CALL_MESSAGE_REQUESTFAILURE
announce a failure.
Definition: eXosip.h:314
EXOSIP_CALL_REINVITE
announce a new INVITE within call
Definition: eXosip.h:295
eXosip_event_get
eXosip_event_t * eXosip_event_get(struct eXosip_t *excontext)
Wait for next eXosip event.
EXOSIP_CALL_CANCELLED
announce that call has been cancelled
Definition: eXosip.h:307
EXOSIP_CALL_NOANSWER
announce no answer within the timeout
Definition: eXosip.h:297
eXosip_event_wait
eXosip_event_t * eXosip_event_wait(struct eXosip_t *excontext, int tv_s, int tv_ms)
Wait for an eXosip event.
eXosip_get_local_sdp
sdp_message_t * eXosip_get_local_sdp(struct eXosip_t *excontext, int did)
Get local SDP body for the latest INVITE of call.
EXOSIP_SUBSCRIPTION_NOANSWER
announce no answer
Definition: eXosip.h:333
eXosip_event_type
eXosip_event_type
Structure for event type description.
Definition: eXosip.h:288
eXosip_generate_random
int eXosip_generate_random(char *buf, int buf_size)
Generate random string:
sdp_message
SDP message definition.
Definition: sdp_message.h:233
eXosip_get_remote_sdp
sdp_message_t * eXosip_get_remote_sdp(struct eXosip_t *excontext, int did)
Get remote SDP body for the latest INVITE of call.
eXosip_automatic_action
void eXosip_automatic_action(struct eXosip_t *excontext)
Initiate some automatic actions:
eXosip_get_audio_connection
sdp_connection_t * eXosip_get_audio_connection(sdp_message_t *sdp)
Get audio connection information for call.
EXOSIP_CALL_MESSAGE_REDIRECTED
announce a failure.
Definition: eXosip.h:313
EXOSIP_CALL_CLOSED
a BYE was received for this call
Definition: eXosip.h:318
EXOSIP_CALL_RINGING
announce ringback
Definition: eXosip.h:299
eXosip_get_previous_local_sdp
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.
EXOSIP_CALL_MESSAGE_ANSWERED
announce a 200ok
Definition: eXosip.h:312
EXOSIP_CALL_GLOBALFAILURE
announce a global failure
Definition: eXosip.h:304
osip_parser.h
oSIP SIP Parser additionnal Routines
eXosip_event::ack
osip_message_t * ack
ack within current transaction
Definition: eXosip.h:366
eX_subscribe.h
eXosip subscribe request API
eX_message.h
eXosip request API
eXosip_event::ss_reason
int ss_reason
current Reason status for subscription
Definition: eXosip.h:377
EXOSIP_SUBSCRIPTION_ANSWERED
announce a 200ok
Definition: eXosip.h:335
eXosip_event::tid
int tid
unique id for transactions (to be used for answers)
Definition: eXosip.h:368
eXosip_get_video_media
sdp_media_t * eXosip_get_video_media(sdp_message_t *sdp)
Get video media information for call.
EXOSIP_SUBSCRIPTION_REDIRECTED
announce a redirection
Definition: eXosip.h:336
eXosip_event::textinfo
char textinfo[256]
text description of event
Definition: eXosip.h:361
eXosip_event::rid
int rid
unique id for registration
Definition: eXosip.h:371
eXosip_event::response
osip_message_t * response
last response within current transaction
Definition: eXosip.h:365
eX_register.h
eXosip registration API
EXOSIP_CALL_ANSWERED
announce start of call
Definition: eXosip.h:300
eXosip_event::type
eXosip_event_type_t type
type of the event
Definition: eXosip.h:360
eXosip_get_media
sdp_media_t * eXosip_get_media(sdp_message_t *sdp, const char *media)
Get media information for call.
EXOSIP_MESSAGE_REDIRECTED
announce a failure.
Definition: eXosip.h:327
EXOSIP_NOTIFICATION_REQUESTFAILURE
announce a request failure
Definition: eXosip.h:348
eXosip_event_type_t
enum eXosip_event_type eXosip_event_type_t
eXosip_get_local_sdp_from_tid
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.
eX_setup.h
eXosip setup API
eXosip_event::external_reference
void * external_reference
external reference (for calls)
Definition: eXosip.h:362
eXosip_clear_authentication_info
int eXosip_clear_authentication_info(struct eXosip_t *excontext)
Clear all authentication credentials stored in eXosip.
eX_publish.h
eXosip publish request API

Generated on Dec 21, 2017 for sipwitch-1.9.15 (*.h and *.cpp), libosip2-5.0.0 (*.h) and libeXosip2-4.0.0 (*.h), by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /