User Input - asterisk

Hi,

I am working on asterisk.

I have configured my extensions.conf and sip.conf and they are working fine.

I am able to make a call and receive a call through asterisk.

However, now I want to read the input from user while phone is still on.

So scenario is,

I am calling from my asterisk phone to any number and
after receiving call, user will enter the number which I want to read and save to the file (while phone is still on).

(note: I am doing outbound call from asterisk)

Thanks

You can use the READ application to read digits in your dialplan.

https://wiki.asterisk.org/wiki/display/AST/Application_Read

[outgoing-sip]
exten => _.,1,Set(CALLERID(name)=12345678901)
exten => _.,2,Dial(SIP/000${EXTEN}@onsip)

[incoming-context]
exten => s,1,NoOp()
same => n,Wait(1)
same => n,Answer()
same => n,SendDTMF(1)
same => n,Dial(dahdi/1,20)

these are my settings in extensions.conf.
I already tried adding read in these settings but it did not work. Can you please let me know where to add read and how to add.

Thanks

So you are talking with a remote callee and during the call the callee will press and DTMF on his phone ?

If this is the scenaro you can use AMI DTMF events

Yup @ambiorixg12, I am making outbound call using asterisk and remote person will receive call from the asterisk. When remote person will pick up the call, I should be able to talk to that person and I should be able to read the number which that person entered on his/her phone.

You can use DTMFEnd
ttps://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerEvent_DTMFEnd

@ambiorixg12,

can you give me example config line or asterisk code for AMI DTMF for my purpose?

You will need to listen to the DTMF event associated with the channel of the bridged call and save the Digit: on a DB or external file, this will require extra programming language like PHP

I suggest to study this, https://wiki.asterisk.org/wiki/display/AST/The+Asterisk+Manager+TCP+IP+API

Thanks guys for your support.

Created a function in the channel.c file from asterisk package and it solved the problem.