<!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'm presently working up an Asterisk voice mail set up which runs in a
SER environment myself.<br>
<br>
One problem I ran into was that in the "typical" SER set up is that SER
calls Asterisk with a textual SIP URI in the form of
<a class="moz-txt-link-rfc2396E" href="sip:text_user_name@domain">"sip:text_user_name@domain"</a>, where Asterisk is really designed for
traditional numerical phone numbers.&nbsp; <br>
<br>
By "typical" SER set up, I mean one in which users are defined as
<a class="moz-txt-link-rfc2396E" href="sip:testname@domain">"sip:testname@domain"</a> and numerical phone numbers are simply SER
aliases which point to the textual SIP URIs.&nbsp; This is kind of nice
since a user is identified as a name instead of a number, and it can
match the users email address, etc.<br>
<br>
The problem with this sort of set up is that when you configure SER to
call Asterisk for voice mail, even if a numerical extension was dialed
for that user, SER translates it to the "name" form and uses it in the
INVITE message to Asterisk (even though it leaves the To: header as the
originally dialed numeric #).&nbsp; Asterisk's SIP module takes this INVITE
as the dialed extension, so you wind up with Asterisk searching for a
user name instead of a numeric extension.&nbsp; You CAN actually set up
textual extensions to match these types of calls, but that's kinda
"wrong" in Asterisk, and there's a possibility that the text user names
could collide with some of Asterisk's reserved text extensions.&nbsp; Also,
to do this you must then have an entry for every single user in
extensions.conf, and map them individually to numeric extensions.&nbsp; Not
very good.<br>
<br>
To solve this problem, I wound up using Asterisk's AGI interface to
write a Perl script which when all numeric matches fail, is called and
maps the SIP user name back into a numeric extension by calling the SER
aliases database.&nbsp; <br>
<br>
For example, user dials "5502" on his phone, SER translates this into
<a class="moz-txt-link-rfc2396E" href="sip:joeuser@somedomain.com">"sip:joeuser@somedomain.com"</a>, and procedes with the routing.&nbsp; Then,
when the user doesn't answer the phone (or there's no location info for
him), it gets routed to the Asterisk VM server.&nbsp; Asterisk then sees the
dialed extension as "joeuser" instead of the original "5502", and falls
through all the numerical extension matches to my AGI call in the
extensions file.&nbsp; This then looks up <a class="moz-txt-link-rfc2396E" href="sip:joeuser@somedomain.com">"sip:joeuser@somedomain.com"</a> in
the aliases table, and returns "5502" in a Asterisk variable using
AGI.&nbsp; Then the call can be properly routed to a voice mail box.&nbsp; Here's
what the actual extensions.conf rules look like:<br>
<blockquote><tt>exten =&gt;
_.,1,AGI(map-ser-aliases-contact-to-ast-extension.agi)<br>
exten =&gt; _.,2,GotoIf($[${rewriteext} = NOTFOUND]?3:4)<br>
exten =&gt; _.,3,Goto(vm-prompt,s,1)<br>
exten =&gt; _.,4,Voicemail(u${rewriteext})<br>
exten =&gt; _.,5,Wait(1)<br>
exten =&gt; _.,6,Hangup<br>
  </tt></blockquote>
<br>
If the extension is found, the variable is set to the numeric extension
(if there are more than one, it picks the lowest numerical extension
returned by the database).&nbsp; If no matching entry is found, or the entry
is textual, the variable is set to "NOTFOUND" and the extensions.conf
matching code can do the appropriate thing.<br>
<br>
This is working pretty good in my test environment, but I havn't put it
into actual production yet.<br>
<br>
I really wish Asterisk had a similar set up for the voicemail.conf
file.&nbsp; For now, I plan to write another Perl script which can generate
entries for this file by reading info from the SER database.<br>
<br>
Let me know if any of you guys have interest in this...<br>
<br>
- Jim<br>
<br>
<br>
Jesus Rodriguez wrote:<br>
<blockquote type="cite" cite="mid20031114170207.E28117@camel.jerocu.net">
  <pre wrap="">On Fri, 14 Nov 2003, Alessio Focardi wrote:

Hi Alessio,

  </pre>
  <blockquote type="cite">
    <pre wrap="">I imagined the redirection part just like you say, but from what I have understood about asterisk I will have to set up
an extension and a mailbox for every ser user. This looks "time consuming" :)
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Not really. You don't need an entry in extensions.conf for every mailbox/user.
You can use something like this:

[default]
;mapping from 34... to 93390...
exten =&gt; _34XXXXXXXX,1,Goto(9339059${EXTEN:8},1)

;voicemail extensions
exten =&gt; _9339059XX,1,Wait(2)
exten =&gt; _9339059XX,2,Voicemail2(u${EXTEN})


And then in voicemail.conf :

933905903 =&gt; 1003,User one, <a class="moz-txt-link-abbreviated" href="mailto:user1@voztele.com">user1@voztele.com</a>
933905904 =&gt; 1004,User two, <a class="moz-txt-link-abbreviated" href="mailto:user2@voztele.com">user2@voztele.com</a>
933905905 =&gt; 1005,User three, <a class="moz-txt-link-abbreviated" href="mailto:user3@voztele.com">user3@voztele.com</a>
933905906 =&gt; 1006,User four, <a class="moz-txt-link-abbreviated" href="mailto:user4@voztele.com">user4@voztele.com</a>


  </pre>
  <blockquote type="cite">
    <pre wrap="">Also: What about playback of recorded messages ?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Works ok, You can configure the codec/s you allow and the audio format of the
recorded message.


  </pre>
  <blockquote type="cite">
    <pre wrap="">If anyone has asterisk config files to share ... just to get an idea!
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Hope this helps.




  </pre>
  <blockquote type="cite">
    <pre wrap="">BAI&gt; Hi,

BAI&gt; I have some experience with setting ser to use Asterisk as voicemail
BAI&gt; system and it worked without any problem. What you have to do is to
BAI&gt; configure ser to redirect all call for unregistered or busy users to the
BAI&gt; address (IP:port) of your asterisk voicemail box. No special issues... :-)

BAI&gt; Bogdan

BAI&gt; Alessio Focardi wrote:

    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">HI,

is there anyone using Asterisk as voicemail backend for SER ?

I would like to know if this is possible and what can I expect from
this integration ...

Tnx !




        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">

--
Best regards,
 Alessio                            <a class="moz-txt-link-freetext" href="mailto:alessiof@interconnessioni.it">mailto:alessiof@interconnessioni.it</a>

_______________________________________________
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>
  <pre wrap=""><!---->

Saludos
JesusR.

-------------------------------
Jesus Rodriguez
VozTelecom Sistemas, S.L.
<a class="moz-txt-link-abbreviated" href="mailto:jesusr@voztele.com">jesusr@voztele.com</a>
<a class="moz-txt-link-freetext" href="http://www.voztele.com">http://www.voztele.com</a>
Tel. 902360305
-------------------------------

_______________________________________________
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>