Repeat dialed number on trunk

I have my FreePBX system connected to a legacy analog PBX, when I go off hook it returns a dial tone to FreePBX, todial any of its extensions (I believe this is referred to as DISA). My outbound routes and trunks in FreePBX are configured so that if I dial an extension on the analog PBX, it correctly routes my call to the PBX, but all I hear back is the dial tone. I then must manually re-dial the called extension, but I am hoping this can be automated.

I am wondering if there is a way that once dial tone is returned from the analog system, Asterisk/FreePBX can repeat the dialed extension to the analog PBX so it can complete the call.

What ‘technology’ is the ‘tie-line’ trunk using?

The analog system is connected via a Grandstream HT813 FXS port. The trunk in FreePBX is set up as a SIP trunk.

That would be a function of the ATA , this feature is commonly called two stage dialling

Wild guess: configuring the ATA to pause before dialing might resolve this.

Please describe the setup in more detail, including make/model of the legacy PBX and the type of port (extension or trunk) the HT is connected to. It sounds like you are connected to a trunk port on the legacy box (often called CO line port), since that is consistent with using the FXS port of the HT. However, you said

but with the above settings the HT would send ringing voltage to the legacy trunk, which would respond by going off hook to answer the call, then play the DISA dial tone. With this setup, you could use a Custom trunk with the D option to send DTMF to the legacy system. See the D option in
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Dial
Alternatively, if the legacy box has a spare extension port that supports ‘single line telephones’ (a standard analog phone could be connected there), you could connect the HT’s FXO port to that. When the FXO goes off hook, the legacy machine would send regular dial tone (not DISA) and the called number would be sent by the HT as DTMF, which would connect to the desired extension.

Either of these schemes allow only one call at a time between the systems; you might want to implement both so you could have two concurrent calls.

1 Like

@Stewart1 you have described the setup exactly. The analog system is a Dukane STARCall.

I think we’re barking up the right tree with the D option, but how do I get the dialed Dukane extension into the D option. I’ve tried D(DIALEDPEERNUMBER) but that didn’t work. I also tried D(204) where 204 is one of the extensions on the Dukane system, and that did work, but all calls were routed to extension 204 as expected.

Try
D(${DIALEDPEERNUMBER})
or
D(${OUTNUM})

If no luck, paste the Asterisk log for a failed call at pastebin.freepbx.org and post the link here.
If you are too new to post links, post the last 8 hex characters of the link.

Those two didn’t work, but here is the logfile. https://pastebin.freepbx.org/view/ab7e9ac9

There’s some particular interesting lines around 136, where you see it discards the D(${OUTNUM}) because they are not valid DTMF characters.

It’s already in difficulty by line 96. Whatever use used to add ${OUTNUM} to the right hand side of the Set wasn’t, itself, set through the dialplan.

I looked at the generated dialplan and it appears that FreePBX is already using variable interpolation so it won’t interpolate twice, but there is a special kludge for that. Try:
D($OUTNUM$)
If the digits are sent before the Dukane is listening, try
D(w$OUTNUM$)

1 Like

That doens’t seem to have done the trick, here is an updated log. https://pastebin.freepbx.org/view/a45f4211

Also, just we’re all on the same page, I’m adding this D command to the Asterisk Trunk Dial Options setting for the Trunk.

I did this differently, using a Custom Trunk. Here is an attempt to translate for your system:
Change the Asterisk Trunk Dial Options for the STARCall trunk back to System.
Create a new Custom Trunk, call it STARCall2. Leave the General tab at defaults.
On the custom Settings tab, set Custom Dial String to
SIP/STARCall/1234,300,D(ww$OUTNUM$)

You may need to replace 1234 with the username for the HT’s FXS port.

Then change the Outbound Route to send calls intended for the STARCall to the STARCall2 trunk.
If you still have trouble, paste another log.

1 Like

Stewart, that works! Thank you so much for your help with this.

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