exoSip 开发者手册
——本手册指导开发者利用exoSip 栈开发用户代理
原文标题:exoSIP User Manual
1 The eXtented eXosip stack.............................................................................................................4
1.1 How-To initialize libeXosip2........................................................................................4 1.2 How-To initiate, modify or terminate calls. ..................................................................5 1.2.1 Initiate a call......................................................................................................6 1.2.2 Answer a call.....................................................................................................7 1.2.3 Sending other request........................................................................................8 1.3 How-To send or update registrations. ...........................................................................9 1.3.1 Initiate a registration .........................................................................................9 1.3.2 Update a registration .........................................................................................9 1.3.3 Closing the registration ...................................................................................10 2 General purpose API ...............................................................................................................11 2.1 eXosip2 configuration API..........................................................................................11 2.1.1 Functions.......................................................................................................................11
2.1.2 Function Documentation.................................................................................11 2.2 eXosip2 network API ..................................................................................................14 2.2.2 Functions.........................................................................................................14 2.2.3 Function Documentation.................................................................................14 2.3 eXosip2 event API ............................................................................................................16 2.3.1 Data Structures.......................................................................................................16 2.3.2 Enumerations .........................................................................................................16 2.3.3 Functions.......................................................................................................................17 2.3.4 Enumeration Type Documentation.................................................................................17 2.3.5 Function Documentation................................................................................................19 3 SIP messages and call control API ..........................................................................................21 3.1 eXosip2 INVITE and Call Management.....................................................................21 3.1.1 Functions.........................................................................................................21 3.1.2 Function Documentation.................................................................................22 3.2 eXosip2 request outside of dialog ...............................................................................29 3.2.1 Functions.........................................................................................................29 3.2.2 Function Documentation.................................................................................29 3.3 eXosip2 OPTIONS and UA capabilities Management ...............................................31 3.3.1 Functions.........................................................................................................31 3.3.2 Function Documentation.................................................................................31 3.4 eXosip2 Publication Management ..............................................................................33 3.4.1 Functions.........................................................................................................33 3.4.2 Function Documentation.................................................................................33 3.5 eXosip2 REFER and blind tranfer Management outside of calls................................35 3.5.1 Functions.........................................................................................................35
3.5.2 Function Documentation.................................................................................35 3.6 eXosip2 REGISTER and Registration Management ..................................................37 3.6.1 Functions.........................................................................................................37 3.6.2 Function Documentation.................................................................................37 3.7 eXosip2 SUBSCRIBE and outgoing subscriptions.....................................................39 3.7.1 Enumerations...................................................................................................39 3.7.2 Functions.........................................................................................................39 3.7.3 Enumeration Type Documentation..................................................................40 3.7.4 Function Documentation.................................................................................41 3.8 eXosip2 SUBSCRIBE and incoming subscriptions....................................................43 3.8.1 Functions.........................................................................................................43 3.8.2 Function Documentation.................................................................................43 3.9 eXosip2 authentication API.........................................................................................46 3.9.1 Functions.........................................................................................................46 3.9.2 Function Documentation.................................................................................46 3.10 Xosip2 SDP helper API...............................................................................................48 3.10.1 Functions.........................................................................................................48 3.10.2 Function Documentation.................................................................................48
1 The eXtented eXosip stack 1.1 How-To initialize libeXosip2.
When using eXosip, your first task is to initialize both eXosip context and
libosip
library (parser and state machines). This must be done prior to any use of
libeXosip2.
include
int i;
TRACE_INITIALIZE (6, stdout);
i=eXosip_init();
if (i!=0) return -1;
i = eXosip_listen_addr (IPPROTO_UDP, NULL, port, AF_INET, 0);
if (i!=0) { eXosip_quit();
fprintf (stderr, \
return -1;
}
... then you have to send messages and wait for eXosip events...
In the previous code, you've learned how to:
? Initialize the osip trace (compile this code with -DENABLE_TRACE)
? Initialize eXosip (and osip) stack
? Open a socket for signalling (only UDP with initial eXosip2 version) Now you have to handle eXosip events. Here is some code to get
eXosip_event from the eXosip2 stack.
eXosip_event_t *je;
for (;;){
je = eXosip_event_wait (0, 50);
eXosip_lock(); eXosip_automatic_action ();
eXosip_unlock(); if (je == NULL)
break;
if (je->type == EXOSIP_CALL_NEW)
{ .... .... }
else if (je->type == EXOSIP_CALL_ACK)
{ .... .... }
else if (je->type == EXOSIP_CALL_ANSWERED)
{ .... .... } else ..... .... ....
eXosip_event_free(je);
}
You will receive one event for each SIP message sent. Each event
contains the
相关推荐: