#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <asterisk/channel.h>
#include <asterisk/logger.h>
#include <asterisk/srv.h>
#include <asterisk/dns.h>
#include <asterisk/options.h>
#include <asterisk/utils.h>
Go to the source code of this file.
Functions | |
int | ast_get_srv (struct ast_channel *chan, char *host, int hostlen, int *port, const char *service) |
Variables | |
srv | __packed__ |
|
Definition at line 95 of file srv.c. References ast_autoservice_start(), ast_autoservice_stop(), ast_search_dns(), srv_context::host, srv_context::hostlen, and srv_context::port. 00096 { 00097 struct srv_context context; 00098 int ret; 00099 00100 context.host = host; 00101 context.hostlen = hostlen; 00102 context.port = port; 00103 00104 if (chan && ast_autoservice_start(chan) < 0) 00105 return -1; 00106 00107 ret = ast_search_dns(&context, service, C_IN, T_SRV, srv_callback); 00108 00109 if (chan) 00110 ret |= ast_autoservice_stop(chan); 00111 00112 if (ret <= 0) { 00113 host[0] = '\0'; 00114 *port = -1; 00115 return ret; 00116 } 00117 return ret; 00118 }
|
|
|