Feature code to send *72 to analog line on a DIGIUM analog card

I have used this in a hand build Asterisk system to send *72 to forward to each analog line on a system. Basically I dial 101 on my phone and it sets the analog line connected to dahdi/1 to an answering service.

I am trying to mimic this same behavior in FreePBX 2.10 Distro. Is it possible to just stick this code in some _custom.conf file and have FreePBX use the code?

[features]
; Forward Main Number to Answering Service
exten = 101,1,answer()
exten = 101,n,dial(dahdi/1/*72ww6776076)
exten = 102,1,answer()
exten = 102,n,dial(dahdi/2/*72ww6776076)
exten = 103,1,answer()
exten = 103,n,dial(dahdi/3/*72ww6776076)
exten = 104,1,answer()
exten = 104,n,dial(dahdi/4/*72ww6776076)

I’ve had clients ask for this in the past as well, I usually will try to avoid forwarding analog lines at all cost, as you lose the ability to track those calls in the cdr reports, I’ll usually forward them back out over SIP trunks so that they can still track those calls.

I do however need to forward the calls. Can it be done? These are analog trunks not SIP trunks.

Most of the time when configuring this in the past, my clients were on a hunt group so I only needed to worry about the first number. So I created a trunk that contains only the main number (set DAHDI identifier to 1 instead of g0). Then I set an outbound route to use that trunk when they dial a prefix of 9 first. This insures that they are only forwarding the main number. So they dial 9, then *72 then the answering service number. I’ve also configured speed dials to do this. 9 then *73 disengages the call forward.

The way it is configured now is that we dial 101 to forward line 1, 102 to forward line 2, 103 to forward line 3 and 104 to forward line 4. The customer is used to doing that so I wanted to keep it that way for now.

Is there a file I can add my existing code to and then setup extensions 101, 102, 103 and 104 to use the code?

I have never made any modifications directly to customize FreePBX and I wanted to learn a little more about this aspect of the system.

Try this:

Edit /etc/asterisk/extensions_override_freepbx.conf and include the line:
#include custom_callforwarding.conf
Create custom_callforwarding.conf in the same folder pasting in your code from your first post.

May or may not work, I don’t currently have a system I can test it on for you.

So here is how I solved this and learned a bit about custom extensions to boot. I am sure there are better ways to do this but it was my first try.

I created the following in extensions_custom.conf

; ; Start Forwarding ; [FWD-Line1] exten = 101,1,answer() exten = 101,n,dial(dahdi/1/*72ww6776076)

[FWD-Line2]
exten = 102,1,answer()
exten = 102,n,dial(dahdi/2/*72ww6776076)

[FWD-Line3]
exten = 103,1,answer()
exten = 103,n,dial(dahdi/3/*72ww6776076)

[FWD-Line4]
exten = 104,1,answer()
exten = 104,n,dial(dahdi/4/*72ww6776076)

;
; Stop Forwarding
;
[UnFWD-Line1]
exten = 201,1,answer()
exten = 201,n,dial(dahdi/1/*73)

[UnFWD-Line2]
exten = 202,1,answer()
exten = 202,n,dial(dahdi/2/*73)

[UnFWD-Line3]
exten = 203,1,answer()
exten = 203,n,dial(dahdi/3/*73)

[UnFWD-Line4]
exten = 204,1,answer()
exten = 204,n,dial(dahdi/4/*73)

I then created custom destinations for each of the contexts above in the GUI

FWD-Line1,101,1 UnFWD-Line1,201,1

And lastly created Misc Applications for each extension

Description: FWD-Line1 Feature Code: 101 Custom Destination: FWD-Line1

Description: UnFWD-Line1
Feature Code: 102
Custom Destination: UnFWD-Line1

Now when I dial 101 the system sends *72 with the forwarding number and when I dial 201 it sends *73 to cancel.

Although this seems like an awkward way to do this it is what the customer is used to doing and the don’t want to change.