mirror of https://github.com/sipwise/kamailio.git
Change-Id: Id2d3c99ff4d57823ddb59fcdf9e8a7a19d7bf5c1changes/51/2451/1
parent
e82524cdf6
commit
e0b7ef1796
@ -0,0 +1,41 @@
|
||||
From 99ce64fc555cc0b6b0189d812c6156cb05fb2e1b Mon Sep 17 00:00:00 2001
|
||||
From: Victor Seva <linuxmaniac@torreviejawireless.org>
|
||||
Date: Thu, 6 Aug 2015 20:36:22 +0200
|
||||
Subject: [PATCH] registrar: get instance and ref_id when using msg
|
||||
|
||||
needed for check max_contacts properly if sip.instance exists
|
||||
as contact parameter
|
||||
|
||||
See: #278
|
||||
---
|
||||
modules/registrar/save.c | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/modules/registrar/save.c b/modules/registrar/save.c
|
||||
index ae311e8..1ebb849 100644
|
||||
--- a/modules/registrar/save.c
|
||||
+++ b/modules/registrar/save.c
|
||||
@@ -307,6 +307,20 @@ static inline ucontact_info_t* pack_ci( struct sip_msg* _m, contact_t* _c,
|
||||
}
|
||||
|
||||
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 */
|
||||
--
|
||||
2.4.6
|
||||
|
Loading…
Reference in new issue