DNID variable not available in fpx 2.4.0?

folks,

I have a custom dialplan

exten => s,1,Dial(iax2/6010/${DNID})

that I have been using to call another freepbx box and force the identification of the called DID through the trunk, which allows the receiving box to treat the incoming route appropriately.

However, with upgrade to freepbx 2.4.0.0, ${DNID} is now returning NULL.

Whas DNID replaced by another variable? How can I solve this problem?

thanks for any help
Clovis

DNID is an Asterisk Channel variable that should not have been altered by anything in FreePBX, but in general I have found it is often not set depending on your dialplan. If the number enters the box as a DID and is routed by FreePBX, then we set ${FROM_DID} accordingly in our dialplan and you might be able to use that. Did you upgrade Asterisk at the same time as FreePBX - because if you were working before I can’t imagine what FreePBX changes could have effected DNID since we don’t touch it.

Philippe,

I found the problem, but dont know the root cause. All of my inbound routes were configured in freepbx, and they are dumped in extensions_additional.conf. I have a custom dialplan destination, and the result is as follows:

exten => _166[3-9],1,Set(__FROM_DID=${EXTEN})
exten => _166[3-9],n,Gosub(app-blacklist-check,s,1)
exten => _166[3-9],n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => _166[3-9],n,Set(CALLERID(name)=${CALLERID(num)})
exten => _166[3-9],n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => _166[0-9],n,Goto(dialout,s,1)

In extensions_custom.conf, I had

[dialout]
exten => s,1,Dial(IAX2/6010/814009${DNID})

This was working fine until asterisk and freepbx were upgraded. DNID turned out NULL. I started hacking extensions_additional.conf to see where ${EXTEN} was returning the DID and when it became null. Somehow, the call of the custom dialplan lost all variables. My solution was to remove my inbound routes from freepbx (to avoid my fixes from being overriden), and I added the Dial call directly in the dialplan, instead of calling it. It’s now working. If you see below, all I did was to call the Dial command directly instead of Goto the custom dialplan where the Dial is called. Only the last line was changed.

exten => _166[3-9],1,Set(__FROM_DID=${EXTEN})
exten => _166[3-9],n,Gosub(app-blacklist-check,s,1)
exten => _166[3-9],n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => _166[3-9],n,Set(CALLERID(name)=${CALLERID(num)})
exten => _166[3-9],n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => _166[0-9],n,Dial(IAX2/6010/814009${EXTEN})

Thanks
Clovis