Module: sip-router
Branch: master
Commit: b05795313b031d50a78589ba2bd89dd0d1811166
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b057953…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: Wed Sep 10 21:51:20 2014 +0200
ims_registrar_pcscf: Add option to ignore "REGISTERED STATE", when checking for
a registered client.
---
modules/ims_registrar_pcscf/reg_mod.c | 7 ++++++-
modules/ims_registrar_pcscf/reg_mod.h | 1 +
modules/ims_registrar_pcscf/service_routes.c | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/ims_registrar_pcscf/reg_mod.c
b/modules/ims_registrar_pcscf/reg_mod.c
index fb5c715..a987a04 100644
--- a/modules/ims_registrar_pcscf/reg_mod.c
+++ b/modules/ims_registrar_pcscf/reg_mod.c
@@ -78,7 +78,9 @@ pua_api_t pua; /**!< PUA API structure */
int publish_reginfo = 0;
int subscribe_to_reginfo = 0;
int subscription_expires = 3600;
-int ignore_contact_rxport_check = 0; /**!< ignore port
checks between received port on message and registration received port.
+int ignore_reg_state = 0;
+int ignore_contact_rxport_check = 0; /**!< ignore port
checks between received port on message and
+registration received port.
* this is useful for
example if you register with UDP but possibly send invite over TCP (message too big)*/
time_t time_now;
@@ -90,6 +92,8 @@ unsigned int pending_reg_expires = 30; /**!< parameter for expiry
time of a pe
int is_registered_fallback2ip = 0;
+
+
char* rcv_avp_param = 0;
unsigned short rcv_avp_type = 0;
int_str rcv_avp_name;
@@ -159,6 +163,7 @@ static param_export_t params[] = {
{"subscribe_to_reginfo", INT_PARAM, &subscribe_to_reginfo
},
{"subscription_expires", INT_PARAM, &subscription_expires
},
{"ignore_contact_rxport_check", INT_PARAM,
&ignore_contact_rxport_check },
+ {"ignore_reg_state", INT_PARAM, &ignore_reg_state },
{"force_icscf_uri", PARAM_STR, &force_icscf_uri },
// {"store_profile_dereg", INT_PARAM, &store_data_on_dereg},
{0, 0, 0}
diff --git a/modules/ims_registrar_pcscf/reg_mod.h
b/modules/ims_registrar_pcscf/reg_mod.h
index 45fdc0f..258db4b 100644
--- a/modules/ims_registrar_pcscf/reg_mod.h
+++ b/modules/ims_registrar_pcscf/reg_mod.h
@@ -60,6 +60,7 @@
extern unsigned short rcv_avp_type;
extern int_str rcv_avp_name;
extern int is_registered_fallback2ip;
+extern int ignore_reg_state;
#endif /* REG_MOD_H */
diff --git a/modules/ims_registrar_pcscf/service_routes.c
b/modules/ims_registrar_pcscf/service_routes.c
index 4380ce8..851ffad 100644
--- a/modules/ims_registrar_pcscf/service_routes.c
+++ b/modules/ims_registrar_pcscf/service_routes.c
@@ -137,7 +137,7 @@ int checkcontact(struct sip_msg* _m, pcontact_t * c) {
}
}
- if ((c->reg_state == PCONTACT_REGISTERED)
+ if ((ignore_reg_state || (c->reg_state == PCONTACT_REGISTERED))
&& (ignore_contact_rxport_check || (c->received_port ==
_m->rcv.src_port) || (security_server_port == _m->rcv.src_port))
&& (ignore_contact_rxport_check||(c->received_proto ==
_m->rcv.proto))) {