Hi,
I’m working with Asterisk from few days and I have problem with one of the cases. I am out of ideas so I hope you can help me. First I will explain what I want to achieve. I want to make a call using ARI (this is working) and I would like to get DTMF from device. For testing purposes I use X-Lite (5.2.0). I set up G711 ulaw codec and DTMF 2833 for it. Regarding Asterisk I use 15.1.5 on MacOS with Twilio SIP Trunking.
pjsip.conf
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5061
[twilio-trunks](!)
type=endpoint
transport=transport-udp
context=from-twilio
disallow=all
allow=ulaw
dtmf_mode=rfc4733
[auth-out](!)
type=auth
auth_type=userpass
[twilio0](twilio-trunks)
aors=twilio0-aors
outbound_auth=twilio0-auth
[twilio0-aors]
type=aor
contact=sip:some-name.pstn.twilio.com:5060
[twilio0-ident]
type=identify
endpoint=twilio0
match=54.172.60.0
match=54.172.60.1
match=54.172.60.2
match=54.172.60.3
[twilio0-auth](auth-out)
password=password
username=user
extensions.conf
[default]
exten => 1000,1,NoOp()
same => n,Stasis(my-app)
same => n,Hangup()
My ruby code
@client = Ari::Client.new(
url: 'http://127.0.0.1:8088/ari',
api_key: 'user:password',
app: 'my-app'
)
@client.on :stasis_start do |e|
puts "Start stasis for channel #{e.channel.name}"
e.channel.on :stasis_end do |e|
puts "Channel #{e.channel.name} left Stasis."
end
e.channel.on :channel_dtmf_received do |e|
puts "Digit pressed: #{e.digit} on channel #{e.channel.name} !"
end
end
@client.connect_websocket
channel = @client.channels.originate endpoint: 'PJSIP/+1#{phone_number}@twilio0', extension: 1000
So the problem is that when I answer the call and I click on any digit on the dial pad I don’t receive message from channel_dtmf_received event. I don’t know if this can be a problem with X-Lite, with Aterisk configuration or Twilio configuration. I will be grateful for any advice.