Difference between revisions of "ENUM Query di OpenSER"
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 61: | Line 61: | ||
exit; | exit; | ||
} | } | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Alternatif lain, | ||
+ | |||
+ | |||
+ | # 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 "@") | ||
+ | strip(2); | ||
+ | # (adjust, if your international prefix is something else than "00") | ||
+ | prefix("+"); | ||
+ | }; | ||
+ | |||
+ | # 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.") ) { | ||
+ | enum_query("nrenum.net."); | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | |||
+ | |||
+ | |||
Revision as of 14:08, 12 March 2008
Untuk melakukan ENUM Query di OpenSER ada beberapa hal yang perlu dilakukan
- Siapkan modul ENUM di konfigurasi OpenSER.
- Buat table routing untuk ENUM di konfigurasi OpenSER
Siapkan Modul ENUM di konfigurasi OpenSER
Edit file konfigurasi OpenSER /etc/openser/openser.cfg
# vi /etc/openser/openser.cfg
Masukan beberapa perintah berikut
Load module ENUM
loadmodule "enum.so"
Pada saat ini proses searching ENUM di konfigurasi OpenSER default hanya men-cek sebuah domain ENUM saja.
Kita dapat menset domain tersebut menggunakan perintah berikut (misalnya kita menggunakan e164.id),
modparam("enum", "domain_suffix", "e164.id.") modparam("enum", "i_enum_suffix", "e164.id.")
Default domain yang di search adalah e164.arpa.
domain_suffix akan di tambahkan pada nomor ENUM jika belum ada domain suffix-nya pada saat pencarian ENUM menggunakan enum_query(). i_enum_suffix digunakan saat melalui pencarian menggunakan i_enum_query().
Table Routing ENUM di konfigurasi OpenSER
Salah satu alternatif yang mungkin bisa di kembangkan,
# 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 route(1); }
Cara yang agak aman untuk melakukan routing ENUM di OpenSER adalah sebagai berikut
if (is_from_user_enum()) { enum_query(); route(1); } route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); }; exit; }
Alternatif lain,
# 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 "@") strip(2); # (adjust, if your international prefix is something else than "00") prefix("+"); };
# 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.") ) { enum_query("nrenum.net."); }; };