Module: kamailio Branch: master Commit: a176c7f1e5686d0aed5c95830d62eb964358841a URL: https://github.com/kamailio/kamailio/commit/a176c7f1e5686d0aed5c95830d62eb96...
Author: Richard Good richard.good@smilecoms.com Committer: Richard Good richard.good@smilecoms.com Date: 2016-02-16T15:51:03+02:00
modules/ims_registrar_pcscf: Check if we subscribe to reg_info before processing notify - fix crash
---
Modified: modules/ims_registrar_pcscf/notify.c
---
Diff: https://github.com/kamailio/kamailio/commit/a176c7f1e5686d0aed5c95830d62eb96... Patch: https://github.com/kamailio/kamailio/commit/a176c7f1e5686d0aed5c95830d62eb96...
---
diff --git a/modules/ims_registrar_pcscf/notify.c b/modules/ims_registrar_pcscf/notify.c index f6010b4..c23e4b2 100644 --- a/modules/ims_registrar_pcscf/notify.c +++ b/modules/ims_registrar_pcscf/notify.c @@ -79,6 +79,8 @@ extern usrloc_api_t ul; extern time_t time_now;
+extern int subscribe_to_reginfo; + int process_contact(udomain_t * _d, int expires, str contact_uri, int contact_state) { char bufport[5], *rest, *sep, *val, *port, *trans; pcontact_t* pcontact; @@ -476,6 +478,11 @@ int reginfo_handle_notify(struct sip_msg* msg, char* domain, char* s2) { LM_DBG("Handling notify\n"); str body; int result = 1; + + if(subscribe_to_reginfo != 1){ + LM_ERR("Received a NOTIFY for reg-info but I have not SUBSCRIBED for them. Ignoring"); + return -1; + }
/* If not done yet, parse the whole message now: */ if (parse_headers(msg, HDR_EOH_F, 0) == -1) {