Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

howto0_initialize(3) [debian man page]

How-To initialize libeXosip2.(3)				    libeXosip2					  How-To initialize libeXosip2.(3)

NAME
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 <eXosip2/eXosip.h> 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, 'could not initialize transport layer '); return -1; } ... then you have to send messages and wait for eXosip events... In the previous code, you've learned how to: o Initialize the osip trace (compile this code with -DENABLE_TRACE) o Initialize eXosip (and osip) stack o 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 original request of the affected transaction and the last response that triggers the event when available. You can access all headers from those messages and store them in your own context for other actions or graphic displays. For example, when you receive a REFER request for a call transfer, you'll typically retreive the 'refer-To' header: osip_header_t *referto_head = NULL; i = osip_message_header_get_byname (evt->sip, 'refer-to', 0, &referto_head); if (referto_head == NULL || referto_head->hvalue == NULL) The eXosip_event also contains identifiers for calls, registrations, incoming subscriptions or outgoing subscriptions when applicable. Those identifiers are used in API to control calls, registrations, incoming or outgoing subscriptions. These API will build default messages with usual SIP headers (From, To, Call-ID, CSeq, Route, Record-Route, Max-Forward...) and send thoses messages for you. Author Generated automatically by Doxygen for libeXosip2 from the source code. Version 3.1.0 Sun Jun 24 2012 How-To initialize libeXosip2.(3)

Check Out this Related Man Page

The eXtented eXosip stack(3)					    libeXosip2					      The eXtented eXosip stack(3)

NAME
The eXtented eXosip stack - libeXosip2 Version 3.6.0 Modules How-To initialize libeXosip2. How-To initiate, modify or terminate calls. How-To send or update registrations. Detailed Description libeXosip2 Version 3.6.0 See also: http://savannah.gnu.org/projects/exosip What is eXosip libeXosip2 implements the Session Initiation Protocol (SIP -rfc3261-) libeXosip2 is GPL (COPYING). Please understand the licencing details before using it! For any use of this library beyond the rights granted to you by the GPL license, please contact my company at jack@atosc.org. What is the relation between osip &; eXosip2 The GNU osip stack is the first step needed to implement SIP applications. As a low layer stack, there is no limitation in the way to use it, but the very large API makes it rather complex and not suitable for beginners. The eXtended eXosip library is based on osip and implements a lot more SIP stuff so you can quickly build compliant SIP applications. The API is enough flexible to allow you to control and complete SIP messages. Thus, it keeps the stack extensible. While osip can be used for any SIP applications, eXosip2 only provide APIs to control endpoints. What is SIP SIP is an IP telephony protocol made by the IETF. It is an effort to create a simple (telephony is never simple) and powerful protocol for next generation telephony systems. SIP features SIP is not just about telephony. It's much more that what you expect from phones. SIP means mobility, video, textual call information, file exchange, instant messaging, presence support and much more! eXosip2 is free software As eXosip2 is GPL, you MUST choose to release your SIP applications based on eXosip2 under the GPL license. For any use of this library beyond the rights granted to you by the GPL license, please contact my company at jack@atosc.org. With oSIP (which is LGPL), you still have the choice to implement close source application and link with oSIP. For the benefit of the community (and for your own benefit), please consider implementing your application in GPL. Still with osip, you have to respect the license terms. Mainly, users of your software must be able to fix bugs in osip themselves. (they must have the source code, be able to compile it and link your product with the new version.) Thanks Thanks to all the contributors and to all bug reporters. Enjoy osip! Author Generated automatically by Doxygen for libeXosip2 from the source code. Version 3.1.0 Sun Jun 24 2012 The eXtented eXosip stack(3)
Man Page