srv.h File Reference

This graph shows which files directly or indirectly include this file:

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)


Function Documentation

int ast_get_srv ( struct ast_channel chan,
char *  host,
int  hostlen,
int *  port,
const char *  service 
)

Definition at line 95 of file srv.c.

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 }


Generated on Wed Oct 28 17:01:03 2009 for Asterisk by  doxygen 1.5.6