Module: sip-router
Branch: master
Commit: fc287bc74e838052914eeeee1af1857533cb4ab1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fc287bc…
Author: pd <peter.dunkley(a)crocodile-rcs.com>
Committer: pd <peter.dunkley(a)crocodile-rcs.com>
Date: Wed Oct 19 11:44:56 2011 +0100
modules_k/registrar: added registered() to exported API for use in app_lua
---
modules_k/registrar/api.c | 16 ++++++++++++++++
modules_k/registrar/api.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/modules_k/registrar/api.c b/modules_k/registrar/api.c
index 4d01110..e30be9f 100644
--- a/modules_k/registrar/api.c
+++ b/modules_k/registrar/api.c
@@ -66,6 +66,21 @@ int regapi_lookup(struct sip_msg *msg, char *table)
/**
*
*/
+int regapi_registered(struct sip_msg *msg, char *table)
+{
+ udomain_t* d;
+
+ if(ul.get_udomain(table, &d)<0)
+ {
+ LM_ERR("usrloc domain [%s] not found\n", table);
+ return -1;
+ }
+ return registered(msg, (char*)d, NULL);
+}
+
+/**
+ *
+ */
int bind_registrar(registrar_api_t* api)
{
if (!api) {
@@ -74,6 +89,7 @@ int bind_registrar(registrar_api_t* api)
}
api->save = regapi_save;
api->lookup = regapi_lookup;
+ api->registered = regapi_registered;
return 0;
}
diff --git a/modules_k/registrar/api.h b/modules_k/registrar/api.h
index e559ec5..efdd2d7 100644
--- a/modules_k/registrar/api.h
+++ b/modules_k/registrar/api.h
@@ -43,6 +43,7 @@ int regapi_lookup(struct sip_msg *msg, char *table);
typedef struct registrar_api {
regapi_save_f save;
regapi_lookup_f lookup;
+ regapi_lookup_f registered;
} registrar_api_t;
typedef int (*bind_registrar_f)(registrar_api_t* api);