[OpenSIPS-Users] Custom header parsing in failure route
I am testing a setup where opensips sending call to freeswitch and if call is rejected by freswitch a custom header X-internal-hangup. In opensips failure_route I am trying to check it using is_present_hf() function but it never reaches inside conditions. In wireshark I see this header. is_present_hf is working fine when used in main request block. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Custom header parsing in failure route
Hi, John! If the call is rejected, than the X-internal-hangup header is in the reply. failure_route is ran in the request context. Therefore, you have to use the is_present_hf() function in the onreply_route. Alternatively, you can check for the header existing using the hdr pseudo-variable in the reply context (i.e if ($(replyhdr(X-internal-hangup)) != NULL)). Best regards, Răzvan Crainea OpenSIPS Solutions www.opensips-solutions.com On 01/15/2015 12:40 PM, John Nash wrote: I am testing a setup where opensips sending call to freeswitch and if call is rejected by freswitch a custom header X-internal-hangup. In opensips failure_route I am trying to check it using is_present_hf() function but it never reaches inside conditions. In wireshark I see this header. is_present_hf is working fine when used in main request block. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Custom header parsing in failure route
Hello Razvan, Thank you. I asked similar question few days back about status code ..sorry about that. Regards John On Thu, Jan 15, 2015 at 4:42 PM, Răzvan Crainea raz...@opensips.org wrote: Hi, John! If the call is rejected, than the X-internal-hangup header is in the reply. failure_route is ran in the request context. Therefore, you have to use the is_present_hf() function in the onreply_route. Alternatively, you can check for the header existing using the hdr pseudo-variable in the reply context (i.e if ($(replyhdr(X-internal-hangup)) != NULL)). Best regards, Răzvan Crainea OpenSIPS Solutionswww.opensips-solutions.com On 01/15/2015 12:40 PM, John Nash wrote: I am testing a setup where opensips sending call to freeswitch and if call is rejected by freswitch a custom header X-internal-hangup. In opensips failure_route I am trying to check it using is_present_hf() function but it never reaches inside conditions. In wireshark I see this header. is_present_hf is working fine when used in main request block. ___ Users mailing listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users