<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:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[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 lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='color:black'>Thanks Henning,<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:black'>I currently use the dispatch
module with 302 redirection to load balance A2Billing servers.&nbsp; If I use
either cr or dispatcher with ds_select_dst to load balance, the problem I have
is that when the SIP request is forwarder to A2Billing, it appears to be coming
from the same source ip address.&nbsp; This is a problem when I am wholesaling
IP to multiple carriers, since each carrier has its own source ip
address.&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:black'>With 302 it works perfect since
the connection information is sent in the contact field, the carrier&#8217;s
gateway just reissue a re-invite to the designated asterisk/a2billing server to
credit and route the call.&nbsp; The call is then forwarded to a cr server who
forwards it to a local gateway or to a 3<sup>rd</sup> party carrier.&nbsp; The
problem is that most carriers are not supporting 302 redirection.<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:black'>&lt;voip whsl&gt;-------&lt;dispatcher&gt;-------&lt;a2billing/asterisk&gt;-----&lt;carrierroute&gt;-------&lt;dst
carrier&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:black'>Any suggestions please? How
can&nbsp; I make ds_select_dst work on this scenario?<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:black'>Carlos<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Henning Westerholt
[mailto:henning.westerholt@1und1.de] <br>
<b>Sent:</b> Monday, July 13, 2009 10:22 AM<br>
<b>To:</b> users@lists.kamailio.org<br>
<b>Cc:</b> Carlos A. Alvarez<br>
<b>Subject:</b> Re: [Kamailio-Users] OpenSer/Kamailio and A2Billing<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console"'>On
Donnerstag, 9. Juli 2009, Carlos A. Alvarez wrote:<br>
&gt; I am trying to set up an application, where I use Kamailio, asterisk, and<br>
&gt; A2Billing to process pre paid calling cards, and wholesale voip. I already<br>
&gt; have setup a kamailio service using carrier route and a2billing as a<br>
&gt; preprocessor. It works beautiful, Great work guys!!!!<br>
<br>
<o:p></o:p></span></p>

<p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt;
font-family:"Lucida Console"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console"'>Hello
Carlos,<br>
<br>
<o:p></o:p></span></p>

<p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt;
font-family:"Lucida Console"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console"'>&gt;
The questions I have are around the design for resiliency and redundancy. <br>
&gt; I will like to use another instance of kamailio for a dispatcher function<br>
&gt; to load balance between asterisk servers, since the is a limitation and<br>
&gt; performance issues with asterisk. Now I have done some research and some<br>
&gt; testing and they only way I know I can make it work is by using 302<br>
&gt; redirection to redirect the invites from my customers to the corresponding<br>
&gt; asterisk server. If I use a direct setup using ds_select_dst asterisk gets<br>
&gt; all &quot;confused&quot; since the request appears to come from the
dispatcher ip<br>
&gt; address. For wholesale ip, I filter a2billing on ip address and not<br>
&gt; username. <br>
<br>
<o:p></o:p></span></p>

<p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt;
font-family:"Lucida Console"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console"'>Hm,
the usage of 302 redirection to just load-balance your asterisk servers is IMHO
a bit complicated. Normally you should be able to just use dispatcher or
similar modules (like cr in cfg file mode) for this purpose. If you only need
the incoming IP address for billing purposes perhaps you could store this in a
custom SIP header and evaluate this later on the asterisk? <br>
<br>
<o:p></o:p></span></p>

<p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt;
font-family:"Lucida Console"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Lucida Console"'>Henning<o:p></o:p></span></p>

</div>

</body>

</html>