whats the error, use ngrep to see what the error is, also after
rewritehost why not t_relay there instead of going back to route 1
Iqbal
On 7/13/2005, "Yiannis Martis" <yiannismarios(a)hotmail.com> wrote:
<html><div
style='background-color:'><DIV class=RTE>Hello Jiri,</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>I use SER 0.9.3 (at least I try to...) with mysql accounting
enabled.</DIV>
<DIV class=RTE>I've been trying to send some test calls to a gateway in Canada
but I fail to do so</DIV>
<DIV class=RTE>I use the example ser.cfg (pstn.cfg) included in ser
0.9.3.</DIV>
<DIV class=RTE>Can anyone please help me?</DIV>
<DIV class=RTE>Here is my ser.cfg</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE><FONT size=2>
<P>debug=3</P>
<P>fork=yes</P>
<P>log_stderror=no</P>
<P>listen=XX.XX.XX.XX # INSERT YOUR IP ADDRESS HERE</P>
<P>alias=as00.XXXXXXXXXXX.com</P>
<P>alias=XX.XX.XX.XX</P>
<P>alias=XXXXXXXXXXX.com</P>
<P>alias=www.XXXXXXXXXXX.com</P>
<P>port=5060</P>
<P>children=6</P>
<P>dns=no</P>
<P>rev_dns=no</P>
<P>fifo="/tmp/ser_fifo"</P>
<P>fifo_mode=0666</P>
<P>fifo_db_url="mysql://ser:Bj3Kn7g8f19Hdv6@localhost/ser"</P>
<P>loadmodule "/usr/local/lib/ser/modules/mysql.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/sl.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/tm.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/acc.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/rr.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/maxfwd.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/usrloc.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/registrar.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/auth.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/auth_db.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/uri.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/uri_db.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/nathelper.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/textops.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/avpops.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/domain.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/permissions.so"</P>
<P>modparam("auth_db|permissions|uri_db|usrloc", </P>
<P>"db_url", "mysql://ser:heslo@localhost/ser")</P>
<P>modparam("auth_db", "calculate_ha1", 1)</P>
<P>modparam("auth_db", "password_column",
"password")</P>
<P># -------------- accounting params ----------------</P>
<P>modparam("acc", "log_missed_flag", 2)</P>
<P>modparam("acc", "log_level", 1)</P>
<P>modparam("acc", "log_flag", 2)</P>
<P>modparam("acc", "db_url",
"mysql://ser:heslo@localhost/ser")</P>
<P>modparam("acc", "db_flag", 1)</P>
<P>modparam("acc", "failed_transactions", 1)</P>
<P>modparam("acc", "db_missed_flag", 2)</P>
<P>modparam("nathelper", "rtpproxy_disable", 1)</P>
<P>modparam("nathelper", "natping_interval", 0)</P>
<P>modparam("mediaproxy","natping_interval", 30)</P>
<P>modparam("mediaproxy","mediaproxy_socket",
"/var/run/mediaproxy.sock")</P>
<P>modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/ser/sip-clients")</P>
<P>modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-clients")</P>
<P>modparam("usrloc", "db_mode", 2)</P>
<P>modparam("usrloc", "db_url",
"mysql://ser:heslo@localhost/ser")</P>
<P>modparam("registrar", "nat_flag", 6)</P>
<P>modparam("rr", "enable_full_lr", 1)</P>
<P>modparam("tm", "fr_inv_timer", 27)</P>
<P>modparam("tm", "fr_inv_timer_avp",
"inv_timeout")</P>
<P>modparam("permissions", "db_mode", 1)</P>
<P>modparam("permissions", "trusted_table",
"trusted")</P>
<P> </P>
<P>route {</P>
<P># -----------------------------------------------------------------</P>
<P># Sanity Check Section</P>
<P># -----------------------------------------------------------------</P>
<P>if (!mf_process_maxfwd_header("10")) {</P>
<P>sl_send_reply("483", "Too Many Hops");</P>
<P>break;</P>
<P>};</P>
<P>if (msg:len > max_len) {</P>
<P>sl_send_reply("513", "Message Overflow");</P>
<P>break;</P>
<P>};</P>
<P># -----------------------------------------------------------------</P>
<P># Record Route Section</P>
<P># -----------------------------------------------------------------</P>
<P>if (method=="INVITE" && client_nat_test("3"))
{</P>
<P># INSERT YOUR IP ADDRESS HERE</P>
<P>record_route_preset("XX.XX.XX.XX:5060;nat=yes");</P>
<P>} else if (method!="REGISTER") { </P>
<P>record_route(); </P>
<P>};</P>
<P># -----------------------------------------------------------------</P>
<P># Call Tear Down Section</P>
<P># -----------------------------------------------------------------</P>
<P>if (method=="BYE" || method=="CANCEL") {</P>
<P>end_media_session();</P>
<P>};</P>
<P># -----------------------------------------------------------------</P>
<P># Loose Route Section</P>
<P># -----------------------------------------------------------------</P>
<P>if (loose_route()) {</P>
<P>if (has_totag() && (method=="INVITE" ||
method=="ACK")) {</P>
<P>if
(client_nat_test("3")||search("^Route:.*;nat=yes")){</P>
<P>setflag(6);</P>
<P>use_media_proxy();</P>
<P>};</P>
<P>};</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P># -----------------------------------------------------------------</P>
<P># Call Type Processing Section</P>
<P># -----------------------------------------------------------------</P>
<P>if (uri!=myself) {</P>
<P>route(5);</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P>if (uri==myself) {</P>
<P>if (method=="ACK") {</P>
<P>route(6);</P>
<P>break;</P>
<P>} else if (method=="CANCEL") {</P>
<P>route(3);</P>
<P>break;</P>
<P>} else if (method=="INVITE") {</P>
<P>route(3);</P>
<P>break;</P>
<P>} else if (method=="REGISTER") {</P>
<P>route(2);</P>
<P>break;</P>
<P>};</P>
<P>lookup("aliases");</P>
<P>if (uri!=myself) {</P>
<P>route(5);</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P>if (!lookup("location")) {</P>
<P>sl_send_reply("404", "User Not Found");</P>
<P>break;</P>
<P>};</P>
<P>};</P>
<P>route(1);</P>
<P>}</P>
<P>route[1] {</P>
<P># -----------------------------------------------------------------</P>
<P># Default Message Handler</P>
<P># -----------------------------------------------------------------</P>
<P>t_on_reply("1");</P>
<P>if (!t_relay()) {</P>
<P>if (method=="INVITE" || method=="ACK") {</P>
<P>end_media_session();</P>
<P>};</P>
<P>sl_reply_error();</P>
<P>};</P>
<P>}</P>
<P>route[2] {</P>
<P># -----------------------------------------------------------------</P>
<P># REGISTER Message Handler</P>
<P># -----------------------------------------------------------------</P>
<P>sl_send_reply("100", "Trying");</P>
<P>if (!search("^Contact:\ +\*") &&
client_nat_test("7")) {</P>
<P>setflag(6);</P>
<P>fix_nated_register();</P>
<P>force_rport();</P>
<P>};</P>
<P>if (!www_authorize("XXXXXXXXXXX.com","subscriber"))
{</P>
<P>www_challenge("XXXXXXXXXXX.com","0");</P>
<P>break;</P>
<P>};</P>
<P>if (!check_to()) {</P>
<P>sl_send_reply("401", "Unauthorized");</P>
<P>break;</P>
<P>};</P>
<P>consume_credentials();</P>
<P>if (!save("location")) {</P>
<P>sl_reply_error();</P>
<P>};</P>
<P>}</P>
<P>route[3] {</P>
<P># -----------------------------------------------------------------</P>
<P># CANCEL and INVITE Message Handler</P>
<P># -----------------------------------------------------------------</P>
<P>if (client_nat_test("3")) {</P>
<P>setflag(7);</P>
<P>force_rport();</P>
<P>fix_nated_contact();</P>
<P>};</P>
<P>if (method=="INVITE" && !allow_trusted()) {</P>
<P>if (!proxy_authorize("XXXXXXXXXXX.com","subscriber"))
{</P>
<P>proxy_challenge("XXXXXXXXXXX.com","0");</P>
<P>break;</P>
<P>} else if (!check_from()) {</P>
<P>sl_send_reply("403", "Use From=ID");</P>
<P>break;</P>
<P>};</P>
<P>consume_credentials();</P>
<P>};</P>
<P>lookup("aliases");</P>
<P>if (uri!=myself) {</P>
<P>route(5);</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P>if (uri=~"^sip:[0-9]*@") { # International PSTN</P>
<P>route(4);</P>
<P>break;</P>
<P>};</P>
<P>/*if (!lookup("location")) {</P>
<P>if (uri=~"^sip:00302810[0-9]{10}@") { # Domestic PSTN</P>
<P>route(4);</P>
<P>break;</P>
<P>};</P>
<P>sl_send_reply("404", "User Not Found");</P>
<P>break;</P>
<P>};*/</P>
<P>if (method=="CANCEL") {</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P>route(5);</P>
<P>route(1);</P>
<P>}</P>
<P>route[4] {</P>
<P># -----------------------------------------------------------------</P>
<P># PSTN Handler</P>
<P># -----------------------------------------------------------------</P>
<P>rewritehost("209.250.152.170:5060"); # INSERT YOUR PSTN GATEWAY IP
ADDRESS</P>
<P>avp_write("i:45", "inv_timeout");</P>
<P>route(5);</P>
<P>route(1);</P>
<P>}</P>
<P>route[5] {</P>
<P># -----------------------------------------------------------------</P>
<P># RTP Proxy Enabler</P>
<P># -----------------------------------------------------------------</P>
<P>if (isflagset(6) || isflagset(7)) {</P>
<P>use_media_proxy();</P>
<P>};</P>
<P>}</P>
<P>route[6] {</P>
<P>#
------------------------------------------------------------------------</P>
<P># ACK Handler</P>
<P>#
------------------------------------------------------------------------</P>
<P>#
------------------------------------------------------------------------</P>
<P># Aliases Section</P>
<P>#
------------------------------------------------------------------------</P>
<P>lookup("aliases");</P>
<P>if (uri!=myself) {</P>
<P>route(5);</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P>lookup("location");</P>
<P>route(1);</P>
<P>}</P>
<P> </P>
<P>onreply_route[1] {</P>
<P>if ((isflagset(6) || isflagset(7)) && </P>
<P>(status=~"(180)|(183)|2[0-9][0-9]")) {</P>
<P>if (!search("^Content-Length:\ +0")) {</P>
<P>use_media_proxy();</P>
<P>};</P>
<P>};</P>
<P>if (client_nat_test("1")) {</P>
<P>fix_nated_contact();</P>
<P>};</P>
<P>}</P></FONT></DIV></div><br
clear=all><hr>Don't just search. Find. <a
href="http://g.msn.com/8HMBEN/2746??PS=47575" target="_top">MSN
Search</a> Check out the new MSN Search!</html>