Commit 9329c4ed authored by jpbl's avatar jpbl

reintegrated exosip2

parent 1a4be2a3
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
......
SUBDIRS = utilspp stund src ringtones
SUBDIRS = exosip2 utilspp stund src ringtones m4
EXTRA_DIST = tools/*.sh
ACLOCAL_FLAGS=-I$(top_srcdir)/m4
This diff is collapsed.
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if dns-sd is available */
#undef HAVE_DNSSD
/* Define to 1 if you have the <eXosip2/eXosip.h> header file. */
#undef HAVE_EXOSIP2_EXOSIP_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `osipparser2' library (-losipparser2). */
#undef HAVE_LIBOSIPPARSER2
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
......@@ -21,9 +33,24 @@
/* Define to 1 if you have the <portaudio.h> header file. */
#undef HAVE_PORTAUDIO_H
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
/* Define to 1 if you have the <semaphore.h> header file. */
#undef HAVE_SEMAPHORE_H
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
......@@ -33,15 +60,30 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/sem.h> header file. */
#undef HAVE_SYS_SEM_H
/* Define to 1 if you have the <sys/signal.h> header file. */
#undef HAVE_SYS_SIGNAL_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <varargs.h> header file. */
#undef HAVE_VARARGS_H
/* Name of package */
#undef PACKAGE
......@@ -60,6 +102,10 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to the necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
......
This diff is collapsed.
AC_INIT(acinclude.m4)
AC_INIT(aclocal.m4)
AM_CONFIG_HEADER(config.h)
......@@ -31,9 +31,8 @@ dnl KDE_USE_QT(3.3)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE(sflphoned, $VERSION)
AM_DISABLE_LIBRARIES
AC_PROG_LIBTOOL
AC_CHECK_COMPILERS
dnl AC_CHECK_COMPILERS
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
......@@ -54,7 +53,6 @@ dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
ostream \
eXosip2/eXosip.h \
portaudio.h \
)
......@@ -73,22 +71,17 @@ PKG_CHECK_MODULES(libccrtp1, libccrtp1 >= ${LIBCCRT_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccrtp1_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccrtp1_LIBS"
dnl 2.2.0 is buggy, header corruption
LIBOSIP2_MIN_VERSION=2.2.1
PKG_CHECK_MODULES(libosip2, libosip2 >= ${LIBOSIP2_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libosip2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libosip2_LIBS"
dnl check for osip2
LP_CHECK_OSIP2
if test $ac_cv_header_eXosip2_eXosip_h = no; then
AC_MSG_ERROR([*** missing eXosip2/eXosip.h. You need a working eXosip2 installation. See http://www.antisip.com/download/])
fi
AC_CHECK_LIB([eXosip2], [eXosip_init],[libexosip2_LIBS="-leXosip2 "],[
AC_MSG_ERROR([*** missing eXosip2 library. You need a working eXosip2 installation. See http://www.antisip.com/download/])])
dnl setup flags for embedded exosip library
LP_SETUP_EXOSIP
SFLPHONE_LIBS="$SFLPHONE_LIBS $libexosip2_LIBS"
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $OSIP_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $OSIP_LIBS"
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $EXOSIP_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $EXOSIP_LIBS"
dnl AC_SUBST(LIBQT)
if test $ac_cv_header_portaudio_h = no; then
AC_MSG_ERROR([*** missing portaudio.h. You need a working PortAudio installation. See http://www.portaudio.com])
......@@ -142,13 +135,13 @@ fi
AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes")
AC_CONFIG_SUBDIRS(src/gui/qt)
dnl AC_CONFIG_FILES(
AC_OUTPUT(
sflphone.spec \
sflphoned-fedora.spec \
Makefile \
m4/Makefile \
exosip2/Makefile \
src/Makefile \
src/sflphone \
src/audio/Makefile \
......
......@@ -10,5 +10,5 @@ if COMPILE_PORTAUDIO
PORTAUDIO = portaudio
endif
SUBDIRS = $(OSIP) $(EXOSIP) $(PORTAUDIO)
SUBDIRS = $(PORTAUDIO)
lib_LTLIBRARIES = libeXosip2.la
#
# Other flags to add someday:
# -Wcast-qual
# -Wwrite-strings
# -Wstrict-prototypes
# -Werror
#
AM_CFLAGS = @EXOSIP_CFLAGS@ @CFLAGS@
libeXosip2_la_SOURCES = \
eXosip.c eXconf.c \
eXregister_api.c eXsubscription_api.c \
eXcall_api.c eXoptions_api.c \
eXrefer_api.c eXmessage_api.c \
eXinsubscription_api.c eXpublish_api.c \
eXtransport.c \
inet_ntop.c inet_ntop.h \
jrequest.c jresponse.c \
jcallback.c jdialog.c udp.c \
jcall.c jreg.c eXutils.c \
jnotify.c jsubscribe.c jevents.c \
misc.c eXosip2.h \
jpipe.c jpipe.h jauth.c \
sdp_offans.c jpublish.c
libeXosip2_la_LDFLAGS = -L$(prefix)/lib -version-info $(LIBEXOSIP_SO_VERSION)
libeXosip2_la_LIBADD = -losip2 @EXOSIP_LIBS@
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/include -I$(includedir)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
eXosip - This is the eXtended osip library.
Copyright (C) 2002,2003,2004,2005 Aymeric MOIZARD - jack@atosc.org
eXosip is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
eXosip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef ENABLE_MPATROL
#include <mpatrol.h>
#endif
#include "eXosip2.h"
extern eXosip_t eXosip;
int
eXosip_message_build_request (osip_message_t ** message, const char *method,
const char *to, const char *from, const char *route)
{
int i;
*message = NULL;
if (method != NULL && *method == '\0')
return -1;
if (to != NULL && *to == '\0')
return -1;
if (from != NULL && *from == '\0')
return -1;
if (route != NULL && *route == '\0')
route = NULL;
i = generating_request_out_of_dialog (message, method, to, "UDP", from, route);
if (i != 0)
return -1;
return 0;
}
int
eXosip_message_send_request (osip_message_t * message)
{
osip_transaction_t *transaction;
osip_event_t *sipevent;
int i;
i = osip_transaction_init (&transaction, NICT, eXosip.j_osip, message);
if (i != 0)
{
osip_message_free (message);
return -1;
}
osip_list_add (eXosip.j_transactions, transaction, 0);
sipevent = osip_new_outgoing_sipmessage (message);
sipevent->transactionid = transaction->transactionid;
osip_transaction_set_your_instance (transaction,
__eXosip_new_jinfo (NULL, NULL, NULL, NULL));
osip_transaction_add_event (transaction, sipevent);
__eXosip_wakeup ();
return 0;
}
int
eXosip_message_build_answer (int tid, int status, osip_message_t ** answer)
{
osip_transaction_t *tr = NULL;
int i = -1;
if (tid > 0)
{
eXosip_transaction_find (tid, &tr);
}
if (tr == NULL)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: No call here?\n"));
return -1;
}
if (status > 100 && status < 200)
{
#if 0
/* TODO: not implemented */
i = _eXosip_build_response_default (response, NULL, code, tr->orig_request);
#endif
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: status code 1xx for message not implemented (use 200<status<699)\n"));
return -1;
} else if (status > 199 && status < 300)
{
i = _eXosip_build_response_default (answer, NULL, status, tr->orig_request);
} else if (status > 300 && status < 699)
{
i = _eXosip_build_response_default (answer, NULL, status, tr->orig_request);
} else
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: wrong status code (200<status<699)\n"));
return -1;
}
if (i != 0)
return -1;
return 0;
}
int
eXosip_message_send_answer (int tid, int status, osip_message_t * answer)
{
osip_transaction_t *tr = NULL;
osip_event_t *evt_answer;
int i = -1;
if (tid > 0)
{
eXosip_transaction_find (tid, &tr);
}
if (tr == NULL)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: No MESSAGE transaction found\n"));
osip_message_free (answer);
return -1;
}
/* is the transaction already answered? */
if (tr->state == NIST_COMPLETED || tr->state == NIST_TERMINATED)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: transaction already answered\n"));
osip_message_free (answer);
return -1;
}
if (answer == NULL)
{
if (status > 100 && status < 200)
{
#if 0
/* TODO: not implemented */
i =
_eXosip_build_response_default (response, NULL, code,
tr->orig_request);
#endif
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: status code 1xx for message not implemented (use 200<status<699)\n"));
return -1;
} else if (status > 199 && status < 300)
{
i =
_eXosip_build_response_default (&answer, NULL, status,
tr->orig_request);
} else if (status > 300 && status < 699)
{
i =
_eXosip_build_response_default (&answer, NULL, status,
tr->orig_request);
} else
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: wrong status code (200<status<699)\n"));
return -1;
}
if (i != 0)
return -1;
}
evt_answer = osip_new_outgoing_sipmessage (answer);
evt_answer->transactionid = tr->transactionid;
osip_transaction_add_event (tr, evt_answer);
__eXosip_wakeup ();
return 0;
}
/*
eXosip - This is the eXtended osip library.
Copyright (C) 2002,2003,2004,2005 Aymeric MOIZARD - jack@atosc.org
eXosip is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
eXosip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef ENABLE_MPATROL
#include <mpatrol.h>
#endif
#include "eXosip2.h"
extern eXosip_t eXosip;
int
eXosip_options_build_request (osip_message_t ** options, const char *to,
const char *from, const char *route)
{
int i;
*options = NULL;
if (to != NULL && *to == '\0')
return -1;
if (from != NULL && *from == '\0')
return -1;
if (route != NULL && *route == '\0')
route = NULL;
i = generating_request_out_of_dialog (options, "OPTIONS", to, "UDP", from,
route);
if (i != 0)
return -1;
/* after this delay, we should send a CANCEL */
osip_message_set_expires (*options, "120");
/* osip_message_set_organization(*invite, "Jack's Org"); */
return 0;
}
int
eXosip_options_send_request (osip_message_t * options)
{
osip_transaction_t *transaction;
osip_event_t *sipevent;
int i;
i = osip_transaction_init (&transaction, NICT, eXosip.j_osip, options);
if (i != 0)
{
osip_message_free (options);
return -1;
}
osip_list_add (eXosip.j_transactions, transaction, 0);
sipevent = osip_new_outgoing_sipmessage (options);
sipevent->transactionid = transaction->transactionid;
osip_transaction_set_your_instance (transaction,
__eXosip_new_jinfo (NULL, NULL, NULL, NULL));
osip_transaction_add_event (transaction, sipevent);
__eXosip_wakeup ();
return 0;
}
int
eXosip_options_build_answer (int tid, int status, osip_message_t ** answer)
{
osip_transaction_t *tr = NULL;
int i = -1;
*answer = NULL;
if (tid > 0)
{
eXosip_transaction_find (tid, &tr);
}
if (tr == NULL)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: No call here?\n"));
return -1;
}
if (status > 100 && status < 200)
{
#if 0
/* TODO: not implemented */
i = _eXosip_build_response_default (response, NULL, code, tr->orig_request);
#endif
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: status code 1xx for options not implemented (use 200<status<699)\n"));
return -1;
} else if (status > 199 && status < 300)
{
i = _eXosip_build_response_default (answer, NULL, status, tr->orig_request);
} else if (status > 300 && status < 699)
{
i = _eXosip_build_response_default (answer, NULL, status, tr->orig_request);
} else
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: wrong status code (200<status<699)\n"));
return -1;
}
if (i != 0)
return -1;
return 0;
}
int
eXosip_options_send_answer (int tid, int status, osip_message_t * answer)
{
osip_transaction_t *tr = NULL;
osip_event_t *evt_answer;
int i = -1;
if (tid > 0)
{
eXosip_transaction_find (tid, &tr);
}
if (tr == NULL)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: No OPTIONS transaction found\n"));
osip_message_free (answer);
return -1;
}
/* is the transaction already answered? */
if (tr->state == NIST_COMPLETED || tr->state == NIST_TERMINATED)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: transaction already answered\n"));
osip_message_free (answer);
return -1;
}
if (answer == NULL)
{
if (status > 100 && status < 200)
{
#if 0
/* TODO: not implemented */
i =
_eXosip_build_response_default (response, NULL, code,
tr->orig_request);
#endif
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: status code 1xx for options not implemented (use 200<status<699)\n"));
return -1;
} else if (status > 199 && status < 300)
{
i =
_eXosip_build_response_default (&answer, NULL, status,
tr->orig_request);
} else if (status > 300 && status < 699)
{
i =
_eXosip_build_response_default (&answer, NULL, status,
tr->orig_request);
} else
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: wrong status code (200<status<699)\n"));
return -1;
}
if (i != 0)
return -1;
}
evt_answer = osip_new_outgoing_sipmessage (answer);
evt_answer->transactionid = tr->transactionid;
osip_transaction_add_event (tr, evt_answer);
__eXosip_wakeup ();
return 0;
}
This diff is collapsed.
This diff is collapsed.
/*
eXosip - This is the eXtended osip library.
Copyright (C) 2002,2003,2004,2005 Aymeric MOIZARD - jack@atosc.org
eXosip is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
eXosip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef ENABLE_MPATROL
#include <mpatrol.h>
#endif
#include "eXosip2.h"
#include <eXosip2/eXosip.h>
extern eXosip_t eXosip;
int
eXosip_build_publish (osip_message_t ** message,
const char *to,
const char *from,
const char *route,
const char *event,
const char *expires, const char *ctype, const char *body)
{
int i;
*message = NULL;
if (to == NULL || to[0] == '\0')
return -1;
if (from == NULL || from[0] == '\0')
return -1;
if (event == NULL || event[0] == '\0')
return -1;
if (ctype == NULL || ctype[0] == '\0')
{
if (body != NULL && body[0] != '\0')
return -1;
} else
{
if (body == NULL || body[0] == '\0')
return -1;
}
i = generating_publish (message, to, from, route);
if (i != 0)
{
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: cannot send message (cannot build PUBLISH)! "));
return -1;
}
if (body != NULL && body[0] != '\0' && ctype != NULL && ctype[0] != '\0')
{
osip_message_set_content_type (*message, ctype);
osip_message_set_body (*message, body, strlen (body));
osip_message_set_header (*message, "Content-Disposition",
"render;handling=required");
}
if (expires != NULL && expires[0] != '\0')
osip_message_set_expires (*message, expires);
else
osip_message_set_expires (*message, "3600");
osip_message_set_header (*message, "Event", event);
return 0;
}
int
eXosip_publish (osip_message_t * message, const char *to)
{
osip_transaction_t *transaction;
osip_event_t *sipevent;
int i;
eXosip_pub_t *pub = NULL;
if (message == NULL)
return -1;
if (message->cseq == NULL || message->cseq->number == NULL)
{
osip_message_free (message);
return -1;
}
if (to == NULL)
{
osip_message_free (message);
return -1;
}
i = _eXosip_pub_find_by_aor (&pub, to);