<html><head><base href="x-msg://2100/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Have you tried the dialplan module? &nbsp;We route TN's to various backend media servers based on a regexp match and then use the avp that you get upon a match from dp_translate to identify the media server to route to.<div><br></div><div>Then we can update the dialplan rules and use dp_reload without penalty to "activate" any changes.</div><div><br></div><div><font class="Apple-style-span" face="'Courier New'">modparam("dialplan", "attrs_pvar", "$avp(dest)")</font></div><div><font class="Apple-style-span" face="'Courier New'"><div>#Initial value for dialplan group</div><div>$avp(dpid)=0;</div></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">dp_translate("$avp(dpid)","$ruri.user/$ruri.user");</font></div><div><div><font class="Apple-style-span" face="'Courier New'">if ($avp(dest)==NULL) {</font></div><div><font class="Apple-style-span" face="'Courier New'">&nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "$ruri.user not found.");</font></div><div><font class="Apple-style-span" face="'Courier New'">&nbsp; &nbsp; &nbsp; &nbsp; sl_send_reply("404", "Not Found");</font></div><div><font class="Apple-style-span" face="'Courier New'">&nbsp; &nbsp; &nbsp; &nbsp; exit;</font></div><div><font class="Apple-style-span" face="'Courier New'">}</font></div><div><br></div><div>Then do_something based on &nbsp;$avp(dest) being set based on the match from dp_translate maybe even call your ds_select_dst based on $avp(dest) being one value or another (assuming you set the $avp(dest) to "MATCH" in your dialplan rules table:</div><div><br></div><div><font class="Apple-style-span" face="'Courier New'">if ($avp(dest)=="MATCH") {</font></div><div><font class="Apple-style-span" face="'Courier New'">&nbsp; &nbsp;&nbsp;<span class="Apple-style-span" style="font-size: 15px; ">ds_select_dst("2", "4");</span></font></div><div><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" face="'Courier New'">}</font></span></div><div><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" face="'Courier New'">else&nbsp;</font></span></div><div><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" face="'Courier New'">{</font></span></div><div><font class="Apple-style-span" face="'Courier New'">&nbsp; &nbsp;&nbsp;&nbsp;ds_select_dst("1", "4");</font></div><div><font class="Apple-style-span" face="'Courier New'">}</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div>Hope that helps . . .</div><div><br></div><div>Cheers,</div><div><br></div><div>JPS<br><div><div>On May 31, 2012, at 11:59 AM, Diego Barberio wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="ES-AR" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Hi All,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I’m using dispatcher module to forward incoming INVITEs to two destination groups.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I have a set of 8 telephone numbers, if the call goes or comes from any of that numbers I have to send the call to a group otherwise to the other. Right now I’m doing this to select the group:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">if($rU=~ '^*40109615*' || $rU=~ '^*40109541*' || $rU=~ '^*40285849*' || $rU=~ '^*40284592*' || $rU=~ '^*40117817*' || $rU=~ '^*40117830*' || $rU=~ '^*40489340*' || $rU=~ '^*40489455*' || $fU= ~ '^*40109615*' || $fU=~ '^*40109541*' || $fU=~ '^*40285849*' || $fU=~ '^*40284592*' || $fU=~ '^*40117817*' || $fU=~ '^*40117830*' || $fU=~ '^*40489340*' || $fU=~ '^*40489455*' ){<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 35.4pt; "><span lang="EN-US">ds_select_dst("2", "4");<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">}else{<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ds_select_dst("1", "4");<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">}<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Is there any better way to do this, I mean something like:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">if(is_in_file($fU, ‘numbers.txt’) || is_in_file($rU, ‘numbers.txt’))<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Of course any option will be welcome, however it would be very nice if there’s an option which allows me to modify the numbers list without restarting opensips.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Thanks a lot<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Diego<o:p></o:p></span></div></div><span>&lt;ATT00001.c&gt;</span></div></blockquote></div><br></div></div></body></html>