I’ve been watching the manager events generated by asterisk when a call is originated using the manager api. I am trying to figure out why there are two new channel events for each originated call, but only one hangup event. Perhaps someone can explain to me what these events are indicating and what is going on? Thanks.
Dan
Asterisk is funny that way, just wait until you try using Local/ channels, all sorts of funny stuff starts happening then. Trackng a call through the manager output is not always very easy and is in fact very hard in some circumstances like when using Local/ channels.
Could you post the specific output that you are asking for more information about?
My idea was to watch the manager events, Newchannel and Hangup, to maintain a count of active ports on my Asterisk system. That way my software won’t originate too many calls and overload the system.
If what you are saying is true, then I will have to come up with a different approach. Thanks for the info.
We attempted to do the same thing when we started writing astGUIclient, but found on heavy-load servers that it was very unreliable so we settled on getting a “show channels concise” output twice a second to see the true number of active channels on the system. Again, not the most elegant solution, but you can reduce your manager output to “command” only which helps reduce load and reduce data to parse and it is very accurate.