Asterisk.org: Developer Documentation (28 Oct 2009)

Wed Oct 28 15:47:53 2009

## Asterisk developer's documentation

# enum.h

Go to the documentation of this file.

    00001 /*
    00002  * Asterisk -- An open source telephony toolkit.
    00003  *
    00004  * Copyright (C) 1999 - 2005, Digium, Inc.
    00005  *
    00006  * Mark Spencer <markster@digium.com>
    00007  *
    00008  * See http://www.asterisk.org for more information about
    00009  * the Asterisk project. Please do not directly contact
    00010  * any of the maintainers of this project for assistance;
    00011  * the project provides a web site, mailing lists and IRC
    00012  * channels for your use.
    00013  *
    00014  * This program is free software, distributed under the terms of
    00015  * the GNU General Public License Version 2. See the LICENSE file
    00016  * at the top of the source tree.
    00017  */
    00018
    00019 /*!   \file enum.h
    00020    \brief DNS and ENUM functions
    00021 */
    00022
    00023 #ifndef _ASTERISK_ENUM_H
    00024 #define _ASTERISK_ENUM_H
    00025
    00026 #include "asterisk/channel.h"
    00027
    00028 /*! \brief Lookup entry in ENUM Returns 1 if found, 0 if not found, -1 on hangup
    00029    \param chan Channel
    00030    \param number   E164 number with or without the leading +
    00031    \param location Number returned  (or SIP uri)
    00032    \param maxloc  Max length
    00033    \param technology     Technology (from url scheme in response)
    00034                        You can set it to get particular answer RR, if there are many techs in DNS response, example: "sip"
    00035                        If you need any record, then set it to empty string
    00036    \param maxtech  Max length
    00037    \param suffix   Zone suffix (if is NULL then use enum.conf 'search' variable)
    00038    \param options  Options ('c' to count number of NAPTR RR, or number - the position of required RR in the answer list
    00039 */
    00040 extern int ast_get_enum(struct ast_channel *chan, const char *number, char *location, int maxloc, char *technology, int maxtech, char* suffix, char* options);
    00041
    00042 /*!   \brief Lookup DNS TXT record (used by app TXTCIDnum
    00043    \param chan Channel
    00044    \param number   E164 number with or without the leading +
    00045    \param location   Number returned   (or SIP uri)
    00046    \param maxloc  Max length of number
    00047    \param technology    Technology (not used in TXT records)
    00048    \param maxtech Max length
    00049    \param txt  Text string (return value)
    00050    \param maxtxt  Max length of "txt"
    00051 */
    00052 extern int ast_get_txt(struct ast_channel *chan, const char *number, char *location, int maxloc, char *technology, int maxtech, char *txt, int maxtxt);
    00053
    00054 extern int ast_enum_init(void);
    00055 extern int ast_enum_reload(void);
    00056
    00057 #endif /* _ASTERISK_ENUM_H */