I forgot to show failure_route[4]. Here it is:
failure_route[4] {
xlog("L_INFO","failure_route[4] $ci: method $rm r-uri
<$ru>\n");
if (t_check_status("(5..)|(6..)|(403)")) { # gateway failure/refusal
xlog("L_INFO","failure_route[4] gateway returned 5xx or 6xx.
Status: $r
s $rr\n");
if (!next_gw()) {
xlog("L_CRIT","No more gateways for <$tu>\n");
t_reply("503", "Service not available - No more
gateways");
return;
} else {
xlog("L_INFO","failure_route[4] next gw r-uri <$ru>
\n");
t_on_failure("4");
t_relay();
return;
}
}
xlog("L_INFO","failure_route[4]: relaying normal error\n");
t_relay();
}
See a recent post of mine when you wonder why the $rs and $rr print
NULL:-( But otherwise it works.
/a
Alan Crosswell wrote:
Use LCR module to list your gateway(s). Here's a
config fragment which
changes the domain in the r-uri to the IP address and port of the
gateway, stripping and/or prefixing digits as defined in the gateways
table. Use, for example, where your users dial 9 for an outside line
but your gateway just expects your national numbering plan. In this
example, strip 1 digit and prefix nothing. Another example might be
that your PSTN gateway is on a PBX that requires dialing 9 for an
outside line, so then you'd strip 0 and prefix "9".
if (!load_gws()) { # load LCR tables
xlog("L_CRIT","Can't load LCR tables\n");
sl_send_reply("500","Cannot load gateways");
return;
};
t_on_failure("4"); # if gateway unavail go to 4
if (!next_gw()) {
sl_send_reply("503", "Service not available - No gateways");
return;
};
if (!t_relay()) {
sl_reply_error();
};
See openserctl lcr commands to create routes, gateway groups and gateways.
jello% openserctl lcr show
lcr routes
+--------------+----------+--------+----------+
| prefix | from_uri | grp_id | priority |
+--------------+----------+--------+----------+
| +1__________ | % | 9 | 5 |
| +1__________ | % | 5 | 10 |
| +1__________ | % | 7 | 20 |
...
+--------------+----------+--------+----------+
lcr gateway groups
+--------+------------+
| grp_id | grp_name |
+--------+------------+
...
| 5 | qwest-us |
...
| 7 | voip1-us |
...
| 9 | paetec-us |
+--------+------------+
lcr gateways
+-------------+----------+------+------------+-----------+--------+-------+--------+
| gw_name | ip | port | uri_scheme | transport | grp_id |
strip | prefix |
+-------------+----------+------+------------+-----------+--------+-------+--------+
...
| qwest-us | 10.1.2.3 | 5060 | 1 | 1 | 5 |
2 | |
| voip1-us | 10.2.3.4 | 5060 | 1 | 1 | 8 | 2
| |
| paetec-us | 10.3.4.5 | 5060 | 1 | 1 | 9 | 1
| |
+-------------+----------+------+------------+-----------+--------+-------+--------+
Sorry about the attempt at editing the lcr_gateways table a little to
try and make it more legible -- basically I strip one or two digits
depending on carrier. Two of the above are ITSP's. The other is a
Cisco 3845 ISR connected to a PRI to our campus PBX. Basically the same
as an AS5300. IP addresses have been changed needless to say.
/a
geovani ferronetti wrote:
> Hi,
> I want to connect OpenSER with PSTN, as media gateway I use Cisco
> AS5300, vfc c542.
> I am interested about config part from OpenSER.
> Where I can get some documentation, information?
>
> Thx
>
> __________________________________________________
> Do You Yahoo!?
> Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da
> tanto spazio gratuito per i tuoi file e i messaggi
>
http://mail.yahoo.it
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users(a)openser.org
>
http://openser.org/cgi-bin/mailman/listinfo/users