[asterisk-dev] manager interface , question

Matt Florell astmattf at gmail.com
Mon Mar 13 17:39:32 MST 2006


If you really want to see some wacky stuff, try placing some calls
over the Local/ channel. It kind of throws all sorts of standard
Manager API output behaviours out the window.

In other words, you cannot depend on a set number of link/unlink
events or much else for that matter, there are a lot of
inconsistencies in the Manager output and it is in part because
Asterisk is so flexible that many functions need to break the "rules"
in order to work properly. It took us(astGUIclient project) weeks at
first to figure out how exactly to track Local/ channel calls and a
lot of things changed from 1.0.X to 1.2.X which threw a lot of that
out the window as well.

I would suggest a more flexible parser that is tolerant of missing
some output from the Manager as well as one that will update channel
states when it can. It's not the most beautiful solution but it will
probably be the most reliable for you especially on a heavily loaded
system.

MATT---

On 3/13/06, Piotr Chytla <pch at packetconsulting.pl> wrote:
> 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.
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



More information about the asterisk-dev mailing list