<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV><FONT size=2 face=Arial>Thanks for your reply, Daniel.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>The purpose is to do busy forwarding without
querying the client when the user already has >= X active calls. X will
normally be 1 (call waiting inactive) or 2 (call waiting active). Advanced users
may possibly set a higher value. Counting the number of calls on
the server and doing busy forwarding based on that rather than waiting for
a "486 Busy here" from the client has several advantages.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Currently, I've written code to do this with the
dispatcher module, and it's working great with only one server. Here's a code
snippet:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> $var(dlg_busy) =
0;<BR> get_profile_size("busy", "$avp(s:uid)",
"$var(dlg_busy)");<BR> if ( $var(dlg_busy) >=
$avp(s:busy_level) ) {<BR> if
($avp(s:cfb_status) == "on") {<BR>
$rU = $avp(s:cfb_number);</FONT></DIV>
<DIV><FONT size=2 face=Arial>
xlog("L_INFO", "-------------------- $avp(s:uid) has
$var(dlg_busy) active calls. Treshold $avp(s:busy_level). Forwarding on busy to
$rU --------------------\n");<BR>
route(10);</FONT></DIV>
<DIV><FONT size=2 face=Arial>
}</FONT></DIV>
<DIV><FONT size=2 face=Arial>
...</FONT></DIV>
<DIV><FONT size=2 face=Arial> }</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Based on your reply, I guess one way to solve this
would be to write the get_profile_size function in sqlops, query the two dialog
databases and add the numbers. This would still require the customer to change
their database design. Is there an easier or better way to do
this?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I also wote code to do busy forwarding if the
client replies with 486 (do not disturb activated), 603 (call rejected)
etc.</FONT></DIV>
<DIV><FONT size=2 face=Arial>This code works for normal busy forwarding if
Polycom is set to 1 call per line key (default is 8). We'll then have
to provision the $avp(s:busy_level) variable to the clients instead of
handling it server-side. If a user now wants to change the setting,
he'll have to reboot his phone after doing so. Changing the <FONT
face=Arial><FONT face=Arial>reg.x.callsPerLineKey</FONT></FONT> setting in
the phone also limits the number of outgoing calls the user can make. We'll also
have to make code for all the other hardphones the customer is planning to use
plus make guides on how to change the setting for all kinds of
softphones. We want to avoid all this.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>With kind regards,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Pan</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=miconda@gmail.com href="mailto:miconda@gmail.com">Daniel-Constantin
Mierla</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=pan@ibidium.no
href="mailto:pan@ibidium.no">Pan B. Christensen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A
title=sr-users@lists.sip-router.org
href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, December 13, 2010 12:26
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [SR-Users] Dialog module
with 2 servers and 2 separate databases.</DIV>
<DIV><BR></DIV><BR><BR>On 12/10/10 2:17 PM, Pan B. Christensen wrote:
<BLOCKQUOTE cite=mid:83EDE75437344FC18DB84EF19DA6032C@rtPC type="cite">
<META name=GENERATOR content="MSHTML 8.00.6001.18975">
<STYLE></STYLE>
<DIV><FONT size=2 face=Arial>Hello,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>My customer has the following database
design.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Voip server 1 talks to SQL server
1.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Voip server 2 talks to SQL server
2.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>Voip 1 and Voip 2 are
load-balanced.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>Each SQL server has two databases. Database
1 contains semi-static data like call forwarding properties for
users and is read-only. This is replicated from a third SQL server
which the web interface writes to. Database 2 is read/write, is not
replicated and contains data that is updated frequently like user
location and now dialog info.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>Voip server 1 is not allowed to talk to SQL
server 2 and vice versa.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>I'm using forward() to send authenticated
REGISTERs to the other server so that it'll write this to RAM and its
own SQL server. Thus, both servers are aware of clients
authenticated and registered by the other server.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>How can I make both servers be aware
of active calls on the other server?</FONT></DIV></BLOCKQUOTE>what is the
purpose?<BR><BR>Practically, it is not possible to track a call in two
instances, because, unlike registration where is just a storage of mappings
between contact and aor, call states of dialog module involve more processing
logic, including timeouts and sending BYEs.<BR><BR>Cheers,<BR>Daniel<BR><BR><PRE class=moz-signature cols="72">--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<A class=moz-txt-link-freetext href="http://www.asipto.com">http://www.asipto.com</A></PRE>
<P>
<HR>
<P></P><BR>No virus found in this incoming message.<BR>Checked by AVG -
www.avg.com <BR>Version: 8.5.449 / Virus Database: 271.1.1/3312 - Release
Date: 12/12/10 19:34:00<BR></BLOCKQUOTE></BODY></HTML>