Create iterative method for querying SRV results, and use that for finding AGI servers.

(closes issue #14775)
 Reported by: _brent_
 Patches: 
       20091215__issue14775.diff.txt uploaded by tilghman (license 14)
       hagi-5.patch uploaded by brent (license 388)
 Tested by: _brent_
 Reviewboard: https://reviewboard.asterisk.org/r/378/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2010-01-19 00:28:49 +00:00
parent 800313cbd9
commit 49bf540c71
4 changed files with 162 additions and 18 deletions

View File

@@ -31,6 +31,25 @@
no provisions for retrying or failover between records.
*/
/*!\brief An opaque type, for lookup usage */
struct srv_context;
/*!\brief Retrieve set of SRV lookups, in order
* \param[in] context A pointer in which to hold the result
* \param[in] service The service name to look up
* \param[out] host Result host
* \param[out] port Associated TCP portnum
* \retval -1 Query failed
* \retval 0 Result exists in host and port
* \retval 1 No more results
*/
extern int ast_srv_lookup(struct srv_context **context, const char *service, const char **host, unsigned short *port);
/*!\brief Cleanup resources associated with ast_srv_lookup
* \param context Pointer passed into ast_srv_lookup
*/
void ast_srv_cleanup(struct srv_context **context);
/*! Lookup entry in SRV records Returns 1 if found, 0 if not found, -1 on hangup
Only do SRV record lookup if you get a domain without a port. If you get a port #, it's a DNS host name.
*/