Hi.
Have a dual-SIM GSM gateway set up as two separate trunks (one for each SIM).
Created an outbound_cellphone route for cellphone numbers which matches 9 (for the outbound lines), then the prefix for all cellphone numbers (6). The route tries SIM1, SIM2, then tries a ISDN gateway, finally a POTS gateway.
What I want to do is to prefix the caller-ID hide code #31# before the number: this must be done only for the two GSM trunks.
Also, I would like–again, only in the GSM trunks–to prepend the #31# for all calls, but to omit for a dozen cellphone numbers. So, friends and family (in the list) see who is calling them, but everybody else get CID hiding.
The obvious place to do this is in the SIP Trunk | Dial Rules. This way, I can keep everything nice and clean, and don’t have to do any messy customizations, nor worry if I decide to change the trunk sequence in my outbound_cellphone route.
First step is to add a rule like #31#+.
But it doesn’t work.
I tried a little debugging in …/agi-bin/fixlocalprefix, adding an $agi->verbose here and there.
Turns out that the # character isn’t recognized. So:
0000123450000+. -> works, prepends 0000123450000 to the $EXTEN
0000#123450000+. -> partially works, prepends 0000 to the $EXTEN
#31#0000012345+. -> doesn’t work at all, fixlocalprefix exits with 0
Probably (can’t understand PHP) it’s these lines:
if (isset($conf[“trunk-$trunk”])) {
foreach ($conf[“trunk-$trunk”] as $key=>$rule) {
// extract all ruleXX keys
//$agi->conlog("$key = $rule");
if (preg_match("/^rule\d+$/",$key)) { <====== probable offending line
// $rule is a dial rule
if (($newnum = fixNumber($rule, $number, $agi)) !== false) {
Any ideas? Thanks in advance!