<!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">
Well, in doing this I never had a problem with one SER handling normal
and voicemail calls.&nbsp; You just have to implement the proper logic.&nbsp;
Basically, the pseudo-code:<br>
<br>
<blockquote><tt>IF call is for ME (my SIP domain) THEN {<br>
&nbsp;&nbsp;&nbsp; IF callee is NOT online THEN {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IF callee is in voicemail group THEN {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </tt><tt>call VM system immediately with URI modified
signaling <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "answer immediately"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break<br>
  </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } ELSE (callee is NOT in voicemail group) {<br>
  </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 404 (user not found)</tt><tt><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; } ELSE (callee is online) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IF callee is in voicemail group THEN {<br>
  </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; append destination set including VM system with
URI <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modified signaling "wait before answering"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
  </tt><tt>&nbsp;&nbsp;&nbsp; }<br>
}<br>
  <br>
relay call to dest set<br>
  </tt><br>
</blockquote>
This approach has worked in all my testing.&nbsp; However, it may not be
ideal for reasons I mentioned before.<br>
<br>
What would be far nicer is having per branch or call timers one could
set in the SER script.&nbsp; But in all likelyhood the schizophrenia caused
by the conflict of the value proposition of SIP being 'light weight'
and 'stateless' conflicting with the reality of SIP requiring state to
give us basic real-world functionalities such as accounting and
timed-out voicemail will result in this not happening any time soon,
IMHO :-).<br>
<br>
- Jim<br>
<br>
<br>
<br>
Alan Crosswell wrote:<br>
<blockquote type="cite" cite="mid40182CC6.6060004@columbia.edu">Jim,
  <br>
  <br>
I've been catching up to where you have already been with respect to
failure route and the single global fr_inv_timer.&nbsp; It just doesn't work
if the same SER is fielding invites for those having voicemail and
those not.&nbsp; Before I go ahead and add a Wait 20 to my Asterisk
voicemail, I had one other idea I wanted to ask about:
  <br>
  <br>
What if I run two ser instances?&nbsp; The main one checks
is_user_in("Request-URI", "voicemail") and then punts any Invites for
that user to a second ser which implements the fr_inv_timer,
t_on_failure, etc. transfer to voicemail. Meanwhile all the
non-voicemail subscribers (including stuff sent to our PSTN gateway,
etc.) continues to chug along without the timer stuff happening.
  <br>
  <br>
Does this sound like a reasonable approach?
  <br>
  <br>
/a
  <br>
  <br>
  <br>
Jim Burwell wrote:
  <br>
  <blockquote type="cite">I've found that the whole system works better
when you don't use failure_route() to do "time out" style voicemail. <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.&nbsp; If the calee phone(s) is answered, SER
cancels the call to * and any other phones registered to the user.&nbsp; 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.&nbsp; 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>
-&gt; <a class="moz-txt-link-abbreviated" href="mailto:receptionist@domain.com">receptionist@domain.com</a> -&gt;
receptionist@&lt;phone-IP:port&gt;), SER seems to get confused and
sends a CANCEL to the voicemail system you've just triggered the INVITE
to in your failure_route.&nbsp; When doing it the other way, it doesn't seem
to have this problem. <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.&nbsp; It requires that your users have numerical
extensions assigned in the SER aliases database (e.g. 1234 -&gt;
<a class="moz-txt-link-abbreviated" href="mailto:joe@domain.com">joe@domain.com</a>).&nbsp; If there are multiple #s mapped to the user, it just
returns the lowest one.&nbsp; 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>
    <br>
    <blockquote type="cite">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.&nbsp; 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 =&gt; _vm*u.,1,Wait,1
      <br>
exten =&gt; _vm*u.,2,Voicemail(${EXTEN:3})&nbsp;&nbsp; exten =&gt;
_vm*u.,3,Goto(#,1)
      <br>
      <br>
Any pointers would be appreciated.&nbsp; 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>
      <br>
------------------------------------------------------------------------
      <br>
      <br>
#
      <br>
# $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 andrei Exp $
      <br>
#
      <br>
# simple quick-start config script
      <br>
#
      <br>
      <br>
# ----------- global configuration parameters ------------------------
      <br>
      <br>
debug=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # debug level (cmd line: -dddddddddd)
      <br>
fork=yes
      <br>
log_stderror=no&nbsp;&nbsp;&nbsp; # (cmd line: -E)
      <br>
#listen=128.59.39.127
      <br>
      <br>
check_via=yes&nbsp;&nbsp;&nbsp; # (cmd. line: -v)
      <br>
dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: -r)
      <br>
rev_dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: -R)
      <br>
port=5060
      <br>
children=4
      <br>
fifo="/tmp/ser_fifo"
      <br>
alias="columbia.edu"
      <br>
# ------------------ module loading ----------------------------------
      <br>
      <br>
# Uncomment this if you want to use SQL database
      <br>
loadmodule "/usr/lib/ser/modules/mysql.so"
      <br>
loadmodule "/usr/lib/ser/modules/acc.so"
      <br>
loadmodule "/usr/lib/ser/modules/sl.so"
      <br>
loadmodule "/usr/lib/ser/modules/tm.so"
      <br>
loadmodule "/usr/lib/ser/modules/rr.so"
      <br>
loadmodule "/usr/lib/ser/modules/maxfwd.so"
      <br>
loadmodule "/usr/lib/ser/modules/usrloc.so"
      <br>
loadmodule "/usr/lib/ser/modules/registrar.so"
      <br>
      <br>
# Uncomment this if you want digest authentication
      <br>
# mysql.so must be loaded !
      <br>
loadmodule "/usr/lib/ser/modules/auth.so"
      <br>
loadmodule "/usr/lib/ser/modules/auth_db.so"
      <br>
      <br>
loadmodule "/usr/lib/ser/modules/exec.so"
      <br>
      <br>
# ----------------- setting module-specific parameters ---------------
      <br>
# -- transaction timers --
      <br>
modparam("tm", "fr_inv_timer", 15 )
      <br>
modparam("tm", "fr_timer", 10 )
      <br>
      <br>
# -- usrloc params --
      <br>
#
      <br>
modparam("usrloc", "db_mode", 2)
      <br>
modparam("usrloc", "timer_interval", 10)
      <br>
      <br>
# -- auth params --
      <br>
modparam("auth_db", "calculate_ha1", yes)
      <br>
modparam("auth_db", "password_column", "password")
      <br>
      <br>
# -- rr params --
      <br>
# add value to ;lr param to make some broken UAs happy
      <br>
modparam("rr", "enable_full_lr", 1)
      <br>
      <br>
# -- acc params --
      <br>
modparam("acc", "log_level", 1)
      <br>
modparam("acc", "log_flag", 1 )
      <br>
modparam("acc", "log_missed_flag", 2)
      <br>
# -------------------------&nbsp; request routing logic -------------------
      <br>
      <br>
# main routing logic
      <br>
      <br>
route{
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* ********* ROUTINE CHECKS&nbsp; **********************************
*/
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# initial sanity checks -- messages with
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# max_forwards==0, or excessively long requests
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;if (!mf_process_maxfwd_header("10")) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("483","Too Many Hops");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;};
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;if (msg:len &gt; max_len ) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("513", "Message too big");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;};
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;lookup("aliases");
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# we record-route all messages -- to make sure that
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# subsequent messages will go through our proxy; that's
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# particularly good if upstream and downstream entities
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# use different transport protocol
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;record_route();&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# loose-route processing
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;if (loose_route()) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay();
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;};
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;setflag(2);
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# if the request is for other domain use UsrLoc
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# (in case, it does not work, use the following command
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# with proper names and addresses in it)
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;if (uri=~"^<a class="moz-txt-link-freetext" href="sip:(.+@">sip:(.+@</a>)?columbia.edu") {
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method=="REGISTER") {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1, "REGISTER received\n");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!www_authorize("columbia.edu", "subscriber")) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; www_challenge("columbia.edu", "0");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save("location");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }; <br>
      <br>
/* ********** Dial out to PSTN logic ************* */ <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 5 Digit dialing, interior calls
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (uri=~"^si"^<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>) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewritehostport("128.59.59.242:5060");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1,"5 digit expression match");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(2);
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 10 Digit dialing with outlide line
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (uri=~"^si"^<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>) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!(src_ip=="128.59.59.242") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;
!(proxy_authorize("columbia.edu","subscriber"))) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge("columbia.edu", "1");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewritehostport("128.59.59.242:5060");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1," 93 Outside line with 10 digit expression
match");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(2);
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
      <br>
/* voicemail access */
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (uri=~"^<a class="moz-txt-link-freetext" href="sip:\*86@columbia\.edu">sip:\*86@columbia\.edu</a>" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|uri=~"^<a class="moz-txt-link-freetext" href="sip:vm@columbia\.edu">sip:vm@columbia\.edu</a>" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|uri=~"^<a class="moz-txt-link-freetext" href="sip:voicemail@columbia\.edu">sip:voicemail@columbia\.edu</a>") {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(3);
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # native SIP destinations are handled using our USRLOC DB
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!lookup("location")) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!exec_dset("/etc/ser/sipldap")) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("404", "Not Found");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1," sipldap call");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }; #!lookup
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;}; <br>
&nbsp;&nbsp;&nbsp;&nbsp;if (method == "INVITE") {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_on_failure("1");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;};
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# forward to current uri now; use stateful forwarding; that
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# works reliably even if we forward from TCP to UDP
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;if (!t_relay()) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;}; &nbsp;&nbsp;&nbsp;&nbsp;
      <br>
}
      <br>
      <br>
route[2] {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1,"route[2]:SIP-to-PSTN call routed");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!t_relay()) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
}
      <br>
# ---- voicemail user access ----
      <br>
route[3] {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;rewritehostport("127.0.0.1:5069");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;log(1,"voicemail access");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!t_relay()) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
}
      <br>
# ------------- handling of unregistered user ------------------
      <br>
route[4] {
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;log(1,"route[4]: user not registered");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # non-Voip -- just send "off-line"
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(method == "INVITE" || method == "ACK" || method ==
"CANCEL")) {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("404", "Not Found");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # not voicemail subscriber
      <br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!isflagset(4)) { #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("404",
"Not Found and no voicemail turned on");
      <br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
      <br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
      <br>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # forward to voicemail now
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;prefix("vm*u");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewritehostport("127.0.0.1:5069");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay_to_udp("127.0.0.1", "5069");
      <br>
}
      <br>
failure_route[1] {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# transfer to asterisk voicemail with uMAILBOX for unavailable.
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# <a class="moz-txt-link-freetext" href="sip:USER@columbia.edu">sip:USER@columbia.edu</a> -&gt; <a class="moz-txt-link-freetext" href="sip:vm*uUSER@127.0.0.1:5069">sip:vm*uUSER@127.0.0.1:5069</a>
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_on_failure("2");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;prefix("vm*u");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewritehostport("127.0.0.1:5069");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;append_branch();
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;log(1,"redirection to voicemail\n");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;t_relay();
      <br>
}
      <br>
      <br>
failure_route[2] {
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;# forwarding failed (voicemail down?)
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;log(1,"voicemail failed\n");
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;t_reply("500","Weasels have eaten voicemail again");
      <br>
}
      <br>
      <br>
      <br>
&nbsp;
      <br>
      <br>
------------------------------------------------------------------------
      <br>
      <br>
_______________________________________________
      <br>
Serusers mailing list
      <br>
<a class="moz-txt-link-abbreviated" href="mailto:serusers@lists.iptel.org">serusers@lists.iptel.org</a>
      <br>
<a class="moz-txt-link-freetext" href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers</a>
      <br>
&nbsp;
      <br>
      <br>
    </blockquote>
    <br>
--&nbsp;<br>
+---------------------------------------------------------------------------+
    <br>
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jim Burwell - Sr. Systems/Network/Security Engineer,
JSBC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
    <br>
+---------------------------------------------------------------------------+
    <br>
| "I never let my schooling get in the way of my education." - Mark
Twain&nbsp;&nbsp; |
    <br>
| "UNIX was never designed to keep people from doing stupid things,
because |
    <br>
|&nbsp; that policy would also keep them from doing clever things." - Doug
Gwyn&nbsp; |
    <br>
| "Cool is only three letters away from Fool" - Mike Muir,
Suicyco&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
    <br>
| "..Government in its best state is but a necessary evil; in its
worst&nbsp;&nbsp;&nbsp;&nbsp; |
    <br>
|&nbsp; state an intolerable one.." - Thomas Paine, "Common Sense"
(1776)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
    <br>
+---------------------------------------------------------------------------+
    <br>
|&nbsp;&nbsp; Email:&nbsp; <a class="moz-txt-link-abbreviated" href="mailto:jimb@jsbc.cc">jimb@jsbc.cc</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ICQ UIN:&nbsp;
1695089&nbsp;&nbsp;&nbsp;&nbsp; |
    <br>
+---------------------------------------------------------------------------+
    <br>
|&nbsp; Reply problems ?&nbsp; Turn off the "sign" function in email prog.&nbsp; Blame
MS. |
    <br>
+---------------------------------------------------------------------------+
    <br>
    <br>
  </blockquote>
</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>