Zap extension - autodial freepbx destination

I’ve read the forums and searched and I can’t seem to find a way to get the function I want.

I have an old analog phone device that will pickup a phone line and and output to it’s lineout to record or broadcast at the push of a button. 1 push picks up the line the next push hangs up. It was made to connect to a recorder or to a speaker for a phone broadcast.

I’d like to use it on my pbx in a flash system.
The way I see it working is this. It will connect to a fsx port on my asterisk box.
when a user pushes the button (picks up the line) it will trigger a call into the system.
Then I will have a freepbx destination setup the will pickup a line and call a phone recording at another location.

So what I think I need is this
a. some way to make the line auto connect just by picking up the analog phone
b. a way to select a freepbx destination
c. an easy way to program a destination to dial to the outside.

It’s probably all there and I just can’t see it.

I assume that this device does not have a keypad on it. You can put it in a special context and then write that context in extensions_custom.conf. To get it to dial immediately upon off-hook on a Zap (FXS) channel, put “immediate = yes” in the config for that channel. Here is an example:

In FreePBX put the phone in the context “from-weird-phone”.

Then in extensions_custom.conf put the following at the bottom:

[from-weird-phone]
exten => s,1,goto(from-internal,2100,1)

Now if 2100 is the extension of your operator, and immediate = yes is in the zap channel’s config, as soon as you lift the phone, it will call the operator.

So the immediate = yes is what makes the zap channel go to work when the line is picked up? Thats easy. Thanks

in this part
[from-weird-phone]
exten => s,1,goto(from-internal,2100,1)

can I replace the 2100 with any dial string?
for example an 111-222-3333, 4 second pause, 12345*, 1 second pause, 1 to confirm,
3 second pause, *5 option, 3 second pause, *8 option, 3 second pause, *9 option 2 second pause, 12345#

which I think would be like this

1112223333wwwwwwwwwww123456ww1wwwwwww5wwwwwww8wwwwwww9wwwww12345#

I would just make exten 2100 dail the number you wish, but hey I do it the easy way

I’ll have to see if I can figure out how to do that - it does sound simpler, and more manageable.