Module: kamailio
Branch: 4.1
Commit: f2d23c1a038703e37a32dd5ea75d9b442e2fbc93
URL:
https://github.com/kamailio/kamailio/commit/f2d23c1a038703e37a32dd5ea75d9b4…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2015-08-07T11:31:20+02:00
registrar: get instance and ref_id when using msg
needed for check max_contacts properly if sip.instance exists
as contact parameter
See: #278
(cherry picked from commit 99ce64fc555cc0b6b0189d812c6156cb05fb2e1b)
---
Modified: modules/registrar/save.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f2d23c1a038703e37a32dd5ea75d9b4…
Patch:
https://github.com/kamailio/kamailio/commit/f2d23c1a038703e37a32dd5ea75d9b4…
---
diff --git a/modules/registrar/save.c b/modules/registrar/save.c
index fd5471b..ef0e700 100644
--- a/modules/registrar/save.c
+++ b/modules/registrar/save.c
@@ -322,6 +322,22 @@ static inline ucontact_info_t* pack_ci( struct sip_msg* _m,
contact_t* _c, unsig
ci.received = path_received;
}
+ ci.server_id = server_id;
+ if(_m->contact) {
+ _c = (((contact_body_t*)_m->contact->parsed)->contacts);
+ if(_c->instance!=NULL && _c->instance->body.len>0) {
+ ci.instance = _c->instance->body;
+ LM_DBG("set instance[%.*s]\n", ci.instance.len, ci.instance.s);
+ }
+ if(_use_regid && _c->instance!=NULL && _c->reg_id!=NULL
&& _c->reg_id->body.len>0) {
+ if(str2int(&_c->reg_id->body, &ci.reg_id)<0 || ci.reg_id==0)
+ {
+ LM_ERR("invalid reg-id value\n");
+ goto error;
+ }
+ }
+ }
+
allow_parsed = 0; /* not parsed yet */
received_found = 0; /* not found yet */
m = _m; /* remember the message */