Help routing calls between a SIP trunk and a DAHDI trunk

I’m new to FreePBX and have been reading non-stop for a couple of days. I have a Trixbox 2.8.0.4 system with several SIP extensions, one SIP trunk and a DAHDI T1 trunk to a Nortel PBX.

I would like to route calls coming in the SIP trunk which match a pattern to the Nortel. I would also like to route calls from the Nortel out the SIP trunk if they match a pattern (e.g. 10 digits).

I’ve tried a bunch of things, but nothing seems to work.

Thanks in advance.

Rich

trixbox uses a very old, unsupported, end of life version of FreePBX.

Since you did not tell us what you tried it is had to say what you are doing wrong.

If you were running a current version of Genuine FreePBX you can simply use a trunk as the destination of a route.

In older versions (and trixbox) simply make an extension with a type of custom and use the /dahdi/xx/digits_to_send as the dial string. In this example substitute xx for the channel or group number and digits_to_send for the DTMF to outdial.

Thanks - that explains a lot. I didn’t understand the relationship between trixbox and FreePBX. I will take a look at installing a real FreePBX distribution in the future. Sounds like that might make things a lot easier.

In the mean time, thanks for helping with this.

I had tried creating a custom extension and using “zap/g0/nnnn” as the dial string (I also tried dahdi/g0/nnnn), but neither worked. sip/nnnnnnnnnn@siptrunk did work, though. I hadn’t tried using the leading “/”, so I just tried that (same results).

Looks like it’s trying to dial out the SIP trunk?

Here are a few lines from the CLI:

dialparties.agi: Caller ID name is ‘609xxxxxxx’ number is ‘609xxxxxxx’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 850xxxxxxx to extension map
– dialparties.agi: Extension 850xxxxxxx cf is disabled
– dialparties.agi: Extension 850xxxxxxx do not disturb is disabled
> dialparties.agi: extnum 850xxxxxxx has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 4 (UNAVAILABLE)
– dialparties.agi: dbset CALLTRACE/850xxxxxxx to 609xxxxxxx
– dialparties.agi: Filtered ARG3: 850xxxxxxx
– <SIP/FLORIDA-0000001b>AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:7] Dial(“SIP/FLORIDA-0000001b”, “/dahdi/g0/8854,”",tr") in new stack

You need to see what channels you have. Do a ‘zap show channels’ and a ‘dahdi show channels’ and post the results.

dahdi_tool shows no alarms.

trixbox1CLI> zap show channels
No such command ‘zap show channels’ (type ‘help zap show’ for other possible commands)
trixbox1
CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo from-pstn default In Service
1 from-pstn default In Service
2 from-pstn default In Service
3 from-pstn default In Service
4 from-pstn default In Service
5 from-pstn default In Service
6 from-pstn default In Service
7 from-pstn default In Service
8 from-pstn default In Service
9 from-pstn default In Service
10 from-pstn default In Service
11 from-pstn default In Service
12 from-pstn default In Service
13 from-pstn default In Service
14 from-pstn default In Service
15 from-pstn default In Service
16 from-pstn default In Service
17 from-pstn default In Service
18 from-pstn default In Service
19 from-pstn default In Service
20 from-pstn default In Service
21 from-pstn default In Service
22 from-pstn default In Service
23 from-pstn default In Service
trixbox1*CLI>

try 1 channel first then move on to the group

dahdi/1/num_to_dial

dialparties.agi: Caller ID name is ‘609XXXXXXX’ number is ‘609XXXXXXX’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 850XXXXXXX to extension map
– dialparties.agi: Extension 850XXXXXXX cf is disabled
– dialparties.agi: Extension 850XXXXXXX do not disturb is disabled
> dialparties.agi: extnum 850XXXXXXX has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 4 (UNAVAILABLE)
– dialparties.agi: dbset CALLTRACE/850XXXXXXX to 609XXXXXXX
– dialparties.agi: Filtered ARG3: 850XXXXXXX
– <SIP/FLORIDA-00000028>AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:7] Dial(“SIP/FLORIDA-00000028”, “dahdi/1/8854,”",tr") in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called 1/8854
– DAHDI/1-1 is proceeding passing it to SIP/FLORIDA-00000028
– DAHDI/1-1 is making progress passing it to SIP/FLORIDA-00000028
– DAHDI/1-1 answered SIP/FLORIDA-00000028
– Executing [h@macro-dial:1] Macro(“SIP/FLORIDA-00000028”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/FLORIDA-00000028”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“SIP/FLORIDA-00000028”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“SIP/FLORIDA-00000028”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“SIP/FLORIDA-00000028”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/FLORIDA-00000028’ in macro ‘hangupcall’
– Hungup ‘DAHDI/1-1’
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/FLORIDA-00000028’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘SIP/FLORIDA-00000028’ in macro ‘exten-vm’
== Spawn extension (from-pstn, 850XXXXXXX, 1) exited non-zero on ‘SIP/FLORIDA-00000028’