VoIP Cookbook: ENUM Routing Table in OpenSIPS configuration

From SpeedyWiki

Revision as of 05:00, 9 March 2010 by Onnowpurbo (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

The short version

if (uri=~"^sip:00[1-9][0-9]*@*") {

if (uri=~"sip:\+[0-9]+@*")

The above example will allow all client from all server to access our ENUM query routing. A more complete version of ENUM query may be as follows,

# Somewhere in the route[x] section:

# if you want to make ENUM work with numbers starting with "00",
# use the following to convert "00" it into a "+"

if (uri=~"^sip:00[1-9][0-9]*@example\.net") {
    # strip leading "00"
    # (change example.net to your domainname or skip the stuff after the "@")
    # (adjust, if your international prefix is something else than "00")

# check if request uri starts with an international phone
# number (+X.), if yes, try to ENUM resolve in e164.arpa.
# if no result, try in nrenum.net
if (uri=~"sip:\+[0-9]+@example\.net") {
    # (change example.net to your domainname or skip the stuff after the "@")
    if ( !enum_query("e164.arpa.") ) {

Another alternative that may be extended is as follows,

# is this an ENUM destination (leading +?)
if (method=="INVITE" && uri=~"sip:\+[0-9]+ at iptel\.org") {
        if (!enum_query("voice"))       # if parameter empty, it defaults to "e2u+sip"
           enum_query("");             # E2U+sip

Yet another alternative that can be tried / expanded is as follows,

if (is_from_user_enum()) {

[edit] See Also

Personal tools