<div dir="ltr">Hi Grant,<div><br></div><div>There is no integration with the dialog module directly - that is coming soon - but for now you can track call profiles across the cluster by doing something like:</div><div><br></div><div><div>loadmodule "dmq"</div><div>loadmodule "htable"</div></div><div>...<br></div><div><div>modparam("dmq", "server_address", "sip:MY_IP_ADDR:5080") # <--- make sure you listen on a separate, restricted port!<br></div><div>modparam("dmq", "notification_address", "sip:REMOTE_DMQ_ADDR:5080") # <--- we just need to tell DMQ about one other node - it will learn about any others itself</div></div><div>...</div><div><div>modparam("htable", "enable_dmq", 1)<br></div><div>modparam("htable", "htable", "call_profiles=>size=7;autoexpire=3600;dmqreplicate=1;")<br></div></div><div>...</div><div><br></div><div><div>route {</div><div><br></div><div>        if (method == "KDMQ" && $Rp == 5080) {</div><div>               dmq_handle_message();<br></div><div>               exit;<br></div><div>        }<br></div><div><br></div><div><div>        # handle requests within SIP dialogs</div><div>        route(WITHINDLG);</div></div><div>...<br></div></div><div>        # on INVITE, add the call to one or more "profiles"...<br></div><div>        $sht(call_profiles=>$ci) = "external:" + $fu; # you can append more if required (+ ",international:" + $fu + ",outgoing:" + $fu...)</div><div><br></div><div>        t_on_failure("FAILURE");</div><div>...<br></div><div><br></div><div>}</div><div><br></div><div>route[WITHINDLG] {</div><div><div>...</div><div>        if (is_method("BYE")) {</div><div>              $sht(call_profiles=>$ci) = $null;</div><div>        }</div></div><div>...</div><div>}<br></div><div><br></div><div>failure_route[FAILURE] {</div><div>...</div><div>        $sht(call_profiles=>$ci) = $null;<br></div><div>...</div><div>}<br></div><div><br></div><div><br></div><div>Now, any time you need to, you can get the current count of calls in any profile for any user by doing...<br></div><div><br></div><div>$var(count_external) = $shtcv(call_profiles=>external:$fu);</div><div>$var(count_outgoing) = $shtcv(call_profiles=>outgoing:$fu);</div><div><br></div><div>The above offers flexibility of adding calls to multiple profiles, but if that is beyond your requirements, you could equally just increment/decrement a counter for each user with:</div><div><br></div><div>$shtinc(call_count=>$fu)</div><div>$shtdec(call_count=>$fu)</div><div><br></div><div><br></div><div>I put this together quickly, so please excuse any typos or omissions, but it should hopefully be enough for illustration purposes.</div><div><br></div><div>Regards,</div><div><br></div><div>Charles</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 January 2015 at 07:05, Grant Bagdasarian <span dir="ltr"><<a href="mailto:gb@cm.nl" target="_blank">gb@cm.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hello Charles,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’ve looked at the htable and dmq modules, but I don’t understand how to integrate this with the dialog module.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Could you post an example please?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Grant<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<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""> sr-users [mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org" target="_blank">sr-users-bounces@lists.sip-router.org</a>]
<b>On Behalf Of </b>Charles Chance<br>
<b>Sent:</b> Friday, January 16, 2015 12:23 PM<br>
<b>To:</b> SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] dialog module shared memory<u></u><u></u></span></p><div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<p>Hello,<u></u><u></u></p>
<p>Currently, this is work in progress. But in the meantime, it is possible to achieve using htable with dmq enabled.<u></u><u></u></p>
<p>I can post an example later if required.<u></u><u></u></p>
<p>Cheers,<br>
Charles<u></u><u></u></p>
<div>
<p class="MsoNormal">On 16 Jan 2015 07:54, "Grant Bagdasarian" <<a href="mailto:gb@cm.nl" target="_blank">gb@cm.nl</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I’m using the dialog module to control the maximum number of calls allowed to be passed through.<u></u><u></u></p>
<p class="MsoNormal">Is it possible to share the dialogs stored in memory with multiple instances of kamailio?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">So if both kamailio instances process calls, and the maximum is set to a global of 10, both combined should never let more than 10 calls through.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Grant<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><u></u><u></u></p>
</div>
</div></div><p class="MsoNormal"><br><span>
<span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
<br>
Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">
@sipcentric</a><br>
<br>
<span style="color:gray">Sipcentric Ltd. Company registered in England & Wales no. 7365592.</span> <span style="color:gray">Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</span></span><u></u><u></u></span></p>
</div>
</div>

<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><div><br></div>
</div></div>

<br>
<font face="Helvetica, Arial, sans-serif"><font size="2"><span style="font-size:10pt"><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></span></font></font>