Commit 34ce1750 authored by Kai Vehmanen's avatar Kai Vehmanen

The nua-glib module has been removed from the libsofia-sip-ua-glib library,...

The nua-glib module has been removed from the libsofia-sip-ua-glib library, and will be made available as a separate package.

darcs-hash:20061205171044-7659e-daeaf8778616b593bc9b3db24b422e404c59ffd1.gz
parent 589255ac
......@@ -30,9 +30,12 @@ libsofia-sip-ua:
unit test (test_nua) built against original 1.12.0 release.
libsofia-sip-ua-glib:
- No ABI/API changes, compatible with 1.12.0. Note, libsofia-sip-ua-glib
interface is not considered stable and may change in a future 1.12.x
release.
- The 'nua-glib' module has been removed from the library and moved
to a separate package 'sofia-nua-glib'. The remaining library (su-glib)
is now considered stable and will be API/ABI compatible with later
releases in the 1.12.x series.
- ABI has been modified and applications built against 1.12.4 and earlier
releases need to be rebuilt.
Contributors to this release
----------------------------
......
......@@ -20,10 +20,10 @@ AC_SUBST(LIBVER_SOFIA_SIP_UA_CUR, [3])
AC_SUBST(LIBVER_SOFIA_SIP_UA_REV, [0])
AC_SUBST(LIBVER_SOFIA_SIP_UA_AGE, [3])
AC_SUBST(LIBVER_SOFIA_SIP_UA_SOVER, [0]) # CUR-AGE
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_CUR, [2])
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_CUR, [3])
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_REV, [0])
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_AGE, [2])
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_SOVER, [0]) # CUR-AGE
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_AGE, [0])
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_SOVER, [1]) # CUR-AGE
# dnl calls AC_CANONICAL_ macros that are required by AM_INIT_AUTOMAKE
SAC_CANONICAL_SYSTEM_CACHE_CHECK
......@@ -191,7 +191,6 @@ libsofia-sip-ua/tport/Makefile
libsofia-sip-ua/url/Makefile
libsofia-sip-ua/features/sofia-sip/sofia_features.h
libsofia-sip-ua-glib/Makefile
libsofia-sip-ua-glib/nua-glib/Makefile
libsofia-sip-ua-glib/su-glib/Makefile
utils/Makefile
utils/Doxyfile.build
......
......@@ -8,22 +8,17 @@
AUTOMAKE_OPTIONS = foreign 1.7
SUBDIRS=su-glib nua-glib
SUBDIRS=su-glib
GLIB_TARGETS=su-glib/libsu-glib.la
if HAVE_GOBJECT
GOBJECT_TARGETS=nua-glib/libnua-glib.la
endif
lib_LTLIBRARIES =
if HAVE_GLIB
lib_LTLIBRARIES += libsofia-sip-ua-glib.la
endif
libsofia_sip_ua_glib_la_SOURCES =
libsofia_sip_ua_glib_la_LIBADD = $(GLIB_TARGETS) $(GOBJECT_TARGETS) \
$(GOBJECT_LIBS) $(GLIB_LIBS)
libsofia_sip_ua_glib_la_LIBADD = $(GLIB_TARGETS) $(GLIB_LIBS)
# set the libtool version info version:revision:age for libsofia-sip-ua-glib
# - soname to 'libsofia-sip-ua-glib.so.(CUR-AGE)'
......
PROJECT_NAME = "sofia-sip/nua-glib"
OUTPUT_DIRECTORY = ../docs/html/nua-glib
INPUT = nua_glib.docs . sofia-sip
@INCLUDE = ../docs/Doxyfile.conf
GENERATE_TAGFILE = ../docs/nua_glib.doxytags
ALIASES +=
#
# Makefile.am for nua-glib module
#
# Copyright (C) 2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
#
AUTOMAKE_OPTIONS = foreign 1.7
GLIB_BUILT = nua_glib_marshal.c \
nua_glib_marshal.h
# ----------------------------------------------------------------------
# Header paths
S_BASE = $(top_srcdir)/libsofia-sip-ua
B_BASE = $(top_builddir)/libsofia-sip-ua
INCLUDES = -I$(S_BASE)/bnf -I$(B_BASE)/bnf \
-I$(S_BASE)/ipt -I$(B_BASE)/ipt \
-I$(S_BASE)/iptsec -I$(B_BASE)/iptsec \
-I$(S_BASE)/http -I$(B_BASE)/http \
-I$(S_BASE)/msg -I$(B_BASE)/msg \
-I$(S_BASE)/nea -I$(B_BASE)/nea \
-I$(S_BASE)/nta -I$(B_BASE)/nta \
-I$(S_BASE)/nth -I$(B_BASE)/nth \
-I$(S_BASE)/nua -I$(B_BASE)/nua \
-I$(S_BASE)/sdp -I$(B_BASE)/sdp \
-I$(S_BASE)/sip -I$(B_BASE)/sip \
-I$(S_BASE)/stun -I$(B_BASE)/stun \
-I$(S_BASE)/soa -I$(B_BASE)/soa \
-I$(S_BASE)/tport -I$(B_BASE)/tport \
-I$(S_BASE)/url -I$(B_BASE)/url \
-I$(S_BASE)/su -I$(B_BASE)/su \
-I$(srcdir)/../su-glib/ \
$(GLIB_CFLAGS)
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES =
if HAVE_GOBJECT
noinst_LTLIBRARIES += libnua-glib.la
endif
# ----------------------------------------------------------------------
# Rules for building the targets
BUILT_SOURCES = $(GLIB_BUILT)
nobase_include_sofia_HEADERS =
if HAVE_GOBJECT
nobase_include_sofia_HEADERS += \
sofia-sip/nua_glib.h
endif
noinst_HEADERS = nua_glib_priv.h \
nua_glib_op.h
check_PROGRAMS = test_nua_glib
libnua_glib_la_SOURCES = \
nua_glib.c \
nua_glib_op.c
libnua_glib_la_LIBADD = nua_glib_marshal.lo
LDADD = $(GLIB_LIBS) -lgobject-2.0 \
libnua-glib.la ../su-glib/libsu-glib.la \
../../libsofia-sip-ua/libsofia-sip-ua.la
test_nua_glib_LDFLAGS = -static
%_marshal.h: ${srcdir}/%_marshal.list ${srcdir}/Makefile.am
glib-genmarshal --header --prefix=$(subst -,_,$*)_marshal $< > $*_marshal.h
%_marshal.c: ${srcdir}/%_marshal.list ${srcdir}/Makefile.am
glib-genmarshal --body --prefix=$(subst -,_,$*)_marshal $< > $*_marshal.c
# Correctly clean the generated headers, but keep the xml description
CLEANFILES = $(BUILT_SOURCES)
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile nua_glib.docs nua_glib_marshal.list
# ----------------------------------------------------------------------
# Sofia specific rules
include ../../libsofia-sip-ua/sofia.am
This diff is collapsed.
/**@mainpage Sofia-SIP nua-glib Module
@section nua_glib_meta Module Meta Information
The 'nua-glib' module is a highlevel interface for building
SIP user-agent software. It is similar to the Sofia-SIP NUA
(see nua.h), but nua-glib is based on the glib object system.
@CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
@STATUS Core library
@LICENSE LGPL
@section nua_glib_contents Contents of nua-glib Module
The nua-glib module contains the public header files as follows:
- <nua_glib.h> the public API of the module
@section nua_glib_examples Examples of use
TBD
@section todo Todo
- see sourceforge.net issue tracker for sofia-sip
(-> http://sofia-sip.sourceforge.net/development.html )
*/
VOID:POINTER,INT,STRING
VOID:POINTER,INT,STRING
VOID:POINTER,INT,STRING,STRING,STRING,STRING
VOID:POINTER,INT,INT,INT,INT,STRING,STRING
VOID:POINTER,INT
VOID:POINTER,POINTER
VOID:POINTER,STRING,STRING,STRING,POINTER
VOID:POINTER,STRING,STRING,STRING,STRING
VOID:POINTER,STRING,STRING,STRING
VOID:POINTER,STRING,STRING
VOID:INT,STRING
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005-2006 Nokia Corporation.
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* Copyright (C) 2005 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@file nua_glib.c Interface towards libsofia-sip-ua.
*
* @author Kai Vehmanen <kai.vehmanen@nokia.com>
* @author Rob Taylor <rob.taylor@collabora.co.uk>
* @author Pekka Pessi <pekka.pessi@nokia.com>
*/
#include <sofia-sip/nua_glib.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include "nua_glib_priv.h"
#include "nua_glib_op.h"
static void priv_oper_assign(NuaGlibOp *op, sip_method_t method);
/**
* Creates a new operation object and stores it the list of
* active operations for 'self'.
*/
NuaGlibOp *nua_glib_op_create(NuaGlib *self,
sip_method_t method,
const char *address,
tag_type_t tag, tag_value_t value, ...)
{
NuaGlibOp *op, *old;
const char* method_name = sip_method_name(method, "<NONE>");
ta_list ta;
enter;
for (old = self->priv->operations; old; old = old->op_next)
if (!old->op_persistent)
break;
if (address) {
int have_url = 1;
sip_to_t *to;
to = sip_to_make(self->priv->home, address);
if (to == NULL) {
/*TODO, error returns*/
g_warning("%s: %s: invalid address: %s\n", self->priv->name, method_name, address);
return NULL;
}
/* Try to make sense out of the URL */
if (url_sanitize(to->a_url) < 0) {
/*TODO, error returns*/
g_warning("%s: %s: invalid address\n", self->priv->name, method_name);
return NULL;
}
if (!(op = su_zalloc(self->priv->home, sizeof(*op)))) {
/*TODO, error returns*/
g_warning("%s: %s: cannot create handle\n", self->priv->name, method_name);
return NULL;
}
op->op_parent = self;
op->op_next = self->priv->operations;
op->op_prev_state = -1;
self->priv->operations = op;
if (method == sip_method_register)
have_url = 0;
ta_start(ta, tag, value);
op->op_handle = nua_handle(self->priv->nua, op,
TAG_IF(have_url, NUTAG_URL(to->a_url)),
SIPTAG_TO(to),
ta_tags(ta));
ta_end(ta);
op->op_ident = sip_header_as_string(self->priv->home, (sip_header_t *)to);
priv_oper_assign(op, method);
if (!op->op_persistent) {
NuaGlibOp *old_next;
for (; old; old = old_next) { /* Clean old handles */
old_next = old->op_next;
if (!old->op_persistent && !old->op_callstate)
nua_glib_op_destroy(self, old);
}
}
su_free(self->priv->home, to);
}
else if (method)
priv_oper_assign(op = old, method);
else
return old;
if (!op) {
if (address)
/*TODO, error returns*/
g_warning("%s: %s: invalid destination\n", self->priv->name, method_name);
else
/*TODO, error returns*/
g_warning("%s: %s: no destination\n", self->priv->name, method_name);
return NULL;
}
return op;
}
/**
* Creates an operation handle and binds it to an existing handle
* 'nh' (does not create a new nua handle with nua_handle()).
*/
NuaGlibOp *nua_glib_op_create_with_handle(NuaGlib *self,
sip_method_t method,
nua_handle_t *nh,
sip_from_t const *from)
{
NuaGlibOp *op;
enter;
if ((op = su_zalloc(self->priv->home, sizeof(*op)))) {
op->op_parent = self;
op->op_next = self->priv->operations;
self->priv->operations = op;
priv_oper_assign(op, method);
nua_handle_bind(op->op_handle = nh, op);
op->op_ident = sip_header_as_string(self->priv->home, (sip_header_t*)from);
}
else {
SU_DEBUG_1(("%s: cannot create operation object for method=%d\n",
self->priv->name, (int)method));
}
return op;
}
/** Delete operation and attached handles and identities */
void nua_glib_op_destroy(NuaGlib *self, NuaGlibOp *op)
{
NuaGlibOp **prev;
if (!op)
return;
g_assert(op->data == NULL);
/* Remove from queue */
for (prev = &self->priv->operations;
*prev && *prev != op;
prev = &(*prev)->op_next)
;
if (*prev)
*prev = op->op_next, op->op_next = NULL;
if (op->op_authlist)
nua_glib_auth_clear(self, op);
if (op->op_handle)
nua_handle_destroy(op->op_handle), op->op_handle = NULL;
su_free(self->priv->home, op);
}
/**
* Finds an operation by nua handle.
*/
NuaGlibOp *nua_glib_op_find_by_handle(NuaGlib *self, nua_handle_t *handle)
{
NuaGlibOp *op;
for (op = self->priv->operations; op; op = op->op_next)
if (op->op_handle == handle)
break;
return op;
}
/**
* Finds a call/session operation (an operation that has non-zero
* op_callstate).
*/
NuaGlibOp *nua_glib_op_find_session(NuaGlib *self)
{
NuaGlibOp *op;
for (op = self->priv->operations; op; op = op->op_next)
if (op->op_callstate)
break;
return op;
}
/**
* Checks whether 'op' is a valid handle or not.
*
* @return op if valid, NULL otherwise
*/
NuaGlibOp *nua_glib_op_check(NuaGlib *self, NuaGlibOp *op)
{
NuaGlibOp *tmp;
for (tmp = self->priv->operations; tmp; tmp = tmp->op_next)
if (tmp == op)
return op;
return NULL;
}
/* ======================================================================
* static functions
* ====================================================================== */
static void
priv_oper_assign(NuaGlibOp *op, sip_method_t method)
{
if (!op)
return;
op->op_method = method;
op->op_persistent =
method == sip_method_subscribe ||
method == sip_method_register ||
method == sip_method_publish;
}
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005,2006 Nokia Corporation.
* Copyright (C) 2005 Collabora Ltd.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __NUA_GLIB_OP_H__
#define __NUA_GLIB_OP_H__
#include <sofia-sip/nua_glib.h>
G_BEGIN_DECLS
NuaGlibOp *nua_glib_op_create(NuaGlib *self,
sip_method_t method,
const char *address,
tag_type_t tag, tag_value_t value, ...);
NuaGlibOp *nua_glib_op_create_with_handle(NuaGlib *self,
sip_method_t method,
nua_handle_t *nh,
sip_from_t const *from);
void nua_glib_op_destroy(NuaGlib *self, NuaGlibOp *op);
NuaGlibOp *nua_glib_op_find_by_handle(NuaGlib *self, nua_handle_t *handle);
NuaGlibOp *nua_glib_op_find_session(NuaGlib *self);
NuaGlibOp *nua_glib_op_check(NuaGlib *self, NuaGlibOp *op);
G_END_DECLS
#endif /* __NUA_GLIB_OP_H__ */
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005-2006 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __NUA_GLIB_PRIVATE_H__
#define __NUA_GLIB_PRIVATE_H__
/**@file nua_glib_priv.h Private implementation header for Sofia Glib
*
* @author Kai Vehmanen <Kai.Vehmanen@nokia.com>
* @author Rob Taylor <rob.taylor@collabora.co.uk>
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*/
#include <glib.h>
#define SU_ROOT_MAGIC_T NuaGlib
#define NUA_MAGIC_T NuaGlib
#define NUA_IMAGIC_T NuaGlibOp
#define NUA_HMAGIC_T NuaGlibOp
#define SOA_MAGIC_T NuaGlib
#include <sofia-sip/sip.h>
#include <sofia-sip/sip_header.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/nua.h>
#include <sofia-sip/nua_tag.h>
#include <sofia-sip/stun_tag.h>
#include <sofia-sip/soa.h>
#include <sofia-sip/su_tag_io.h>
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/sl_utils.h>
#include <sofia-sip/su_source.h>
#include <sofia-sip/su_debug.h>
#if HAVE_FUNC
#define enter (void)SU_DEBUG_9(("%s: entering\n", __func__))
#elif HAVE_FUNCTION
#define enter (void)SU_DEBUG_9(("%s: entering\n", __FUNCTION__))
#else
#define enter (void)0
#endif
struct _NuaGlibOp {
NuaGlibOp *op_next;
NuaGlib *op_parent; /**< Backpointer */
/**< Remote end identity
*
* Contents of To: when initiating, From: when receiving.
*/
char const *op_ident;
/** NUA handle */
nua_handle_t *op_handle;
/** How this handle was used initially */
sip_method_t op_method; /**< REGISTER, INVITE, MESSAGE, or SUBSCRIBE */
/** Call state.
*
* - opc_sent when initial INVITE has been sent
* - opc_recv when initial INVITE has been received
* - opc_complate when 200 Ok has been sent/received
* - opc_active when media is used
* - opc_sent when re-INVITE has been sent
* - opc_recv when re-INVITE has been received
*/
enum {
opc_none,
opc_sent = 1,
opc_recv = 2,
opc_complete = 3,
opc_active = 4,
opc_sent_hold = 8, /**< Call put on hold */
opc_pending = 16 /**< Waiting for local resources */
} op_callstate;
/** Authentication state.
*
* - opa_try_derived when using account password
* - opa_auth_req when requesting for additional credentials
* - opa_retry when additional credentials have been provided
* - opa_auth_ok if auth was succesful
* - opa_failed if auth failed
*/
enum {
opa_none = 0,
opa_try_derived,
opa_auth_req,
opa_retry,
opa_auth_ok,
opa_failed
} op_authstate;
int op_prev_state; /**< Previous call state */
unsigned op_persistent : 1; /**< Is this handle persistent? */
unsigned op_referred : 1;
unsigned :0;
GSList *op_authlist;
gpointer data;
};
struct _NuaGlibPrivate {
/* private: maybe this should be really private?*/
su_home_t home[1]; /**< Our memory home */
char const *name; /**< Our name */
su_root_t *root; /**< Pointer to application root */
unsigned init : 1; /**< True if class is inited */
gchar *address; /**< our SIP address (address-of-record) */
gchar *password; /**< SIP account password */
gchar *contact; /**< contact URI (local address) */
gchar *proxy; /**< outgoing proxy URI (optional, otherwise from DNS) */
gchar *registrar; /**< registrar URI (optional, otherwise from DNS) */
gchar *stun_server; /**< STUN server URI (optional, otherwise from DNS) */
nua_t *nua; /**< Pointer to NUA object */
NuaGlibOp *operations; /**< Remote destinations */
};
#endif /* __NUA_GLIB_PRIVATE_H__ */
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005,2006 Nokia Corporation.
* Copyright (C) 2005 Collabora Ltd.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __NUA_GLIB_H__
#define __NUA_GLIB_H__
#include <glib-object.h>
#include <sofia-sip/sip.h>
#include <sofia-sip/sip_status.h>
G_BEGIN_DECLS
/**@file nua_glib.h Glib Interface for Sofia-SIP User-Agent API (NUA)
*
* @author Kai Vehmanen <Kai.Vehmanen@nokia.com>
* @author Rob Taylor <rob.taylor@collabora.co.uk>
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*/
typedef struct _NuaGlibClass NuaGlibClass;
typedef struct _NuaGlib NuaGlib;
typedef struct _NuaGlibPrivate NuaGlibPrivate;
typedef struct _NuaGlibOp NuaGlibOp;
struct _NuaGlibClass {
GObjectClass parent_class;
};
struct _NuaGlib {
GObject parent;
NuaGlibPrivate *priv;
};
GType nua_glib_get_type(void);