Module: kamailio
Branch: master
Commit: 7e693ac32ceae7bcc34d6359043d6d9963933d4f
URL:
https://github.com/kamailio/kamailio/commit/7e693ac32ceae7bcc34d6359043d6d9…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: lazedo <luis.azedo(a)factorlusitano.com>
Date: 2017-04-17T18:08:42+01:00
kazoo: add alternative name for sender
---
Modified: src/modules/kazoo/defs.h
Modified: src/modules/kazoo/kz_pua.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7e693ac32ceae7bcc34d6359043d6d9…
Patch:
https://github.com/kamailio/kamailio/commit/7e693ac32ceae7bcc34d6359043d6d9…
---
diff --git a/src/modules/kazoo/defs.h b/src/modules/kazoo/defs.h
index 91877c8..616d8ac 100644
--- a/src/modules/kazoo/defs.h
+++ b/src/modules/kazoo/defs.h
@@ -52,6 +52,7 @@
#define BLF_JSON_CALLID "Call-ID"
#define BLF_JSON_DIALOGID "Dialog-ID"
#define BLF_JSON_SENDER "Sender-URI"
+#define BLF_JSON_SWITCH_URI "Switch-URI"
#define BLF_JSON_ETAG "ETag"
#define BLF_JSON_TOTAG "To-Tag"
#define BLF_JSON_FROMTAG "From-Tag"
diff --git a/src/modules/kazoo/kz_pua.c b/src/modules/kazoo/kz_pua.c
index d69100e..44a7448 100644
--- a/src/modules/kazoo/kz_pua.c
+++ b/src/modules/kazoo/kz_pua.c
@@ -392,6 +392,10 @@ int kz_pua_publish_dialoginfo_to_presentity(struct json_object
*json_obj)
json_extract_field(BLF_JSON_ETAG, etag);
json_extract_field(BLF_JSON_SENDER, sender);
+ if (sender.len == 0) {
+ json_extract_field(BLF_JSON_SWITCH_URI, sender);
+ }
+
struct json_object* ExpiresObj = kz_json_get_object(json_obj, BLF_JSON_EXPIRES);
if (ExpiresObj != NULL) {
expires = json_object_get_int(ExpiresObj);