Symptom
Show voip rtp stats output shows leaked ports information and port are stuck and not getting released properly. Once port leak reaches to maximum limit , all calls started failing due to rtp port non availability. Reload is the only option to recover the router.
Conditions
VRF is configured and the binded interface is down
Allocating port for invalid source IP and which is not releasing properly leads to RTP port leak
Further Problem Description
From code when we are allocating port,we are checking the vrfid && src_ip address are not valid
then only it is considering it as invalid IP and will not allocate the port.
But here since the vrf is configured, vrf id is valid vrf_id(1) but the src_ip we got in this error scenario is invalid.
src ip ().So the validation check for invalid source ip is failed here,
and we allocated the port 16858.
The souce ip is getting from the dial-peer bind. For this scenario we are unable to get the binded interface IP,
becuase the interface is down.
When releasing the port we are checking the src_ip is valid or not,
if not valid we will not release the port and will increment the error count VOIP_RTP_PORT_REL_INV_SRC_IP.
So the port 16858 is not released and we are able to see the leak, also the
port release error, invalid src ip (47) count from show command.