[asterisk-dev] manager interface , question

Piotr Chytla pch at packetconsulting.pl
Mon Mar 13 16:54:24 MST 2006


Hi 

I'm writing app. that use asterisk manager interface , my application is
storing data sent by asterisk events in hash table, we can call this
hash {channel}, when event appers data sent by event are stored in 
{channel} hash , and they are depend on channel Uniqueid, for example 

   {channel}{1142248060.15562}{Channel}='IAX2/erlang-16384'
   {channel}{1142248060.15562}{State}='Ring'
   {channel}{1142248060.15562}{CallerID}='717201234'
    [..]
  similar for second channel.

I'm using 'link' event to create 'call' , from two UniqueIds .
When 'call' is created , my application is starting billing process. 
Problem is that 'link' and 'unlink' events  
appers 4 times .From my understanding of asterisk manager interface link/unlink 
events can only appear ones per call . How it is possible that link
event appears 4 times?  without id change, and it happens on zap
channel, there is no Hangup on zap or something similar.
Maybe someone have idea how to overstep this problem, or know how to fix
this. 

Bellow is event log for call that cause problems:

Mar 13 12:07:40 sexofon ring.pl:  (newchannel) [ Uniqueid : 1142248060.15562 Channel : IAX2/erlang-16384 State : Ring CallerID : 717201234  ] 
Mar 13 12:07:41 sexofon ring.pl:  (newexten) [ Uniqueid : 1142248060.15562 Channel : IAX2/erlang-16384 Context : local Extension : 0223510000 Priority : 1 Application : Dial AppData: Zap/g1/223519002  ] 
Mar 13 12:07:41 sexofon ring.pl:  (dial) [ 1142248060.15562 --> 1142248061.15563 Source : IAX2/erlang-16384 Destination : Zap/1-1 CallerID : 717201234 CallerIDName : 324  ] 
Mar 13 12:07:49 sexofon ring.pl:  (newstate) [ Uniqueid : 1142248060.15562 Channel : IAX2/erlang-16384 State : Up CallerID : 717201234  ] 
Mar 13 12:07:49 sexofon ring.pl:  (link) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:19 sexofon ring.pl:  (unlink) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:19 sexofon ring.pl:  (link) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:21 sexofon ring.pl:  (unlink) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:21 sexofon ring.pl:  (link) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:24 sexofon ring.pl:  (unlink) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:24 sexofon ring.pl:  (link) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:26 sexofon ring.pl:  (unlink) [ Uniqueid1 : 1142248060.15562 --> 1142248061.15563 Channels : ( IAX2/erlang-16384 , Zap/1:12-1 ) CallerID : ( 717201234 , 0223510000 )  ] 
Mar 13 12:08:26 sexofon ring.pl:  (hangup) [ Uniqueid : 1142248060.15562 Channel : IAX2/erlang-16384 Cause : 16 Cause-txt :   : Hangup  ] 

/pch

-- 
Dyslexia bug unpatched since 1977 ...
exploit has been leaked to the underground.



More information about the asterisk-dev mailing list