Module: sip-router
Branch: carstenbock/ims
Commit: 3b6afb48f802e776c5361dbcabcaafd22a3b30b0
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3b6afb4…
Author: Carsten Bock <carsten(a)bock.info>
Committer: Carsten Bock <carsten(a)bock.info>
Date: Mon Apr 18 09:09:27 2011 +0200
Various, minor bug-fixes.
---
modules_k/pua_reginfo/notify.c | 9 ++++++---
modules_k/pua_reginfo/usrloc_cb.c | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/modules_k/pua_reginfo/notify.c b/modules_k/pua_reginfo/notify.c
index aca9134..0f5416d 100644
--- a/modules_k/pua_reginfo/notify.c
+++ b/modules_k/pua_reginfo/notify.c
@@ -202,7 +202,7 @@ int process_body(str notify_body, udomain_t * domain) {
str contact_uri = {0, 0};
int state, event, expires, result, final_result = RESULT_ERROR;
char * expires_char, * cseq_char;
- int cseq;
+ int cseq = 0;
urecord_t * ul_record;
ucontact_t * ul_contact;
struct sip_uri parsed_aor;
@@ -333,6 +333,9 @@ int process_body(str notify_body, udomain_t * domain) {
contact_uri.len = strlen(contact_uri.s);
LM_DBG("Contact: %.*s\n",
contact_uri.len, contact_uri.s);
+
+ /* Add to Usrloc: */
+ result = process_contact(domain, &ul_record, parsed_aor.user, callid, cseq,
expires, event, contact_uri);
/* Process the result */
if (final_result != RESULT_CONTACTS_FOUND) final_result = result;
@@ -344,7 +347,7 @@ next_contact:
}
}
next_registration:
- if (ul_record) ul.release_urecord(ul_record);
+ // if (ul_record) ul.release_urecord(ul_record);
/* Unlock the domain for this AOR: */
ul.unlock_udomain(domain, &parsed_aor.user);
@@ -358,7 +361,7 @@ error:
int reginfo_handle_notify(struct sip_msg* msg, char* domain, char* s2) {
str body;
- int result = 0;
+ int result = 1;
/* If not done yet, parse the whole message now: */
if (parse_headers(msg, HDR_EOH_F, 0) == -1) {
diff --git a/modules_k/pua_reginfo/usrloc_cb.c b/modules_k/pua_reginfo/usrloc_cb.c
index 6fb807c..40dfe1e 100644
--- a/modules_k/pua_reginfo/usrloc_cb.c
+++ b/modules_k/pua_reginfo/usrloc_cb.c
@@ -115,7 +115,7 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c,
int type) {
}
memset(buf, 0, sizeof(buf));
buf_len = snprintf(buf, sizeof(buf), "%p", ptr);
- xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST ptr->callid.s);
+ xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST buf);
/* Check, if this is the modified contact: */
if (ptr == c) {
if ((type & UL_CONTACT_INSERT) || (type & UL_CONTACT_UPDATE))
@@ -145,7 +145,7 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c,
int type) {
xmlNewProp(contact_node, BAD_CAST "callid", BAD_CAST ptr->callid.s);
/* CSeq Attribute */
buf_len = snprintf(buf, sizeof(buf), "%d", ptr->cseq);
- uri_node = xmlNewChild(contact_node, NULL, BAD_CAST "cseq", BAD_CAST buf) ;
+ xmlNewProp(contact_node, BAD_CAST "cseq", BAD_CAST buf);
/* URI-Node */
buf_len = snprintf(buf, sizeof(buf), "%.*s", ptr->c.len, ptr->c.s);
uri_node = xmlNewChild(contact_node, NULL, BAD_CAST "uri", BAD_CAST buf) ;