Using Channel Variables in GUI Fields

Maybe everyone else already knows this, but I had no idea I could use channel variables in GUI fields! But you can, and many times it can make life easier.

For instance, I want a certain group of DIDs from a SIP carrier to go out through my DAHDI cards with DNIS and CallerID(number) intact.

So I make an inbound route for the DID and point it to a Misc Dest that has the “Dial” field populated with 777${CALLERID(dnid)} and this will cause FreePBX to dial 777[inbound DID]

Then an outbound route to g0/g1 and in “Dial Patterns” put 777 in prefix and NXXNXXXXXX in pattern. That strips the 777 so the dialed number will be the exact DID that came in.

The I put ${CALLERID(number)} in the Route Settings => Route CID field in the GUI and now FreePBX sends the call to DAHID with the CallerID and DNIS intact. Simple!

Except I have been writing dial plans or AGI because I didn’t know you could use channel variables in GUI fields.

I hope this saves somebody some time.

1 Like