<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
I've found that the whole system works better when you don't use
failure_route() to do "time out" style voicemail. <br>
<br>
I have a test setup where I just add a call to Asterisk immediately if
the user is registered (has location entry) with a special prefix that
gets matched in the * extensions.conf file, and causes * to simply wait
for X seconds before answering. If the calee phone(s) is answered, SER
cancels the call to * and any other phones registered to the user. If
no phones are answered, * answers and sends the call to voicemail.<br>
<br>
For whatever reason, this approach seems more stable so far, and seems
more compatible with more phones, etc, than the failure_route
approach. For instance, if you have a locations entry that points a
user to another user, or more than one user (e.g. <a class="moz-txt-link-abbreviated" href="mailto:mainline@domain.com">mainline@domain.com</a>
-> <a class="moz-txt-link-abbreviated" href="mailto:receptionist@domain.com">receptionist@domain.com</a> ->
receptionist@<phone-IP:port>), SER seems to get confused and
sends a CANCEL to the voicemail system you've just triggered the INVITE
to in your failure_route. When doing it the other way, it doesn't seem
to have this problem. <br>
<br>
As for mapping user names to numeric extensions in Asterisk, I wrote an
AGI script which does this by reverse-mapping the username to aliases
in the SER script. It requires that your users have numerical
extensions assigned in the SER aliases database (e.g. 1234 ->
<a class="moz-txt-link-abbreviated" href="mailto:joe@domain.com">joe@domain.com</a>). If there are multiple #s mapped to the user, it just
returns the lowest one. Not sure if I can give this out though, since
I wrote it for a client.<br>
<br>
- Jim<br>
<br>
<br>
Alan Crosswell wrote:<br>
<blockquote type="cite" cite="mid3FE35868.3000504@columbia.edu">I'm
trying to do failure route to voicemail (which is working) but this
error is logged:
<br>
<br>
ERROR: t_should_relay: status rewrite by UAS: stored: 408, received:
487
<br>
<br>
I googled this and see that this came up last in October
(<a class="moz-txt-link-freetext" href="http://lists.iptel.org/pipermail/serusers/2003-October/002921.html">http://lists.iptel.org/pipermail/serusers/2003-October/002921.html</a>) but
I don't see any evidence of a solution in the thread.
<br>
<br>
I suspect mine is the same problem as I have two UAs registered so the
initial dset is two places and then the append_branch on timeout is
just the voicemail uri.
<br>
<br>
BTW, I am doing this with asterisk for the usual DTMF access reasons
(altough I haven't yet figured out how to map <a class="moz-txt-link-freetext" href="sip:alan@columbia.edu">sip:alan@columbia.edu</a> to
DTMF. Maybe I'll have to give up and do numeric mailboxes:-(
<br>
I am rewriting with a prefix of "vm*u" before punting over to asterisk
which has
<br>
exten => _vm*u.,1,Wait,1
<br>
exten => _vm*u.,2,Voicemail(${EXTEN:3}) <br>
exten => _vm*u.,3,Goto(#,1)
<br>
<br>
Any pointers would be appreciated. My not-yet-complete ser.cfg is
attached (not yet punting voicemail for unregistered subscribers; just
registered subscribers who time out the invite).
<br>
<br>
/a
<br>
<pre wrap="">
<hr width="90%" size="4">
#
# $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 andrei Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
debug=2 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no        # (cmd line: -E)
#listen=128.59.39.127
check_via=yes        # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
alias="columbia.edu"
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
loadmodule "/usr/lib/ser/modules/mysql.so"
loadmodule "/usr/lib/ser/modules/acc.so"
loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/registrar.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"
loadmodule "/usr/lib/ser/modules/exec.so"
# ----------------- setting module-specific parameters ---------------
# -- transaction timers --
modparam("tm", "fr_inv_timer", 15 )
modparam("tm", "fr_timer", 10 )
# -- usrloc params --
#
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "timer_interval", 10)
# -- auth params --
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# -- acc params --
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1 )
modparam("acc", "log_missed_flag", 2)
# ------------------------- request routing logic -------------------
# main routing logic
route{
/* ********* ROUTINE CHECKS ********************************** */
        # initial sanity checks -- messages with
        # max_forwards==0, or excessively long requests
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if (msg:len > max_len ) {
                sl_send_reply("513", "Message too big");
                break;
        };
        lookup("aliases");
        # we record-route all messages -- to make sure that
        # subsequent messages will go through our proxy; that's
        # particularly good if upstream and downstream entities
        # use different transport protocol
        record_route();        
        
        # loose-route processing
        if (loose_route()) {
                t_relay();
                break;
        };
        setflag(2);
        # if the request is for other domain use UsrLoc
        # (in case, it does not work, use the following command
        # with proper names and addresses in it)
        if (uri=~"^<a class="moz-txt-link-freetext" href="sip:(.+@">sip:(.+@</a>)?columbia.edu") {
                if (method=="REGISTER") {
                        log(1, "REGISTER received\n");
                        if (!www_authorize("columbia.edu", "subscriber")) {
                                www_challenge("columbia.edu", "0");
                                break;
                        };
                        save("location");
                        break;
                };
/* ********** Dial out to PSTN logic ************* */
# 5 Digit dialing, interior calls
if (uri=~"^<a class="moz-txt-link-freetext" href="sip:[1347">si<a class="moz-txt-link-rfc2396E" href="mailto:^sip:[1347][0-9]{4}@columbia\.edu">"^sip:[1347][0-9]{4}@columbia\.edu"</a>) {
rewritehostport("128.59.59.242:5060");
log(1,"5 digit expression match");
route(2);
break;
};
                # 10 Digit dialing with outlide line
                if (uri=~"^<a class="moz-txt-link-freetext" href="sip:931[0-9">si<a class="moz-txt-link-rfc2396E" href="mailto:^sip:931[0-9]{10}@columbia\.edu">"^sip:931[0-9]{10}@columbia\.edu"</a>) {
                 if(!(src_ip=="128.59.59.242")
                        & !(proxy_authorize("columbia.edu","subscriber"))) {
                        proxy_challenge("columbia.edu", "1");
                        break;
                } else {
rewritehostport("128.59.59.242:5060");
log(1," 93 Outside line with 10 digit expression match");
route(2);
break;
                };
};
/* voicemail access */
                if (uri=~"^<a class="moz-txt-link-freetext" href="sip:\*86@columbia\.edu">sip:\*86@columbia\.edu</a>"
                 |uri=~"^<a class="moz-txt-link-freetext" href="sip:vm@columbia\.edu">sip:vm@columbia\.edu</a>"
                 |uri=~"^<a class="moz-txt-link-freetext" href="sip:voicemail@columbia\.edu">sip:voicemail@columbia\.edu</a>") {
                        route(3);
                        break;
                };
                # native SIP destinations are handled using our USRLOC DB
                if (!lookup("location")) {
                        if (!exec_dset("/etc/ser/sipldap")) {
                                sl_send_reply("404", "Not Found");
                                break;
                        } else {
         log(1," sipldap call");
                        };
                }; #!lookup
        };
        if (method == "INVITE") {
         t_on_failure("1");
        };
        # forward to current uri now; use stateful forwarding; that
        # works reliably even if we forward from TCP to UDP
        if (!t_relay()) {
                sl_reply_error();
        };
        
}
route[2] {
log(1,"route[2]:SIP-to-PSTN call routed");
if (!t_relay()) {
sl_reply_error();
};
}
# ---- voicemail user access ----
route[3] {
        rewritehostport("127.0.0.1:5069");
        log(1,"voicemail access");
if (!t_relay()) {
sl_reply_error();
};
}
# ------------- handling of unregistered user ------------------
route[4] {
        log(1,"route[4]: user not registered");
# non-Voip -- just send "off-line"
if (!(method == "INVITE" || method == "ACK" || method == "CANCEL")) {
sl_send_reply("404", "Not Found");
break;
};
# not voicemail subscriber
# if (!isflagset(4)) {
# sl_send_reply("404", "Not Found and no voicemail turned on");
# break;
# };
# forward to voicemail now
        prefix("vm*u");
rewritehostport("127.0.0.1:5069");
t_relay_to_udp("127.0.0.1", "5069");
}
failure_route[1] {
        # transfer to asterisk voicemail with uMAILBOX for unavailable.
        # <a class="moz-txt-link-freetext" href="sip:USER@columbia.edu">sip:USER@columbia.edu</a> -> <a class="moz-txt-link-freetext" href="sip:vm*uUSER@127.0.0.1:5069">sip:vm*uUSER@127.0.0.1:5069</a>
t_on_failure("2");
        prefix("vm*u");
rewritehostport("127.0.0.1:5069");
        append_branch();
        log(1,"redirection to voicemail\n");
        t_relay();
}
failure_route[2] {
        # forwarding failed (voicemail down?)
        log(1,"voicemail failed\n");
        t_reply("500","Weasels have eaten voicemail again");
}
</pre>
<pre wrap="">
<hr width="90%" size="4">
_______________________________________________
Serusers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:serusers@lists.iptel.org">serusers@lists.iptel.org</a>
<a class="moz-txt-link-freetext" href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="78">--
+---------------------------------------------------------------------------+
| Jim Burwell - Sr. Systems/Network/Security Engineer, JSBC |
+---------------------------------------------------------------------------+
| "I never let my schooling get in the way of my education." - Mark Twain |
| "UNIX was never designed to keep people from doing stupid things, because |
| that policy would also keep them from doing clever things." - Doug Gwyn |
| "Cool is only three letters away from Fool" - Mike Muir, Suicyco |
| "..Government in its best state is but a necessary evil; in its worst |
| state an intolerable one.." - Thomas Paine, "Common Sense" (1776) |
+---------------------------------------------------------------------------+
| Email: <a class="moz-txt-link-abbreviated" href="mailto:jimb@jsbc.cc">jimb@jsbc.cc</a> ICQ UIN: 1695089 |
+---------------------------------------------------------------------------+
| Reply problems ? Turn off the "sign" function in email prog. Blame MS. |
+---------------------------------------------------------------------------+
</pre>
</body>
</html>