<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="cid:filelist.xml@01C556CB.2C3B97E0">
<link rel=Edit-Time-Data href="cid:editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:UseWord2002TableStyleRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;
        text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;
        text-underline:single;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal;
        mso-style-noshow:yes;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        mso-style-noshow:yes;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:navy;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        mso-style-noshow:yes;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:navy;}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:35.4pt;
        mso-footer-margin:35.4pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */ 
 table.MsoNormalTable
        {mso-style-name:"Table Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:36.0pt'>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Greger<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thank you for the information I have found
it just what I needed.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Calls To SER from Asterisk:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>To add to trusted in MYSQL I would use
this right:<o:p></o:p></span></font></p>

<pre><i><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>INSERT INTO trusted SET src_ip='***.***.***.***',proto='any',from_pattern='sip:[0-9]*@***.***.***.***'; #replace *** with the asterisk ip address<o:p></o:p></span></font></i></pre>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>With this in my ser.cfg:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<pre><i><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-style:italic'>modparam(&quot;permissions&quot;, &quot;db_url&quot;, &quot;<a
href="mysql://ser:heslo@localhost/ser%22">mysql://ser:heslo@localhost/ser&quot;</a>)<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>modparam(&quot;permissions&quot;, &quot;db_mode&quot;, 1)<o:p></o:p></span></font></i></pre>

<p class=MsoNormal><i><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-style:italic'>modparam(&quot;permissions&quot;,
&quot;trusted_table&quot;, &quot;trusted&quot;)</span></font></i><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>and for routing to Asterisk From SER:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt;mso-bidi-font-weight:bold'>if (method == &quot;INVITE&quot; &amp;&amp;
(uri=~&quot;^sip:0&quot;)){<br>
rewritehostport (&quot;***</span></font><font face=Arial><span
style='font-family:Arial;mso-bidi-font-weight:bold'>.***.***.***</span></font><span
style='mso-bidi-font-weight:bold'>:5060&quot;);<br>
t_relay();<br>
break();<br>
};</span><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Or do I just add:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Asterisk to the trusted table and the
following near the <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>if(</span></font></span>!<span class=SpellE>allow_trusted</span>)<font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>if</span></font></span> (!<span class=SpellE>proxy_authorize</span>(&quot;&quot;,&quot;subscriber&quot;))
{<br>
<span class=SpellE>proxy_<span class=GramE>challenge</span></span><span
class=GramE>(</span>&quot;&quot;,&quot;0&quot;);<br>
<span class=GramE>break</span>;<br>
} else if (<span class=GramE>!<span class=SpellE>check</span></span><span
class=SpellE>_from</span>()) {<br>
<span class=SpellE>sl_send_<span class=GramE>reply</span></span><span
class=GramE>(</span>&quot;403&quot;, &quot;Use From=ID&quot;);<br>
<span class=GramE>break</span>;<br style='mso-special-character:line-break'>
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
<![endif]><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thank you very much for your help<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cheers<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Greg<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Greger V. Teigre
[mailto:greger@teigre.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, 11 May 2005 6:20
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Mr <st1:PersonName w:st="on">Greg
 Plater</st1:PersonName>; <st1:PersonName w:st="on">serusers@lists.iptel.org</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Serusers] Ser
Accepting Calls From Asterisk</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Greg,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Basically, you can do four&nbsp;things (first two for dialing
asterisk-ser, the next two for dialing ser-asterisk):<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>1.&nbsp;Accept INVITEs from a specific src ip (asterisk) and add
if(src_ip != asterisk_ip) around the INVITE authentication to avoid that part
being triggered<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>2.&nbsp;Or you accomplish the same thing be adding asterisk to the
trusted table and us if(!allow_trusted) instead. This will give you more
control as you can filter on ruri as well.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>3.&nbsp;You can create an account in asterisk and have asterisk
register with SER like a regular user (who will be available in location for
dialling into asterisk). This only makes sense if you have one main number for
all users registered on asterisk (you don't need 1 or 2 if you do this)<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>4. Use some kind of routing, either through manual configuration (uri=~&quot;some
pattern&quot;, then forward to asterisk) or use the LCR (least cost routing)
module to look up the ruris and forward to asterisk. This must be done in
combination with 1 or 2.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hope this helps.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>g-)<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>---- Original Message ----<br>
From: Mr <st1:PersonName w:st="on">Greg Plater</st1:PersonName><br>
To: <st1:PersonName w:st="on">serusers@lists.iptel.org</st1:PersonName><br>
Sent: Wednesday, May 11, 2005 06:10 AM<br>
Subject: [Serusers] Ser Accepting Calls From Asterisk<br>
<br>
&gt; Hi<br>
&gt; <br>
&gt; I am using the onsip getting started doc with mediaproxy.<br>
&gt; <br>
&gt; Calls for registered users on SER work great but when I try to call a<br>
&gt; registered ser user from my asterisk box. <br>
&gt; I get a response in Asterisk Debug. Says&nbsp; &#8220;failed to auth on
INVITE&#8221;<br>
&gt; <br>
&gt; If I wish to allow calls from my asterisk box to registered users on<br>
&gt; SER what do I change. <br>
&gt; <br>
&gt; <br>
&gt; IN SER.cfg I note these 2 snippets<br>
&gt; <br>
&gt; <br>
&gt; if (!www_authorize(&quot;&quot;,&quot;subscriber&quot;)) {<br>
&gt; www_challenge(&quot;&quot;,&quot;0&quot;);<br>
&gt; break;<br>
&gt; };<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; if (!proxy_authorize(&quot;&quot;,&quot;subscriber&quot;)) {<br>
&gt; proxy_challenge(&quot;&quot;,&quot;0&quot;);<br>
&gt; break;<br>
&gt; } else if (!check_from()) {<br>
&gt; sl_send_reply(&quot;403&quot;, &quot;Use From=ID&quot;);<br>
&gt; break;<br>
&gt; };<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; Serusers mailing list<br>
&gt; serusers@lists.iptel.org<br>
&gt; http://lists.iptel.org/mailman/listinfo/serusers<o:p></o:p></span></font></p>

</div>

</div>

</body>

</html>