presence: add sockinfo to $subs
authorlazedo <luis.azedo@factorlusitano.com>
Tue, 5 Mar 2019 10:34:09 +0000 (10:34 +0000)
committerHenning Westerholt <henningw@users.noreply.github.com>
Sat, 9 Mar 2019 11:52:43 +0000 (12:52 +0100)
src/modules/presence/subscribe.c

index a8eb6c1..1ab6931 100644 (file)
@@ -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");