李思銳 voip_taiwan@yahoo.com.tw libosip2 / libexosip 李思銳 voip_taiwan@yahoo.com.tw.

Slides:



Advertisements
Similar presentations
SIP(Session Initiation Protocol) - SIP Messages
Advertisements

The Mobile Grid Concept Vicente Olmedo Technical University of Madrid.
Chapter 16. Windows Internet Name Service(WINS) Network Basic Input/Output System (NetBIOS) N etBIOS over TCP/IP (NetBT) provides commands and support.
Dynamic Allocation and Linked Lists. Dynamic memory allocation in C C uses the functions malloc() and free() to implement dynamic allocation. malloc is.
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
CSE 333 – SECTION 8 Networking and sockets. Overview Network Sockets IP addresses and IP address structures in C/C++ DNS – Resolving DNS names Demos.
1 SIP IPv6/IPv4 transition solutions 通訊所 鍾國麟. 2 Outline IPV6 transition problem NAT-PT + SIP ALG TZI gateway 3GPP – IMS STUN-Based SIP Proxy.
Communications of the ACM (CACM), Vol. 32, No. 6, June 1989
STUN Date: Speaker: Hui-Hsiung Chung 1.
SIP Testing Methodology Elie Cohen ProLab PM 17/01/2003.
History DHCP was first defined as a standards track protocol in RFC 1531 in October 1993, as an extension to the Bootstrap Protocol (BOOTP). The motivation.
Session Initiation Protocol (SIP) By: Zhixin Chen.
Cmpe 491 Special Project In Computer Engineering SIP User Agent In JAVA Alp Eren YILMAZ & Serdar YALÇINKAYA.
8/2/ IETF, Pittsburgh Kutscher/Ott/Bormann SDPng Requirements draft-kutscher-mmusic-sdpng-req-00.txt Dirk Jörg
12/05/2000CS590F, Purdue University1 Sip Implementation Protocol Presented By: Sanjay Agrawal Sambhrama Mundkur.
CSc 461/561 CSc 461/561 Multimedia Systems Part C: 2. SIP.
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
SIP, Session Initiation Protocol Internet Draft, IETF, RFC 2543.
Internet Telephony System implementation (SIP User Agent, MGCP Library and RTP Replicator) AT&T Research Lab Xiaotao Wu.
SIP 逄愛君 SIP&SDP2 Industrial Technology Research Institute Computer & Communication Research Laboratories Elgin Pang Outline.
1 Extending SIP Speaker: Hsuan-Ming Chen Adviser: Ho-Ting Wu Date: 2005/04/26.
Session Initialization Protocol (SIP)
1 RFC 3486 Compressing the Session Initiation Protocol (SIP) 曾朝弘 電機系 系統組 碩士班一年級.
July 30, 2010SIPREC WG1 SIP Call Control - Recording Extensions draft-johnston-siprec-cc-rec-00 Alan Johnston Andrew Hutton.
CVSQL 2 The Design. System Overview System Components CVSQL Server –Three network interfaces –Modular data source provider framework –Decoupled SQL parsing.
2011 Embedded Systems Software Training Center BluRapport SDK.
Assignment 3 A Client/Server Application: Chatroom.
Session Initiation Protocol Team Members: Manjiri Ayyar Pallavi Murudkar Sriusha Kottalanka Vamsi Ambati Girish Satya LeeAnn Tam.
Client-Side Network Programming
NAT Traversal Speaker: Chin-Chang Chang Date:
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs) speaker : Wenping Zhang date :
All rights reserved © 1999, Alcatel, Paris. page n° 1 SIP for Xcast SIP for the establishment of xcast-based multiparty.
Call Control with SIP Brian Elliott, Director of Engineering, NMS.
Implementing an extension for freeDiameter
FTP Client Application CSC 8560 Brian Jorgage 4/27/2004.
Session Initiation Protocol (SIP). What is SIP? An application-layer protocol A control (signaling) protocol.
Research Speaker: Chia-Wen Lu Date:1/18/ Outline SIP Application eXosip Future Work 2.
Presented By Team Netgeeks SIP Session Initiation Protocol.
© 2004 OPNET Technologies, Inc. All rights reserved. OPNET and OPNET product names are trademarks of OPNET Technologies, Inc. ARMing Apache David Carter.
SIP:Session Initiation Protocol Che-Yu Kuo Computer & Information Science Department University of Delaware May 11, 2010 CISC 856: TCP/IP and Upper Layer.
Lab Assignment 15/ INF5060: Multimedia data communication using network processors.
Omar A. Abouabdalla Network Research Group (USM) SIP – Functionality and Structure of the Protocol SIP – Functionality and Structure of the Protocol By.
Networking Tutorial Special Interest Group for Software Engineering Luke Rajlich.
VoIP Signaling Protocols A signaling protocol is a common language spoken by telephones and call-management servers, the PSTN, and legacy PBX systems as.
SIP working group IETF#70 Essential corrections Keith Drage.
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
Testing SIP Using XML Protocol Templates M. Ranganathan Olivier Deruelle Doug Montgomery Advanced Networking Technologies Division, National Institute.
Socket Programming.
SIP-H.323 Interworking Group RRR-1 IETF-48 SIP-H.323 Interworking Requirements draft-agrawal-sip-h323-interworking-reqs-00.txt Hemant.
What is SMART? SMART is a POWERFUL output log parser and analyzer capable of parsing and analyzing single or multiple SIP, H323 and Q931 log files from.
FTP Client API FTP in embedded devices Implementing an FTP Client FTP Command APIs Other FTP Client APIs.
DMLite GridFTP frontend Andrey Kiryanov IT/SDC 13/12/2013.
Netprog: Client/Server Issues1 Issues in Client/Server Programming Refs: Chapter 27.
CCL MGCP Protocol Stack Shang-Chih Tsai
S Postgraduate Course in Radio Communications. Application Layer Mobility in WLAN Antti Keurulainen,
LonWorks Introduction Hwayoung Chae.
1 Issues in Client/Server Refs: Chapter 27 Case Studies RFCs.
Session-Independent Policies draft-ietf-sipping-session-indep-policy-02 Volker Hilt Jonathan Rosenberg Gonzalo.
SIP over MANETs Introduction to SIP SIP vs MANETs Open Issues
Pointers & Arrays 1-d arrays & pointers 2-d arrays & pointers.
Speaker :Ying-shun Lin Date:2007/03/26
Session Initiation Protocol
Session Initiation Protocol (SIP)
Introduction to ZBOSS Embedded Systems Software Training Center
Session Initiation Protocol (SIP)
Alfredo Terzoli / Mosioua Tsietsi
Issues in Client/Server Programming
Server-side Programming CSE 333 Summer 2018
SIP Basics Workshop Dennis Baron July 20, 2005.
Presentation transcript:

李思銳 voip_taiwan@yahoo.com.tw libosip2 / libexosip 李思銳 voip_taiwan@yahoo.com.tw

大綱 編譯libosip2 Description Features src directory

編譯libosip2 # tar xvfz libosip2-2.2.1.tar.gz # cd libosip2-2.2.1 # ./configure # make # make install

Description The GNU oSIP library is an implementation of SIP - rfc3261 http://www.gnu.org/software/osip/osip.html

Features SIP parser 1. SIP header parser 2. SDP parser SIP transaction state machines 1. ICT : Invite Client Transaction 2. NICT: Non Invite Client Transaction 3. IST : Invite Server Transaction 4. NIST: Non Invite Server Transaction

src directory src/osip2 SIP transaction state machines src/osipparser2 SIP parser src/test test programs

大綱 - How-To initialize libosip2 Allocate an osip_t element Register the callback used to send SIP message Set a callback for transaction operation related to the end of transactions

Set a callback for each transaction operation related to network error

Allocate an osip_t element #include <sys/time.h> #include <osip2/osip.h> int i; osip_t *osip; i=osip_init(&osip); if (i!=0) return -1;

Register the callback used to send SIP message osip_set_cb_send_message(osip, &cb_udp_snd_message);

Set a callback for transaction operation related to the end of transactions osip_set_kill_transaction_callback(osip, OSIP_ICT_KILL_TRANSACTION, &cb_ict_kill_transaction); osip_set_kill_transaction_callback(osip, OSIP_IST_KILL_TRANSACTION, &cb_ist_kill_transaction);

osip_set_kill_transaction_callback(osip, OSIP_NICT_KILL_TRANSACTION, &cb_nict_kill_transaction); osip_set_kill_transaction_callback(osip, OSIP_NIST_KILL_TRANSACTION, &cb_nist_kill_transaction);

Set a callback for each transaction operation related to network error osip_set_transport_error_callback(osip, OSIP_ICT_TRANSPORT_ERROR, &cb_transport_error); osip_set_transport_error_callback(osip, OSIP_IST_TRANSPORT_ERROR, &cb_transport_error);

osip_set_transport_error_callback(osip, OSIP_NICT_TRANSPORT_ERROR, &cb_transport_error); osip_set_transport_error_callback(osip, OSIP_NIST_TRANSPORT_ERROR, &cb_transport_error);

Set a callback for each transaction operation osip_set_message_callback(osip, OSIP_ICT_STATUS_1XX_RECEIVED, &cb_rcv1xx); osip_set_message_callback(osip, OSIP_ICT_STATUS_2XX_RECEIVED, &cb_rcv2xx);

osip_set_message_callback(osip, OSIP_ICT_STATUS_3XX_RECEIVED, &cb_rcv3456xx);

osip_set_message_callback(osip, OSIP_ICT_STATUS_5XX_RECEIVED, &cb_rcv3456xx);

osip_set_message_callback(osip, OSIP_NICT_STATUS_1XX_RECEIVED, &cb_rcv1xx);

osip_set_message_callback(osip, OSIP_NICT_STATUS_3XX_RECEIVED, &cb_rcv3456xx);

osip_set_message_callback(osip, OSIP_NICT_STATUS_5XX_RECEIVED, &cb_rcv3456xx);

osip_set_message_callback(osip, OSIP_IST_INVITE_RECEIVED, &cb_rcvreq); osip_set_message_callback(osip, OSIP_IST_ACK_RECEIVED, &cb_rcvreq);

osip_set_message_callback(osip, OSIP_NIST_REGISTER_RECEIVED, &cb_rcvreq); osip_set_message_callback(osip, OSIP_NIST_BYE_RECEIVED, &cb_rcvreq);

osip_set_message_callback(osip, OSIP_NIST_CANCEL_RECEIVED, &cb_rcvreq); osip_set_message_callback(osip, OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, &cb_rcvreq);

大綱 - How-To parse URI Allocate/Free/Parse a header element Get a string representation of a header element Parse Via header, for example

Allocate/Free/Parse a header element osip_xxx_init(osip_xxx_t **header); osip_xxx_free(osip_xxx_t *header); osip_xxx_parse(osip_xxx_t *header, char *buffer);

Get a string representation of a header element osip_xxx_to_str(osip_xxx_t *header, char **dest);

Parse Via header, for example osip_via_t *via; char *a_via; char *dest; osip_via_init(&via); osip_via_parse(via, a_via); osip_via_to_str(via, &dest); osip_via_free(via);

大綱 - How-To parse SIP message Parse a given buffer containing a sip request or response Convert the message into a printable string

Parse a given buffer containing a sip request or response osip_message_t *sip; osip_message_init(&sip); osip_message_parse(sip, msg, strlen(msg); osip_message_free(sip);

Convert the message into a printable string char *dest; size_t length; osip_message_to_str(sip, &result, &length); osip_free(dest);

大綱 - How-To use the sdp negotiator How-to initialize the SDP negotiator How-to add support for medias

How-to initialize the SDP negotiator struct osip_rfc3264 *cnf; osip_rfc3264_init(&cnf);

How-to add support for medias sdp_media_t *med; sdp_attribute_t *attr; sdp_media_init(&med); med->m_proto = strdup("RTP/AVP"); osip_list_add(med->m_payloads, tmp, -1);

sdp_attribute_init(&attr); attr->a_att_field = strdup("rtpmap"); attr->a_att_value = strdup("0 PCMU/8000"); osip_list_add(med->a_attributes, attr, -1); osip_rfc3264_add_audio_media(cnf, med, -1);

大綱 編譯libexosip Configure option Description Features

編譯libexosip # tar xvfz libeXosip-0.9.0.tar.gz # cd libeXosip-0.9.0 # ./configure # make # make install

Configure option --disable-phapi --disable-miniua --disable-josua --disable-glib

--disable-ms --disable-ortp --disable-gsm --disable-ilbc

Description eXosip is a GPL library that extend the capability of the oSIP library It aims to implement a simple high layer API to control the SIP for sessions establishements and common extensions http://savannah.gnu.org/projects/exosip/

Features rfc3261: SIP rfcxxxx: MESSAGE request rfcxxxx: SIMPLE support

大綱 - How-To initialize libexosip Initiate the eXtented oSIP library Force eXosip to use a specific local ip address in all its SIP message Set the SIP User-Agent: header string Release ressource used by the eXtented oSIP library

Initiate the eXtented oSIP library int eXosip_init(FILE *input, FILE *output, int port); eXosip_init(NULL, NULL, 5060);

Force eXosip to use a specific local ip address in all its SIP message int eXosip_force_localip(const char *localip); eXosip_force_localip(“127.0.0.1”);

Set the SIP User-Agent: header string void eXosip_set_user_agent(const char *user_agent); eXosip_set_user_agent(“mysip”);

Release ressource used by the eXtented oSIP library void eXosip_quit(void);

大綱 – How to Process Event Wait for an eXosip event Free ressource in an eXosip event eXosip event Management

Wait for an eXosip event eXosip_event_t *eXosip_event_wait(int tv_s, int tv_ms); eXosip_event_t *event; event = eXosip_event_wait(0, 0);

Free ressource in an eXosip event void eXosip_event_free(eXosip_event_t *je); eXosip_event_free(event);

eXosip event Management switch(event->type) Registration Info UAC events UAS events both UAS & UAC events

Registration Info EXOSIP_REGISTRATION_NEW EXOSIP_REGISTRATION_SUCCESS EXOSIP_REGISTRATION_FAILURE EXOSIP_REGISTRATION_REFRESHED EXOSIP_REGISTRATION_TERMINATED

UAC events EXOSIP_CALL_NOANSWER EXOSIP_CALL_PROCEEDING EXOSIP_CALL_RINGING EXOSIP_CALL_ANSWERED EXOSIP_CALL_REDIRECTED EXOSIP_CALL_REQUESTFAILURE EXOSIP_CALL_SERVERFAILURE EXOSIP_CALL_GLOBALFAILURE

UAS events EXOSIP_CALL_NEW EXOSIP_CALL_ACK EXOSIP_CALL_CANCELLED EXOSIP_CALL_TIMEOUT EXOSIP_CALL_HOLD EXOSIP_CALL_OFFHOLD EXOSIP_CALL_CLOSED

both UAS & UAC events EXOSIP_CALL_STARTAUDIO EXOSIP_CALL_RELEASED

大綱 – Sample Programs sip_reg testing Modify sip_call Compile sip_call sip_call testing

sip_reg testing # sip_reg \ -r sip:aaa.bbb.ccc.ddd \ -u sip:1000@aaa.bbb.ccc.ddd \ -c sip:1000@aaa.bbb.ccc.ddd \ -p 5060 -U 1000 -P 1000 –d

Modify sip_call modify include header change getch() to be getchar()

Include header #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netdb.h> #include <syslog.h> #include <pthread.h>

_getch()  getchar() //if ( _kbhit() ) //switch ( _getch() ) switch ( getchar() )

Compile sip_call # g++ \ -losip2 -losipparser2 -leXosip \ -o sip_call sip_call.cxx Link error?

sip_call testing eXosip_build_initial_invite( osip_message_t **invite, char *to, char *from, char *route, char *subject);

a - answering call h - hangup r - ringing c - call q - quit

作業 整合sip_reg和sip_call兩個demo程式 修正sip_call程式的bug, 例如無法掛斷的問題等