Is it possible to monitor a channel using Astersik AMI - asterisk

I am using asterisk
I would like to debug a channel
I want to track the channel activities
Like Dialing, Ringing, Call established and Hangup etc
Is there any cli commands available ??? or any other way to do this
Thanks in advance

Although I come from Freeswitch world. I would think that it should. A little search leads to this :
http://www.voip-info.org/wiki/view/Asterisk+CLI
You should be able to see all the events logged on a cli.

Related

Is it possible to us RxAndroiBle, autoconnect in foreground?

I will try to post a question since I want to use RxAndroidBle. I want to connect to a device even though I am not running my application, I don`t mind if any service is running. Moreover if possible when I get close to the device with my phone, it automatically launches the application. What would be the drill for something like this?
You could register broadcast receiver with specific filter which will wakes up your app when BLE device is available

Do I need a dialplan?

I'm getting started with Asterisk and I have to develop an app that will only be used to call people (an alarm system).
I'm using Java and Asterisk-Java, and I read that on their GitHub:
Did you know you can originate directly into AGI? This is really powerful and eliminates the need for dialplan when doing AGI.
So, if I get it properly, that means I can do without a dialplan.
Though, I can't get Asterisk-Java to work properly, but I don't know it is because I have no dial plan or for some other reason.
Thanks
Yes, you need dialplan for anything except outgoing calling(initiated from asterisk side).
If you using only Originate and not need hangup handlers, caller id etc etc you can go without dialplan.
But in most cases it will be really tricky and usless.

Is there any way to know which peer disconnected the call Asterisk

I am trying to collect some info about the ongoing call in asterisk but during hangup I want to log which peer initiated the process of hangup. I am new to asterisk so I have no idea if its possible or not. Please help me if it can be done. I have tried to use HANGUPCAUSE_KEYS but it does not provide much information.
Actually I want to know who has released the line first? If A and B are connected with bridge and B releases I want to record that B has released the channel and vice versa.
Thanks!
I can see 2 ways.
1) Set a Hangup Handler in your dialplan (extensions.conf). Maybe it is the easiest way, but limited. WIKI: Hangup Handler
2) Use AMI and try to monitor the channels. It can be complicated, but almost limitless and powerful. WIKI: Asterisk AMI

Asterisk AMI Atxfer on explicitely bridged channels

I'm trying to complete software which does all call logic via AMI on it's own using Asterisk only as interface to VOIP, SIP/GSM. Almost everything works great, but...:
Here is my scenario:
- incoming call is forwarded to announcement and then to MOH forever
- my app decides which extensions to dial (7777) using AMI Action: Originate
- once somebody picks up on extension, his/her channel (SIP/306-xxxxx for example) is bridged with waiting call's channel using AMI Action: Bridge
Until this point everything is working fine, both connected parties can hear each other, recording on demand works. All is fine.
Now I'm trying to make assisted transfer to another extension (Atxfer) using AMI on one of the bridged channels. And it doesn't work. I got couple of ami events about DTMF's on a channel (audio is muted while they are played). Every DTMF digit couses quick Bridge:unlink and Bridge:link event on AMI.
I tried to change dtmfmode, upgrade from asterisk 1.8 to 11 (asterisk now) and it always was the same.
While having this problems with Atxfer blind transfer on those channels works (using AMI Action: Redirect).
full log shows nothing something like this:
[2013-11-11 20:24:57] DEBUG[9457]: features.c:3740 feature_interpret: Feature interpret: chan=SIP/306-00000017, peer=SIP/GTS-00000016, code=*2, sense=1, features=0, dynamic=apprecord#apprecord
I recommend you read some asterisk book for beginner like ORelly's "Asterisk the future of telephony".
In you case correct solution is use asterisk Dial command for first channel instead of second call creation.
It is not clear how you do transfer using AMI. If you want do it via ami(which is VERY bad way), you have do something like following
On transfer request(digit) unbridge channels. Better put it in AsyncAGI after that.
Collect digits where to transfer using Read command
Transfer to new destination
If fail bridge again
NOTE: You resulting application will be really buggy and not scalable. AMI interface is not designed to do such things and work very bad when you have alot of actions and channels running on same box. So you have test your app under hi concurrent load to ensure it work(or more likly not work).

Record and playback simultaneously - Asterisk

I am trying to build an application where I am required to record and playback simultaneously. The application needs to go live on an asterisk telephony server. My problem is:
A user calls the asterisk server and starts to speak.
The voice packets being sent by the user are recorded in a wav file on the system.
A copy of the voice packets are sent as feedback simultaneously.
I have taken a look at ChanSpy, but it will not work if one is using Record.
My questions:
1. If a user calls an asterisk server, does that channel become a simplex or half-duplex channel?
2. Are there any commands etc. that allow us to do the above?
3. If not, does that mean I need to go into C programming for asterisk (agi-bin)?
P.S: Please let me know in case more information is needed.
Why not try MixMonitor? That allows you to record the call, and doesn't interfere with ChanSpy usage. ChanSpy IS the best way to do this, by the way.
You are wanting to feed to voice channel from the caller back to the same caller correct?
Have you tried the Echo command?

Resources