Stephen Brown
2010-Feb-20 21:16 UTC
[asterisk-users] Sending a hook flash to a DAHDI channel
I've got a piece of CPE equipment that has an FXS port that I have tied to an FXO port on a TDM400 clone card. Normally, if I go off-hook with a standard telephone connected to it, I get a dialtone. If I dial a digit, and send a hookflash, the device will provide a dialtone back for the next available channel on the device. I'm trying to recreate this same behavior with Asterisk, however, it's not working. I'm not sure if it's me, the CPE device, Asterisk, my dialplan code or a combination of all. I am running Asterisk 1.6.0.21, FreePBX 2.6, and the latest version of DAHDI. Here's the dialplan logic I am trying to execute, this is in /etc/asterisk/extensions_custom.conf: [from-internal-custom] exten => 1234,1,Dial(DAHDI/2) ; DAHDI channel 2, FXO exten => 1234,n,SendDTMF(2) ; I expect to send DTMF digit 2 after the channel answers? exten => 1234,n,Wait(1) ; I added a wait statement exten => 1234,n,Flash() ; Send the hookflash After the hookflash is when I expect to receive dialtone from the CPE device, but it does not appear to ever execute the SendDTMF or Flash events: [Feb 20 15:45:52] -- Starting simple switch on 'DAHDI/4-1' [Feb 20 15:46:00] -- Executing [1234 at from-internal:1] ResetCDR("DAHDI/4-1", "") in new stack [Feb 20 15:46:00] -- Executing [1234 at from-internal:2] Dial("DAHDI/4-1", "DAHDI/2") in new stack [Feb 20 15:46:00] -- Called 2 [Feb 20 15:46:01] WARNING[27502]: chan_dahdi.c:2008 dahdi_enable_ec: Unable to enable echo cancellation on channel 2 (No such device) [Feb 20 15:46:01] -- DAHDI/2-1 answered DAHDI/4-1 [Feb 20 15:46:01] -- Native bridging DAHDI/4-1 and DAHDI/2-1 [Feb 20 15:46:06] WARNING[27502]: chan_dahdi.c:2008 dahdi_enable_ec: Unable to enable echo cancellation on channel 2 (No such device) [Feb 20 15:46:06] -- Executing [h at from-internal:1] Macro("DAHDI/4-1", "hangupcall") in new stack [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:1] GotoIf("DAHDI/4-1", "1?skiprg") in new stack [Feb 20 15:46:06] -- Goto (macro-hangupcall,s,4) [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:4] GotoIf("DAHDI/4-1", "1?skipblkvm") in new stack [Feb 20 15:46:06] -- Goto (macro-hangupcall,s,7) [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:7] GotoIf("DAHDI/4-1", "1?theend") in new stack [Feb 20 15:46:06] -- Goto (macro-hangupcall,s,9) [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:9] Hangup("DAHDI/4-1", "") in new stack [Feb 20 15:46:06] == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'DAHDI/4-1' in macro 'hangupcall' [Feb 20 15:46:06] -- Hungup 'DAHDI/2-1' [Feb 20 15:46:06] == Spawn extension (from-internal, 1234, 2) exited non-zero on 'DAHDI/4-1' [Feb 20 15:46:06] -- Hungup 'DAHDI/4-1' I've also tried it with this variation: exten => 1234,1,Dial(DAHDI/2/D(2)) ; DAHDI channel 2, FXO send DTMF digit 2 before call gets bridged exten => 1234,n,Wait(1) ; Wait 1 second exten => 1234,n,Flash() ; Send the hookflash This yields the results of dialing "2" to the CPE device, again I never see the Flash event get executed (as evidenced from the console, it's also possible my verbosity is set too low?) Any help appreciated.... Thanks, Stephen
Tzafrir Cohen
2010-Feb-20 22:08 UTC
[asterisk-users] Sending a hook flash to a DAHDI channel
On Sat, Feb 20, 2010 at 04:16:56PM -0500, Stephen Brown wrote:> I've got a piece of CPE equipment that has an FXS port that I have tied > to an FXO port on a TDM400 clone card. Normally, if I go off-hook with a > standard telephone connected to it, I get a dialtone. If I dial a digit, > and send a hookflash, the device will provide a dialtone back for the > next available channel on the device. > > I'm trying to recreate this same behavior with Asterisk, however, it's > not working. I'm not sure if it's me, the CPE device, Asterisk, my > dialplan code or a combination of all. I am running Asterisk 1.6.0.21, > FreePBX 2.6, and the latest version of DAHDI. > > Here's the dialplan logic I am trying to execute, this is in > /etc/asterisk/extensions_custom.conf: > > [from-internal-custom] > exten => 1234,1,Dial(DAHDI/2) ; DAHDI channel 2, FXOYou only get past this point when this call is over.> exten => 1234,n,SendDTMF(2) ; I expect to send DTMF digit 2 after > the channel answers? > exten => 1234,n,Wait(1) ; I added a wait statement > exten => 1234,n,Flash() ; Send the hookflashCan the CO send Flash to the CPE?> > After the hookflash is when I expect to receive dialtone from the CPE > device, but it does not appear to ever execute the SendDTMF or Flash events: > > [Feb 20 15:45:52] -- Starting simple switch on 'DAHDI/4-1' > [Feb 20 15:46:00] -- Executing [1234 at from-internal:1] > ResetCDR("DAHDI/4-1", "") in new stack > [Feb 20 15:46:00] -- Executing [1234 at from-internal:2] > Dial("DAHDI/4-1", "DAHDI/2") in new stack > [Feb 20 15:46:00] -- Called 2 > [Feb 20 15:46:01] WARNING[27502]: chan_dahdi.c:2008 dahdi_enable_ec: > Unable to enable echo cancellation on channel 2 (No such device) > [Feb 20 15:46:01] -- DAHDI/2-1 answered DAHDI/4-1 > [Feb 20 15:46:01] -- Native bridging DAHDI/4-1 and DAHDI/2-1 > [Feb 20 15:46:06] WARNING[27502]: chan_dahdi.c:2008 dahdi_enable_ec: > Unable to enable echo cancellation on channel 2 (No such device) > [Feb 20 15:46:06] -- Executing [h at from-internal:1] > Macro("DAHDI/4-1", "hangupcall") in new stack > [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:1] > GotoIf("DAHDI/4-1", "1?skiprg") in new stack > [Feb 20 15:46:06] -- Goto (macro-hangupcall,s,4) > [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:4] > GotoIf("DAHDI/4-1", "1?skipblkvm") in new stack > [Feb 20 15:46:06] -- Goto (macro-hangupcall,s,7) > [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:7] > GotoIf("DAHDI/4-1", "1?theend") in new stack > [Feb 20 15:46:06] -- Goto (macro-hangupcall,s,9) > [Feb 20 15:46:06] -- Executing [s at macro-hangupcall:9] > Hangup("DAHDI/4-1", "") in new stack > [Feb 20 15:46:06] == Spawn extension (macro-hangupcall, s, 9) exited > non-zero on 'DAHDI/4-1' in macro 'hangupcall' > [Feb 20 15:46:06] -- Hungup 'DAHDI/2-1' > [Feb 20 15:46:06] == Spawn extension (from-internal, 1234, 2) exited > non-zero on 'DAHDI/4-1' > [Feb 20 15:46:06] -- Hungup 'DAHDI/4-1' > > I've also tried it with this variation: > exten => 1234,1,Dial(DAHDI/2/D(2)) ; DAHDI channel 2, FXO send DTMF > digit 2 before call gets bridged > exten => 1234,n,Wait(1) ; Wait 1 second > exten => 1234,n,Flash() ; Send the hookflash > > This yields the results of dialing "2" to the CPE device, again I never > see the Flash event get executed (as evidenced from the console, it's > also possible my verbosity is set too low?)-- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
Stephen Brown
2010-Feb-20 22:33 UTC
[asterisk-users] Sending a hook flash to a DAHDI channel
> You only get past this point when this call is over.That makes sense now that I think about it.> Can the CO send Flash to the CPE?I am the CO in this case :) I started looking at the "D" option of the dial command, is there any way to send a DTMF digit followed by a hookflash at call origination? For example maybe something like this: exten => 1234,1,Dial(DAHDI/2/D(2,someoptopiontohookflashhere) Or is there an alternative method that I could use for what I am trying to accomplish?