Module: kamailio
Branch: master
Commit: f60ce62d9bbf7a3f1c14ed85dc88425fd61f9c1c
URL:
https://github.com/kamailio/kamailio/commit/f60ce62d9bbf7a3f1c14ed85dc88425…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Henning Westerholt <henningw(a)users.noreply.github.com>
Date: 2019-03-09T12:52:43+01:00
presence: add sockinfo to $subs
---
Modified: src/modules/presence/subscribe.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f60ce62d9bbf7a3f1c14ed85dc88425…
Patch:
https://github.com/kamailio/kamailio/commit/f60ce62d9bbf7a3f1c14ed85dc88425…
---
diff --git a/src/modules/presence/subscribe.c b/src/modules/presence/subscribe.c
index a8eb6c18a6..1ab693109e 100644
--- a/src/modules/presence/subscribe.c
+++ b/src/modules/presence/subscribe.c
@@ -760,7 +760,7 @@ subs_t *_pres_subs_last_sub = NULL;
* version 21
* flags 22
* user_agent 23
- *
+ * sockinfo 24
*/
int pv_parse_subscription_name(pv_spec_p sp, str *in)
@@ -822,6 +822,8 @@ int pv_parse_subscription_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 9;
} else if(strncmp(in->s, "from_tag", 8) == 0) {
sp->pvp.pvn.u.isname.name.n = 11;
+ } else if(strncmp(in->s, "sockinfo", 8) == 0) {
+ sp->pvp.pvn.u.isname.name.n = 24;
} else {
goto error;
};
@@ -961,6 +963,8 @@ int pv_get_subscription(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
return pv_get_sintval(msg, param, res, _pres_subs_last_sub->flags);
} else if(param->pvn.u.isname.name.n == 23) {
return pv_get_strval(msg, param, res, &_pres_subs_last_sub->user_agent);
+ } else if(param->pvn.u.isname.name.n == 24) {
+ return pv_get_strval(msg, param, res, &_pres_subs_last_sub->sockinfo_str);
}
LM_ERR("unknown specifier\n");