Macro-dialout-trunk-predial-hook and trunk dial patterns rules

Hi all,

I have macro-dialout-trunk-predial-hook configured on FreePBX on my extensions_custom.php

[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(Trunk ${OUT_${DIAL_TRUNK}} selected)
exten => s,n,NoOp(${CALLERID(num)} is calling ${OUTNUM})
exten => s,n,Noop(Len of CALLERID is ${LEN(${CALLERID(num)})})
exten => s,n,Noop(TELCO requires CALLERID with 10 digits to dial out)

exten => s,n,Agi(custom_alteracnl.php,SPO)

That agi script check the number dialed and change it based on some rules.

My question is about the dial pattern rules on trunk, it seems that when the agi script is executed, it does not follow the rules configured on trunk.

In my case, if a dialed number match a rule, it should trim the 0 and append 021 on number to be dialed.

If the number dialed is not modified by the agi script, the dial pattern rules of trunk works.

And the part of agi script that changes the number is this:

    $agi->exec('SET','OUTNUM=0'.$dialnumber);
    $agi->exec('SET','DIAL_NUMBER=0'.$dialnumber);

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.