diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c index 16a62f8e6ec..e63e9315de1 100644 --- a/src/modules/ims_ipsec_pcscf/cmd.c +++ b/src/modules/ims_ipsec_pcscf/cmd.c @@ -76,6 +76,7 @@ extern usrloc_api_t ul; extern struct tm_binds tmb; #define IPSEC_SEND_FORCE_SOCKET 0x01 /* if set - set send force socket for request messages */ +#define IPSEC_REVERSE_SEARCH 0x02 /* if set - start seraching from the last element */ int bind_ipsec_pcscf(ipsec_pcscf_api_t* api) { if(!api){ @@ -663,7 +664,7 @@ int ipsec_create(struct sip_msg* m, udomain_t* d) ul.lock_udomain(d, &ci.via_host, ci.via_port, ci.via_prot); - if (ul.get_pcontact(d, &ci, &pcontact) != 0) { + if (ul.get_pcontact(d, &ci, &pcontact, 0) != 0) { LM_ERR("Contact doesn't exist\n"); goto cleanup; } @@ -802,7 +803,7 @@ int ipsec_forward(struct sip_msg* m, udomain_t* d, int _cflags) ul.lock_udomain(d, &ci.via_host, ci.via_port, ci.via_prot); - if (ul.get_pcontact(d, &ci, &pcontact) != 0) { + if (ul.get_pcontact(d, &ci, &pcontact, _cflags & IPSEC_REVERSE_SEARCH) != 0) { LM_ERR("Contact doesn't exist\n"); goto cleanup; } @@ -946,7 +947,7 @@ int ipsec_destroy(struct sip_msg* m, udomain_t* d) ul.lock_udomain(d, &ci.via_host, ci.via_port, ci.via_prot); - if (ul.get_pcontact(d, &ci, &pcontact) != 0) { + if (ul.get_pcontact(d, &ci, &pcontact, 0) != 0) { LM_ERR("Contact doesn't exist\n"); goto cleanup; } diff --git a/src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml b/src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml index 95b44f2c906..3d2a19efc97 100644 --- a/src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml +++ b/src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml @@ -243,8 +243,9 @@ ipsec_create("location"); stores the contacts. - flags - Set send force socket for request messages. - If 1 - set force socket for request messages. Useful for ipsec and TCP. + flags - bitwise flag: + 0x01 - set force socket for request messages. Useful for ipsec and TCP. + 0x02 - reverse search for a contact in the memory. Useful when contact alias is disabled. This is an optional parameter, default value - 0.