Module: kamailio
Branch: master
Commit: 531df447897d2186db4e88dcff59e4538c65da92
URL:
https://github.com/kamailio/kamailio/commit/531df447897d2186db4e88dcff59e45…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2016-10-24T10:32:26+02:00
sca: obey server_address param at subscription replies
---
Modified: modules/sca/doc/sca_admin.xml
Modified: modules/sca/sca_subscribe.c
---
Diff:
https://github.com/kamailio/kamailio/commit/531df447897d2186db4e88dcff59e45…
Patch:
https://github.com/kamailio/kamailio/commit/531df447897d2186db4e88dcff59e45…
---
diff --git a/modules/sca/doc/sca_admin.xml b/modules/sca/doc/sca_admin.xml
index bf212a3..6ff3944 100644
--- a/modules/sca/doc/sca_admin.xml
+++ b/modules/sca/doc/sca_admin.xml
@@ -288,7 +288,7 @@ modparam("sca", "onhold_bflag", 15)
<title><varname>server_address</varname> (string)</title>
<para>
The server address which will become the value of Contact header filed
- for NOTIFY messages.
+ for reply messages.
</para>
<para>
<emphasis>
diff --git a/modules/sca/sca_subscribe.c b/modules/sca/sca_subscribe.c
index 37b46b4..efa931c 100644
--- a/modules/sca/sca_subscribe.c
+++ b/modules/sca/sca_subscribe.c
@@ -1377,7 +1377,12 @@ int sca_subscription_reply(sca_mod *scam, int status_code, char
*status_msg,
extra_headers.len = len;
SCA_STR_APPEND_CSTR(&extra_headers, "Contact: ");
- SCA_STR_APPEND(&extra_headers, &REQ_LINE(msg).uri);
+ if (sca->cfg->server_address != NULL) {
+ SCA_STR_APPEND( &extra_headers, sca->cfg->server_address);
+ }
+ else {
+ SCA_STR_APPEND( &extra_headers, &REQ_LINE( msg ).uri );
+ }
SCA_STR_APPEND_CSTR(&extra_headers, CRLF);
SCA_STR_COPY_CSTR(&extra_headers,