[sr-dev] git:master: modules_k/registrar: Exported save_uri

Peter Dunkley peter.dunkley at crocodile-rcs.com
Tue Jun 12 03:25:53 CEST 2012


Module: sip-router
Branch: master
Commit: b4f3aea40c9588d60fb6643c52860a40b9ed994e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4f3aea40c9588d60fb6643c52860a40b9ed994e

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Tue Jun 12 02:07:42 2012 +0100

modules_k/registrar: Exported save_uri

- Feature added by Hugh Waite @ Crocodile RCS Ltd

---

 modules_k/registrar/api.c |   21 +++++++++++++++++++--
 modules_k/registrar/api.h |   10 +++++++---
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/modules_k/registrar/api.c b/modules_k/registrar/api.c
index 3c61b12..a90abd7 100644
--- a/modules_k/registrar/api.c
+++ b/modules_k/registrar/api.c
@@ -51,6 +51,21 @@ int regapi_save(struct sip_msg *msg, char *table, int flags)
 /**
  *
  */
+int regapi_save_uri(struct sip_msg *msg, char *table, int flags, str *uri)
+{
+	udomain_t* d;
+
+	if(ul.get_udomain(table, &d)<0)
+	{
+		LM_ERR("usrloc domain [%s] not found\n", table);
+		return -1;
+	}
+	return save(msg, d, flags, uri);
+}
+
+/**
+ *
+ */
 int regapi_lookup(struct sip_msg *msg, char *table)
 {
 	udomain_t* d;
@@ -87,8 +102,10 @@ int bind_registrar(registrar_api_t* api)
 		ERR("Invalid parameter value\n");
 		return -1;
 	}
-	api->save   = regapi_save;
-	api->lookup = regapi_lookup;
+	api->save       = regapi_save;
+	api->save_uri   = regapi_save_uri;
+	api->lookup     = regapi_lookup;
+	api->registered = regapi_registered;
 	api->registered = regapi_registered;
 
 	return 0;
diff --git a/modules_k/registrar/api.h b/modules_k/registrar/api.h
index efdd2d7..3756015 100644
--- a/modules_k/registrar/api.h
+++ b/modules_k/registrar/api.h
@@ -34,6 +34,9 @@
 typedef int (*regapi_save_f)(struct sip_msg *msg, char *table, int flags);
 int regapi_save(struct sip_msg *msg, char *table, int flags);
 
+typedef int (*regapi_save_uri_f)(struct sip_msg *msg, char *table, int flags, str *uri);
+int regapi_save_uri(struct sip_msg *msg, char *table, int flags, str *uri);
+
 typedef int (*regapi_lookup_f)(struct sip_msg *msg, char *table);
 int regapi_lookup(struct sip_msg *msg, char *table);
 
@@ -41,9 +44,10 @@ int regapi_lookup(struct sip_msg *msg, char *table);
  * @brief REGISTRAR API structure
  */
 typedef struct registrar_api {
-	regapi_save_f    save;
-	regapi_lookup_f  lookup;
-	regapi_lookup_f  registered;
+	regapi_save_f       save;
+	regapi_save_uri_f   save_uri;
+	regapi_lookup_f     lookup;
+	regapi_lookup_f     registered;
 } registrar_api_t;
 
 typedef int (*bind_registrar_f)(registrar_api_t* api);




More information about the sr-dev mailing list