summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-01-19 00:28:49 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-01-19 00:28:49 +0000
commit49bf540c71e9f42aae3a2d8aa835e5137b748225 (patch)
tree1fa70043dacf63a29de615f9f6c82ad0f824f011 /include/asterisk
parent800313cbd916f6078deb5e83b4bc028ba2605de8 (diff)
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
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/srv.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asterisk/srv.h b/include/asterisk/srv.h
index 567b40844..a3d2c7a6e 100644
--- a/include/asterisk/srv.h
+++ b/include/asterisk/srv.h
@@ -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.
*/