Module: sip-router
Branch: admorten/sca
Commit: 959b2c423a70395c97437d0bcef7950762c4a9b5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=959b2c4…
Author: Andrew Mortensen <admorten(a)isc.upenn.edu>
Committer: Andrew Mortensen <admorten(a)isc.upenn.edu>
Date: Tue Nov 27 00:09:06 2012 -0500
sca: remove dependency on usrloc.
- usrloc callbacks in practice were only useful for expired
registrations, and even in that case our expired subscription
…
[View More]timer is likely to have purged the stale subscription.
---
modules_s/sca/sca.c | 64 -------------------------------
modules_s/sca/sca_common.h | 1 -
modules_s/sca/sca_usrloc_cb.c | 84 -----------------------------------------
modules_s/sca/sca_usrloc_cb.h | 26 -------------
4 files changed, 0 insertions(+), 175 deletions(-)
diff --git a/modules_s/sca/sca.c b/modules_s/sca/sca.c
index c002241..b2a912d 100644
--- a/modules_s/sca/sca.c
+++ b/modules_s/sca/sca.c
@@ -26,7 +26,6 @@
#include <sys/types.h>
#include <stdlib.h>
-#include "../usrloc/usrloc.h"
#include "../../timer.h"
#include "../../timer_proc.h"
@@ -35,7 +34,6 @@
#include "sca_call_info.h"
#include "sca_rpc.h"
#include "sca_subscribe.h"
-#include "sca_usrloc_cb.h"
MODULE_VERSION
@@ -46,7 +44,6 @@ sca_mod *sca;
/* EXTERNAL API */
db_func_t dbf; /* db api */
-usrloc_api_t ul; /* usrloc callbacks */
struct tm_binds tmb; /* tm functions for sending messages */
sl_api_t slb; /* sl callback, function for getting to-tag */
@@ -54,7 +51,6 @@ sl_api_t slb; /* sl callback, function for getting to-tag */
static int sca_mod_init( void );
static int sca_child_init( int );
static void sca_mod_destroy( void );
-static int sca_bind_usrloc( usrloc_api_t *, sca_mod ** );
static int sca_set_config( sca_mod * );
/* EXPORTED COMMANDS */
@@ -127,61 +123,6 @@ struct module_exports exports = {
sca_child_init, /* per-child initialization function */
};
-/*
- * bind usrloc API and register callbacks for events we care about.
- */
- static int
-sca_bind_usrloc( usrloc_api_t *ul_api, sca_mod **scam )
-{
- bind_usrloc_t bind_usrloc;
-
- assert( scam != NULL );
-
- bind_usrloc = (bind_usrloc_t)find_export( "ul_bind_usrloc", 1, 0 );
- if ( !bind_usrloc ) {
- LM_ERR( "Can't find exported usrloc functions" );
- return( -1 );
- }
-
- if ( bind_usrloc( ul_api ) < 0 ) {
- LM_ERR( "Can't bind exported usrloc functions" );
- return( -1 );
- }
- if ( ul_api->register_ulcb == NULL ) {
- LM_ERR( "Failed to import usrloc register callback function" );
- return( -1 );
- }
-
- /*
- * register callback functions for:
- * 1. contact insertion (new REGISTER for an AoR);
- * 2. contact expiration (registration expired);
- * 3. contact re-registration;
- * 4. contact deletion (REGISTER with Expires: 0)
- */
- if ( ul_api->register_ulcb( UL_CONTACT_INSERT,
- sca_contact_change_cb, NULL ) < 0 ) {
- LM_ERR( "Failed to register for usrloc contact insert callback" );
- return( -1 );
- }
- if ( ul_api->register_ulcb( UL_CONTACT_EXPIRE,
- sca_contact_change_cb, NULL ) < 0 ) {
- LM_ERR( "Failed to register for usrloc contact expire callback" );
- return( -1 );
- }
- if ( ul_api->register_ulcb( UL_CONTACT_UPDATE,
- sca_contact_change_cb, NULL ) < 0 ) {
- LM_ERR( "Failed to register for usrloc contact update callback" );
- return( -1 );
- }
- if ( ul_api->register_ulcb( UL_CONTACT_DELETE,
- sca_contact_change_cb, NULL ) < 0 ) {
- LM_ERR( "Failed to register for usrloc contact update callback" );
- return( -1 );
- }
-
- return( 0 );
-}
static int
sca_bind_sl( sca_mod *scam, sl_api_t *sl_api )
@@ -359,11 +300,6 @@ sca_mod_init( void )
return( -1 );
}
- if ( sca_bind_usrloc( &ul, &sca ) != 0 ) {
- LM_ERR( "Failed to initialize required usrloc API" );
- return( -1 );
- }
-
if ( load_tm_api( &tmb ) != 0 ) {
LM_ERR( "Failed to initialize required tm API" );
return( -1 );
diff --git a/modules_s/sca/sca_common.h b/modules_s/sca/sca_common.h
index 0ddff4d..d613773 100644
--- a/modules_s/sca/sca_common.h
+++ b/modules_s/sca/sca_common.h
@@ -49,7 +49,6 @@
#include "../../mem/shm_mem.h"
/* bound API headers */
-#include "../usrloc/usrloc.h"
#include "../../modules/sl/sl.h"
#include "../../modules/tm/tm_load.h"
diff --git a/modules_s/sca/sca_usrloc_cb.c b/modules_s/sca/sca_usrloc_cb.c
deleted file mode 100644
index ae76ec2..0000000
--- a/modules_s/sca/sca_usrloc_cb.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 2012 Andrew Mortensen
- *
- * This file is part of the sca module for sip-router, a free SIP server.
- *
- * The sca module 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
- *
- * The sca module 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
- *
- *
- */
-#include <sys/types.h>
-#include <stdlib.h>
-
-#include "sca_common.h"
-
-#include "sca.h"
-#include "sca_appearance.h"
-#include "sca_event.h"
-#include "sca_subscribe.h"
-#include "sca_usrloc_cb.h"
-
- static const char *
-sca_name_from_contact_event_type( int type )
-{
- static const char *name = "unknown contact change event";
-
- switch ( type ) {
- case UL_CONTACT_INSERT:
- name = "insert";
- break;
-
- case UL_CONTACT_UPDATE:
- name = "update";
- break;
-
- case UL_CONTACT_EXPIRE:
- name = "expire";
- break;
-
- case UL_CONTACT_DELETE:
- name = "delete";
- break;
-
- default:
- break;
- }
-
- return( name );
-}
-
- void
-sca_contact_change_cb( ucontact_t *c, int type, void *param )
-{
- const char *event_name = sca_name_from_contact_event_type( type );
-
- if ( type == UL_CONTACT_INSERT || type == UL_CONTACT_UPDATE ) {
- return;
- }
-
- if ( !sca_uri_is_shared_appearance( sca, &c->aor )) {
- LM_DBG( "%.*s is not a shared appearance line", STR_FMT( &c->aor ));
- return;
- }
-
- if ( sca_subscription_delete_subscriber_for_event( sca, &c->c,
- &SCA_EVENT_NAME_CALL_INFO, &c->aor ) < 0 ) {
- LM_ERR( "Failed to delete %.*s %.*s subscription on %s",
- STR_FMT( &c->c ), STR_FMT( &SCA_EVENT_NAME_CALL_INFO ),
- event_name );
- }
-}
diff --git a/modules_s/sca/sca_usrloc_cb.h b/modules_s/sca/sca_usrloc_cb.h
deleted file mode 100644
index a74cdc7..0000000
--- a/modules_s/sca/sca_usrloc_cb.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 2012 Andrew Mortensen
- *
- * This file is part of the sca module for sip-router, a free SIP server.
- *
- * The sca module 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
- *
- * The sca module 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
- *
- *
- */
-#include "sca_common.h"
-
-void sca_contact_change_cb( ucontact_t *, int, void * );
[View Less]
Hello,
I want to announce that a new developer got GIT write access to
repository: Andrew Mortensen from University of Pennsylvania, USA - he
has contributed a new module: sca (Shared Call Appearances for Broadsoft
extensions).
The module is right now in a personal branch, soon to me merged in
master branch.
His git commit id is: admorten
My warm welcome and looking forward to future work within the project.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://…
[View More]twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
[View Less]
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#254 - uacreg functionality: kamailio sending zeroes in header
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Not a bug
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=254
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want …
[View More]to receive mails in future, you can change your notification settings at the URL shown above.
[View Less]
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#254 - uacreg functionality: kamailio sending zeroes in header
User who did this - Daniel-Constantin Mierla (miconda)
----------
No problem, it can happen to anyone.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=254#comment753
You are receiving this message because you have requested it from the Flyspray bugtracking …
[View More]system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
[View Less]
Hello,
On 11/26/12 3:52 PM, Eduardo Lejarreta wrote:
>
> Good evening.
>
> I'm a rookie (not a developer), on users mailling list I've been
> forwarded to this. Anyway, this is the case:
>
> Dialog, tm, rr and acc: 3.2.1 modules version
>
> When you finish externally a dialog, vía FIFO command with
> "dlg_terminate_dlg: callid, from_tag" the callback register function
> "register_dlgcb" on "/DLGCB_TERMINATED" event /returns a:
>
> dlg_cb_params * …
[View More]params->req with (NIL) value.
>
the request does not exist in this case, going to be generated locally.
> This callback register function is used by "acc" module with acc_cdr
> accounting enabled to track the end of the call.
>
> In this scenario acc module can not account the end of the call. ->
> ERROR: acc [acc_cdr.c:480]: invalid values#012!
>
> If you try this scenario over TCP and with "RR" module with "enable_double_rr" enabled you will see that the "acc" module is able to track the end of the call because a double "Record-route" header is inserted by proxy.
>
> Do you think this could be an issue that it can be resolved in future? Or may be we're forgetting something.
>
> Any help, any idea?,
Maybe you can solve it by storing dialog hash and id -- see the
$dlg(...) class of variables.
It should be solved in a way or another, to become useful, please open
an issue on the tracker not to forget about it. I plan to look a bit at
cdr accounting with dialog before the next major release.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
[View Less]