Send DTMF to DAHDI channel - asterisk

I am trying to figure out a way to send DTMF commands to my ISDN modem (throught BRI Card) to enable some services it provides. For example, for call forward I need to send the DTMF 21#. I have successfully did that with mISDN but I need to do it with DAHDI now.
So far I have managed to do this that does not work:
[from-internal-custom]
exten => 4321,1,Answer
exten => 4321,n,Noop(Enable Callforward)
exten => 4321,n,Dial(DAHDI/g0/,10,M(dtmf))
[macro-dtmf]
exten => s,1,SendDTMF(*21*<number>#,,DAHDI)
Where number is the number I want to to do the call forward (without the <>).
If I put a ISDN Phone on the ISDN Modem I just need to dial the featurecode 21< number ># and it works.
Is there a way to do this with DAHDI?

There is special key for that
D([called][:calling[:progress]]): Send the specified DTMF strings
*after* the called party has answered, but before the call gets bridged.
The <called> DTMF string is sent to the called party, and the <calling>
DTMF string is sent to the calling party. Both arguments can be used
alone. If <progress> is specified, its DTMF is sent immediately after
receiving a PROGRESS message.

Related

Asterisk BridgeWait How to bridge into a general bridge

I need to connect two channels from a bunch of channels. The upcoming channel is pushed into BridgeWait. Waiting music is played. Under the data is placed about the current case. I want to find out why we need BridgeWait. I try to create new ordinal bridge with the channel by AMI Bridge I do not see an error. New bridge is not created. Channels are still in the bridge "Waiting". If I kick from the waiting bridge the channel is closed so it is impossible to bridge them again.
How should I bridge channels from the waiting bridge correctly.
extensions.conf
exten => 2002,1,NoOp
exten => 2002,n,BridgeWait("Waiting")
exten => 2002,n,Hangup
Channels
924fa28457df*CLI> core show channels
Channel Location State Application(Data)
SIP/100-0000000a 2002#default:2 Up BridgeWait("Waiting")
SIP/103-00000009 2002#default:2 Up BridgeWait("Waiting")
2 active channels
2 active calls
11 calls processed
Holding bridge There are two channels.
924fa28457df*CLI> bridge show f57050e0-b6ae-4bfc-b8e3-295ce7371fef
Id: f57050e0-b6ae-4bfc-b8e3-295ce7371fef
Type: base
Technology: holding_bridge
Num-Channels: 2
Channel: SIP/103-00000009
Channel: SIP/100-0000000a
It is not possible to implement without AGI.
; Queue processing pipe.
exten => 2002,1,NoOp
exten => 2002,n,BridgeWait("Waiting")
exten => 2002,n,AGI(agi://10.1.2.1:3007)
exten => 2002,n,Hangup
BridgeWait Asterisk application holds the call for further processing with less resources.
Dialplan consists of piped operations: bridge wait and the next AGI management.
BridgeWait is broken from outside through the AMI interface to be managed by AGI when an operator is defined.
Short AGI pipe connects this predefined client and operator by dial command.

Automatic Send DTMF for Survey Campaign, Goautodial v3

I am using Goautodial V3 and i want to setup a campaign that sends automatic DTMF *2 as soon as the call has been answered, I have tried changing the agi-dtmf.agi file but it did not help, i also changed the outbound carrier dialplan but it still did not work. Can anyone help me out ? below is the carrier configuration that i used.
exten => _4416658289.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _4416658289.,2,Dial(SIP/${EXTEN:10}#TFM,,tTo)
exten => _4416658289.,3,Wait(10)
exten => _4416658289.,4,AGI(agi-dtmf.agi,signalonly---*2)
exten => _4416658289.,5,Set(TIMEOUT(absolute)=5)
exten => _4416658289.,6,Hangup
You should use option D of Dial command.
D([called][:calling[:progress]]): Send the specified DTMF strings *after*
the called party has answered, but before the call gets bridged. The
<called> DTMF string is sent to the called party, and the <calling> DTMF
string is sent to the calling party. Both arguments can be used alone. If
<progress> is specified, its DTMF is sent to the called party immediately
after receiving a 'PROGRESS' message.
See 'SendDTMF' for valid digits.

Forwarding X Headers in Asterisk

We have a soft phone that's dialing out, on a SIP trunk, through our Asterisk server. The soft phone is sending X Headers that we want to send on to the destination.
We see the headers coming into Asterisk, but not going out. Is there something we can do to forward the headers along to the destination?
Asterisk is no SIP proxy but a B2BUA. This actually means, that it is not forwarding the original request. The call from your softphone gets terminated on Asterisk. Asterisk starts a second call to the logical destination of your call and connects both calls together.
This is why on the outgoing call you don't have the headers you added on the incoming call. The outgoing call is initiated by Asterisk. If you want to add any headers from the incoming call, you manually have to to it like miken32 said:
exten => _X.,n,SIPAddHeader(X-Foobar: ${SIP_HEADER(X-Foobar)})
exten => _X.,n,Dial(SIP/${EXTEN})
Just tell your dialplan to pass them on; maybe something like this:
exten => _X.,n,SIPAddHeader(X-Foobar: ${SIP_HEADER(X-Foobar)})
exten => _X.,n,Dial(SIP/${EXTEN})

asterisk dialplan, forward call to gateway/pstn

i have VoIP infrastructure in company,
end points can dial mobile numbers in this case:
they call 9... they wait for pstn dial ton...after dial-ton they can dial their number.
i do this in this way:
exten => 9,1,dial(sip/8003)
witch sip/8003 is a sip account that is connected to FXO gateway and connected to asterisk via sip trunk.
i want to do this:
the end points dial:
909121111111
instead of
9... after-dialton.... 09121111111
Without having seen more of your dial plan, typically what you can do is, in an accessible context, a way to dial the whole thing -- and then use a substring to strip out parts of it.
exten => _9XXXXXXXXXX,1,Dial(SIP/8003/${EXTEN:1})
The first part of the extension matches a 10-digit number prefixed with a 9: _9XXXXXXXXXX. Check out the article on pattern matching on the Asterisk wiki
Next, on our dial application, what we do is dial your sip device, but, we pass it back the dialed extension, but, notice the colon? Like ${EXTEN:1} That's to strip digits. Namely it strips the first digit. You can learn more about manipulating variables on the wiki, too.

Ring Group # Asterisk. Is it possible to use dial and goto on the same priority?

I need to create a ring group (222) which would dial several SIP accounts, and PSTN numbers as well.
For PSTN I have a different context (ToPSTN) with it's own billing rules, so the question is:
How can I ring several SIP acc's and PSTN's simultaneously ?
Here is how I am trying to do that:
exten => 222,1,Dial(SIP/ca-444&SIP/ca-433)
exten => 433,1,Goto(ToPSTN,0035853855453,1)
Or maybe it's possible to do several tasks at the same priority somehow ?
To make dialing into dialplan instead of real channel driver you should use Local channel. This is how it look in your case:
exten => 222,1,Dial(SIP/ca-444&Local/0035853855453#ToPSTN)
So first call goes to SIP peer ca-444 and second directly to dialplan extension 0035853855453 and context ToPSTN.

Resources