[Home]

Summary:ASTERISK-01289: Manager event for call setup/tear down
Reporter:maciejka (maciejka)Labels:
Date Opened:2004-03-25 12:28:42.000-0600Date Closed:2011-06-07 14:05:20
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I need manager client to know which channels talk with each other. So events for channels connection and one for channel disconnetion are necessary. For example:
Event: Connected
Channel1: SIP/bromba-123
Channel2: IAX[muka@polimorfia]/4

Event: Disconnected
Channel1: SIP/bromba-123
Channel2: IAX[muka@polimorfia]/4

****** ADDITIONAL INFORMATION ******

Currently manager reports link/unlink events but they can't be used for connection setup detection as they may happen more than once during single connection, so received unlink event one can't be sure that it is definite and channels won't be linked again in a moment.
Comments:By: James Golovich (jamesgolovich) 2004-03-25 23:50:50.000-0600

I don't think this is necessary at all.  The Link and Unlink events are sufficient for this.  Its up to you to keep track whats connected to what, or to issue a Status action to query the status if you need to know whats connected to what at this time.  Closing this one out

By: maciejka (maciejka) 2004-03-26 03:37:44.000-0600

Problem is that Link/Unlink events *happen more than once* during single connection.

In my Asterisk installation when I connect two channels (IAX,SIP) I get following sequence of events(these are events for *single* connection, come one by one without any delay):
Event: Link
Channel1: IAX[kamyk@192.168.0.3:5036]/3
Channel2: SIP/kamyk-9950
Event: Unlink
Channel1: IAX[kamyk@192.168.0.3:5036]/3
Channel2: SIP/kamyk-9950
Event: Link
Channel1: IAX[kamyk@192.168.0.3:5036]/3
Channel2: SIP/kamyk-9950
and only then parties may speak to each other. When connection is hungup then another Unlink happens again.

Now how manager client should interpret these events? First Link? Connection seems to has been setup. Following Unlink? Does it mean connection hungup or is it only indication of internal asterisk logic than one should not take care of? Next Link? Does it mean than connection has been setup again or one should discard this? Maybe other channel events, and timing information should be taken into consideration to tell the diffrence between inconnection Link/Unlink events and those that mean call setup and hungup? It is possible but makes manager client much more complicated then necessary as it needs to implement state machine to detect call teardown. For single connection clients should get just two events: connected and disconnected. Link/Unlink would be enough if were not repeated during connection.

edited on: 04-09-04 12:24

By: maciejka (maciejka) 2004-04-09 13:34:38

Reminder sent to jamesgolovich

Sorry to bother You directly but I have not got any answer to comment about call setup/tear down problem (http://bugs.digium.com/bug_view_page.php?bug_id=0001296). Would You please look at this bug again as I still think that there is a problem with call setup/tear down detection with manager interface. Details in bugnotes...


By: James Golovich (jamesgolovich) 2004-04-09 13:38:09

I don't have time to explain the whole process, its well documented in the source code.  Perhaps you can ask on the mailing list or on irc for someone to detail what is happening here

By: maciejka (maciejka) 2004-04-09 14:14:50

Would You, at least, point me to source files? Which should I start from?

By: James Golovich (jamesgolovich) 2004-04-10 14:30:38

The relevant code is in channel.c.  Look for the calls to manager_event and you will see when it happens.