A note about qualified endpoints and DNS

Most SIP endpoints will qualify each other by sending OPTIONS back and forth to make sure they are there and can respond.  Asterisk uses this mechanism and will initiate these OPTIONS dialogs via res_pjsip periodically based on how the corresponding endpoint is configured.

Generally this qualification occurs after incoming registration (to make sure Asterisk can send a dialog to an endpoint, and not just receive one from it) and then periodically based on the qualify_frequency value.  As an example of this mechanism, sometimes you will see a phone register, then immediately be marked as Unreachable.  This is because although the REGISTER reached Asterisk and Asterisk responded, the phone didn’t respond when Asterisk tried to then qualify it.  Asterisk considers this Unreachable because although the phone can reach Asterisk, Asterisk can not reach the phone.

As long as the endpoint is marked as Unreachable Asterisk will not send it any new calls.  This is to avoid unnecessary traffic to an endpoint that isn’t otherwise responding.  Asterisk will continue to qualify an endpoint, whether Reachable or Unreachable based on the qualify_frequency.

In addition to the qualify_frequency, there is qualify_timeout.  This value tells res_pjsip how long to wait for a response to a qualify OPTIONS message.  Generally we expect this to be quite low as any delay when relaying a SIP message causes call issues, but it is important to know that this includes any DNS lookups required for a resolved endpoint.  This means that the DNS server being used should be considered part of your critical path and the time for lookups should be considered when setting the timeout.

About the Author

What can we help you find?