mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
ENUM Support
mod_enum can be used as a dialplan app, an api call from the console or as a dialplan interface.
Dialplan Interface:
put enum as the dialplan parameter in an endpoint module
i.e. instead of "XML" set it to "enum" or "enum,XML" for fall through.
Dialplan App:
This example will do a lookup and set the a variable that is the proper
dialstring to call all of the possible routes in order of preference according to
the lookup and the order of the routes in the enum.conf section.
<extension name="tollfree">
<condition field="destination_number" expression="^(18(0{2}|8{2}|7{2}|6{2})\d{7})$">
<action application="enum" data="$1"/>
<action application="bridge" data="${enum_auto_route}"/>
</condition>
</extension>
You can also pick an alrernate root:
<action application="enum" data="$1 myroot.org"/>
API command:
at the console you can say:
enum <number> [<root>]
The root always defaults to the one in the enum.conf section.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3494 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -86,6 +86,8 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_LOCAL_MEDIA_PORT_VARIABLE "_local_media_port_"
|
||||
#define SWITCH_REMOTE_MEDIA_IP_VARIABLE "_remote_media_ip_"
|
||||
#define SWITCH_REMOTE_MEDIA_PORT_VARIABLE "_remote_media_port_"
|
||||
#define SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE "hangup_after_bridge"
|
||||
|
||||
#define SWITCH_SPEECH_KEY "_speech_"
|
||||
#define SWITCH_UUID_BRIDGE "_uuid_bridge_"
|
||||
#define SWITCH_BITS_PER_BYTE 8
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#define SWITCH_UTILS_H
|
||||
|
||||
#include <switch.h>
|
||||
#include <pcre.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
@@ -231,8 +232,15 @@ SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t *poll, int ms);
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_cut_path(char *in);
|
||||
|
||||
#define switch_clean_re(re) if (re) {\
|
||||
pcre_free(re);\
|
||||
re = NULL;\
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_string_replace(const char *string, const char *search, const char *replace);
|
||||
SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len);
|
||||
SWITCH_DECLARE(int) switch_perform_regex(char *field, char *expression, pcre **new_re, int *ovector, uint32_t olen);
|
||||
SWITCH_DECLARE(void) switch_perform_substitution(pcre *re, int match_count, char *data, char *field_data, char *substituted, uint32_t len, int *ovector);
|
||||
|
||||
#define SWITCH_READ_ACCEPTABLE(status) status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK
|
||||
SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len);
|
||||
|
||||
Reference in New Issue
Block a user