<div dir="ltr"><div>Hi everyone,</div><div>Let's say i want to add additional attribute in every dispatcher database entry in form of:</div><div><b>Example:</b><br></div><div>extension_set=100-199;branch=NewYork</div><div><br></div><div>Let's say also i have more than one entry in dispatcher database with these attributes and same priority.</div><div><br></div><div><b>EX:</b></div><div>IP=192.168.1.1;priority=1;attr=extension_set=100-199;branch=NewYork;Descrioption=PBX Production</div><div>IP=192.168.1.2;priority=1;attr=extension_set=100-199;branch=NewYork;Descrioption=PBX Backup</div><div><br></div><div>What i want to achieve is to select multiple destination with ds_select and algorithm 8(priority) based on dialed extension.</div><div>I can get attributes with: $(xavp(_dsdst_=>attrs) but, off course, this may be possible only after destination selection has been made by dispatcher.</div><div><br></div><div>Currently i've create a switch statement in order set statically a variable with the right priority like:</div><div># dial number selection<br>Â Â Â Â switch($rU) {<br>Â Â Â Â Â Â Â Â case /"^[1][0-9][0-9]$":<br>Â Â Â Â Â Â Â Â Â Â Â Â # starting with 1XX<br>Â Â Â Â Â Â Â Â Â Â Â Â Â xlog("L_NOTICE","THE DIALED NUMBER IS: $rU ... Searching for available destinations!!!\n");<br>Â Â Â Â Â Â Â Â Â Â Â Â $var(ds_priority) = 1;<br><br>Â Â Â Â Â Â Â Â break;<br>Â Â Â Â Â Â Â Â default:<br>Â Â Â Â Â Â Â Â Â Â Â Â exit;<br>Â Â Â Â }</div><div>ds_select_dst($var(ds_priority), 8); Â Â #Get an up destination from dispatcher with priority 1<br>Â Â Â Â Â Â Â Â xlog("L_NOTICE","Calling Dispatcher $du -- $siz:$sp with PARAMETER ATTRIBUTE: (attrs: $xavp(_dsdst_=>attrs))\n");<br>Â Â Â Â Â Â Â Â xlog("L_NOTICE","THE BRANCH IS SET AS: $(xavp(_dsdst_=>attrs){param.value,branch})\n");<br>Â Â Â Â Â Â Â Â xlog("L_NOTICE","THE EXTENSION SET IS: $(xavp(_dsdst_=>attrs){param.value,extension_set})\n");<br>Â Â Â Â Â Â Â Â t_on_failure("DISPATCH_FAILURE");</div><div><br></div><div>but i would like to achieve something more dynamic which permit me to create a simple database entry.</div><div><br></div><div>Probably there's a better way to do it maybe with the help of other modules or database tables.</div><div><br></div><div>If someone can suggest me the best way or simply pointing me on the right direction.</div><div>Appreciate</div><div><br></div><div>Regards<br></div><div><br> </div></div>