This list is closed, nobody may subscribe to it.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(13) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2006 |
Jan
(6) |
Feb
|
Mar
(5) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(1) |
Dec
|
2007 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Matthew N. <mni...@di...> - 2008-12-16 17:21:01
|
You can use the agitb module (similar to the cgitb module) to print python errors that occurred in scripts. There are no test frameworks that I know of. You can also test your scripts by running them directly from your shell and manually entering what asterisk would send to the script. Turn on agi debugging to get an idea of what that should look like. On Tue, 2008-12-16 at 16:58 +0100, ax21 wrote: > Is it possible to test pyst scripts somehow ? > > I need a framework where I can run the python scripts directly from > the comandline. > > It should be possible since its just STD messages > > > If this does not already exist, can someone point me to a possible > solution ? What Do I need to do in order to run the framework test > script, calling the AGI Script, which starts the agi instance. > Then Prints every STDOUT Message sent out, and receives the > agi.verbose() messages. > > It might be easier to develop on complex agi scripts this way, rather > than to call on the Asterisk channel on every change, and it wont > print python error stacks either > > > > sven > > > > > > > > > > > > this message is the second one, the first one has been gone out on > the wrong account name > > > > > > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew Nicholson Digium, Inc. | Software Developer |
From: ax21 <ax...@ax...> - 2008-12-16 15:59:04
|
Is it possible to test pyst scripts somehow ? I need a framework where I can run the python scripts directly from the comandline. It should be possible since its just STD messages If this does not already exist, can someone point me to a possible solution ? What Do I need to do in order to run the framework test script, calling the AGI Script, which starts the agi instance. Then Prints every STDOUT Message sent out, and receives the agi.verbose() messages. It might be easier to develop on complex agi scripts this way, rather than to call on the Asterisk channel on every change, and it wont print python error stacks either sven this message is the second one, the first one has been gone out on the wrong account name |
From: Matthew N. <mni...@di...> - 2008-06-04 21:58:42
|
I will send it to you off list. On Wed, 2008-06-04 at 17:46 -0300, Tito Garrido wrote: > Matthew, > > You have the email of the author? > > Thanks, > > Tito > > On Mon, Apr 14, 2008 at 2:41 PM, Matthew Nicholson > <mni...@di...> wrote: > > Ahh ok. Well I am not the original author. I sort of maintain the > > project now, but currently there is not active work on it, and I don't > > really plan to use it for any new projects at the moment. I don't know > > what the original author's motivation was. > > > > I worked on the project because I initially needed something to use > > asterisk agi with python. After using pyst for that I needed something > > to connect to the manager, and at the time pyst had a partially > > functioning manager component, which I morphed into a mostly functioning > > component. It still needs some work. > > > > On Mon, 2008-04-14 at 14:33 -0300, Tito Garrido wrote: > >> I'll have to mention pyst to use in my academic project... The only > >> documentation that I found was how I could use the manage.py... > >> I read the source code, but I want to know more about the > >> project ,like motivation, the author and etc.. > >> > >> Any information will be appreciated. > >> > >> Regards, > >> > >> Tito Garrido > >> > >> On Mon, Apr 14, 2008 at 2:03 PM, Matthew Nicholson > >> <mni...@di...> wrote: > >> On Sat, 2008-04-12 at 19:35 -0300, Tito Garrido wrote: > >> > Hi everybody! > >> > > >> > I'm from Brazil and I'm using pyst to make a XML-RPC > >> interface for > >> > Asterisk. It will be my project to graduate in Computer > >> Science... > >> > So.. this project is still active? I had read the archive > >> and the last > >> > message is at Sep 2007. :( > >> > > >> > I would like some information about the project, principally > >> about the > >> > interface with Manager. > >> > >> > >> What kind of information are you looking for? There is not a > >> lot of > >> documentation available. > >> -- > >> Matthew Nicholson > >> Digium > >> > >> > >> > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by the 2008 JavaOne(SM) > >> Conference > >> Don't miss this year's exciting event. There's still time to > >> save $100. > >> Use priority code J8TL2D2. > >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > >> _______________________________________________ > >> Pyst-users mailing list > >> Pys...@li... > >> https://lists.sourceforge.net/lists/listinfo/pyst-users > >> > >> > >> > >> > >> -- > >> Linux User #387870 > >> ____ > >> _/_õ|__| > >> º[ .-.___.-._| . . . . > >> _(o).__(o).:_____ > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > >> Don't miss this year's exciting event. There's still time to save $100. > >> Use priority code J8TL2D2. > >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > >> _______________________________________________ Pyst-users mailing list Pys...@li... https://lists.sourceforge.net/lists/listinfo/pyst-users > > -- > > Matthew Nicholson > > Digium > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > https://lists.sourceforge.net/lists/listinfo/pyst-users > > > > > > -- > Linux User #387870 > ____ > _/_õ|__| > º[ .-.___.-._| . . . . > _(o).__(o).:_____ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew Nicholson Digium |
From: Tito G. <tit...@gm...> - 2008-06-04 21:50:49
|
Matthew, You have the email of the author? Thanks, Tito On Mon, Apr 14, 2008 at 2:41 PM, Matthew Nicholson <mni...@di...> wrote: > Ahh ok. Well I am not the original author. I sort of maintain the > project now, but currently there is not active work on it, and I don't > really plan to use it for any new projects at the moment. I don't know > what the original author's motivation was. > > I worked on the project because I initially needed something to use > asterisk agi with python. After using pyst for that I needed something > to connect to the manager, and at the time pyst had a partially > functioning manager component, which I morphed into a mostly functioning > component. It still needs some work. > > On Mon, 2008-04-14 at 14:33 -0300, Tito Garrido wrote: >> I'll have to mention pyst to use in my academic project... The only >> documentation that I found was how I could use the manage.py... >> I read the source code, but I want to know more about the >> project ,like motivation, the author and etc.. >> >> Any information will be appreciated. >> >> Regards, >> >> Tito Garrido >> >> On Mon, Apr 14, 2008 at 2:03 PM, Matthew Nicholson >> <mni...@di...> wrote: >> On Sat, 2008-04-12 at 19:35 -0300, Tito Garrido wrote: >> > Hi everybody! >> > >> > I'm from Brazil and I'm using pyst to make a XML-RPC >> interface for >> > Asterisk. It will be my project to graduate in Computer >> Science... >> > So.. this project is still active? I had read the archive >> and the last >> > message is at Sep 2007. :( >> > >> > I would like some information about the project, principally >> about the >> > interface with Manager. >> >> >> What kind of information are you looking for? There is not a >> lot of >> documentation available. >> -- >> Matthew Nicholson >> Digium >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) >> Conference >> Don't miss this year's exciting event. There's still time to >> save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Pyst-users mailing list >> Pys...@li... >> https://lists.sourceforge.net/lists/listinfo/pyst-users >> >> >> >> >> -- >> Linux User #387870 >> ____ >> _/_õ|__| >> º[ .-.___.-._| . . . . >> _(o).__(o).:_____ >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ Pyst-users mailing list Pys...@li... https://lists.sourceforge.net/lists/listinfo/pyst-users > -- > Matthew Nicholson > Digium > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- Linux User #387870 ____ _/_õ|__| º[ .-.___.-._| . . . . _(o).__(o).:_____ |
From: Matthew N. <mni...@di...> - 2008-04-28 21:37:49
|
On Thu, 2008-04-24 at 22:49 +0200, Jan Müller wrote: > >> > >> # first build a list of the functions to execute > >> callbacks = self._event_callbacks.get(ev.name, []) > >> callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! > > >> This is a potential problem. In theory, if I understand what you are > >> saying correctly, each time an event is handled the '*' callback list > >> should get appended to the ev.name list. > right. an abstraction of the issue (aDict = self._event_callbacks, 'a' = > ev.name, 'b' = '*', aList = callbacks): > > >>> aDict = {'a': [1, 2], 'b': [3]} > >>> aList = aDict['a'] > >>> aList > [1, 2] > >>> aList.extend(aDict['b']) > >>> aList > [1, 2, 3] > >>> aDict > {'a': [1, 2, 3], 'b': [3]} ok > i fixed this in my private version of the class Manager. I used sets.Set > instead of lists, but that's just a minor remark. > > if i'm informed correctly, you are one of the fathers of Asterisk and > also have brought the Manager class to where it is. since i'm knitting on Well I am sort of the defacto lead developer of pyst (not Asterisk) which is what I think you meant. > i. a table-driven (and hence flexible) implementation of most (or all?) > API commands as Manager.methods, > ii. implementing some magic class customization __methods__, and > iii. refactoring the thread loops to reach a deeper understanding of > what's going on (I find the deeply nested while-loops a bit scary), > > i wonder if you might help me on some of the following questions: > > 0. does anyone mind if i keep on developing that? if this is not the > case, i'm willing to share my results, yet i'm myself a decent private > user and do not need unconditional, 100% reliability. so i would try and > react on bug reports, but i will not guarantee any stability whatsoever. Well the code is virtually unmaintained at the moment. If you would like to take over, I am fine with that. > 1. do you know how much the Python API is used, and whether backward > compatibility is an issue? I have not looked into this > 2. as to the refactoring: do you have a test harness of your development? No I do not. Usually I test against asterisk. > 3. i don't have much experience with multi-threading. can you tell me > what the major (possibly also open) issues were/are? I actually wanted to get rid of the threads. See http://tinyurl.com/49mpnt > 4. is there a chance to obtain a normalized (machine-readable) scheme of > the API commands and their syntax on-the-fly by asking the Asterisk/a > website? Hmm... from asterisk there is a ShowCommands manager action I think (or something similar to that). I don't know of any machine readable listings online. You also have to keep in mind that some manager actions are provided by the main/manager.c file in the asterisk core, but others are provided by modules, that may or may not be there depending on the configuration of the system. -- Matthew Nicholson Digium |
From: Jan M. <jpm...@gm...> - 2008-04-24 20:50:06
|
>> >> # first build a list of the functions to execute >> callbacks = self._event_callbacks.get(ev.name, []) >> callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! >> This is a potential problem. In theory, if I understand what you are >> saying correctly, each time an event is handled the '*' callback list >> should get appended to the ev.name list. right. an abstraction of the issue (aDict = self._event_callbacks, 'a' = ev.name, 'b' = '*', aList = callbacks): >>> aDict = {'a': [1, 2], 'b': [3]} >>> aList = aDict['a'] >>> aList [1, 2] >>> aList.extend(aDict['b']) >>> aList [1, 2, 3] >>> aDict {'a': [1, 2, 3], 'b': [3]} i fixed this in my private version of the class Manager. I used sets.Set instead of lists, but that's just a minor remark. if i'm informed correctly, you are one of the fathers of Asterisk and also have brought the Manager class to where it is. since i'm knitting on i. a table-driven (and hence flexible) implementation of most (or all?) API commands as Manager.methods, ii. implementing some magic class customization __methods__, and iii. refactoring the thread loops to reach a deeper understanding of what's going on (I find the deeply nested while-loops a bit scary), i wonder if you might help me on some of the following questions: 0. does anyone mind if i keep on developing that? if this is not the case, i'm willing to share my results, yet i'm myself a decent private user and do not need unconditional, 100% reliability. so i would try and react on bug reports, but i will not guarantee any stability whatsoever. 1. do you know how much the Python API is used, and whether backward compatibility is an issue? 2. as to the refactoring: do you have a test harness of your development? 3. i don't have much experience with multi-threading. can you tell me what the major (possibly also open) issues were/are? 4. is there a chance to obtain a normalized (machine-readable) scheme of the API commands and their syntax on-the-fly by asking the Asterisk/a website? regards j. |
From: Matthew N. <mni...@di...> - 2008-04-24 20:06:51
|
On Fri, 2008-04-18 at 23:09 +0200, Jan Müller wrote: > hi, > > triggered by the recent mailing list activities, i just began to scan > the code of manager.py, and i found this: > > def event_dispatch(self): > """This thread is responsible fore dispatching events""" > > # loop dispatching events > while self._running.isSet(): > # get/wait for an event > ev = self._event_queue.get() > > # if we got None as an event, we are finished > if not ev: > break > > # dispatch our events > > # first build a list of the functions to execute > callbacks = self._event_callbacks.get(ev.name, []) > callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! > > # now execute the functions > for callback in callbacks: > if callback(ev, self): > break > > what happens here is that the '*' callback handlers are explicitly added > to the (mutable) list of ev.name handlers. > i haven't tried it but this should lead to problems when unsubscribing a > '*' handler since it still remains an > ev.name handler. i suggest a list addition to prevent manipulation of > the list of ev.name handlers: > > [...] > # first build a list of the functions to execute > callbacks = self._event_callbacks.get(ev.name, []) + > self._event_callbacks.get('*', []) > [...] This is a potential problem. In theory, if I understand what you are saying correctly, each time an event is handled the '*' callback list should get appended to the ev.name list. -- Matthew Nicholson Digium |
From: Tito G. <tit...@gm...> - 2008-04-23 19:13:07
|
Ok, can u send to me? I'm using the traditional manager.py with some new methods like sippeers()... On Wed, Apr 23, 2008 at 1:59 PM, Jan Müller <jpm...@gm...> wrote: > Tito Garrido schrieb: > > Sorry, I didn't understand what you're trying to do... Could you > explain? > i'm basically streamlining and extending the Manager class for myself, > just wondered if anybody else is interested. > > 1. i fixed some minor bugs in the Manager class concerning > (un)registering events (see my former post) > > 2. i wrote a "one-fits-all" method for the Manager class which takes a > table (which is a manually edited cut-and-paste of the API command help) > as input and generates methods like manager.ping(), > manager.db_put(family, key, value), ... for _all_ simple manager actions > (which have just a simple response w/o events). > i just don't have a zap module running, so i didn't implement the "Zap*" > actions. anyway, i would really prefer an external machine-readable > table containing all API commands, their parameters, and their > documentation string, which is kept up-to-date by someone. Probably a > wiki author or even the asterisk developers might be interested as well > in a unified api command table. > > 3. i implemented methods sip_peers and db_get which register for the > query result events, then unregister again and return a list of Event > objects containing the data which was asked for. > > as already said, it's all pretty alpha, but very useful for me, and i'll > go on developing it for my needs. i passed it to stephen for a test drive. > > regards j. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- Linux User #387870 ____ _/_õ|__| º[ .-.___.-._| . . . . _(o).__(o).:_____ |
From: Jan M. <jpm...@gm...> - 2008-04-23 17:00:02
|
Tito Garrido schrieb: > Sorry, I didn't understand what you're trying to do... Could you explain? i'm basically streamlining and extending the Manager class for myself, just wondered if anybody else is interested. 1. i fixed some minor bugs in the Manager class concerning (un)registering events (see my former post) 2. i wrote a "one-fits-all" method for the Manager class which takes a table (which is a manually edited cut-and-paste of the API command help) as input and generates methods like manager.ping(), manager.db_put(family, key, value), ... for _all_ simple manager actions (which have just a simple response w/o events). i just don't have a zap module running, so i didn't implement the "Zap*" actions. anyway, i would really prefer an external machine-readable table containing all API commands, their parameters, and their documentation string, which is kept up-to-date by someone. Probably a wiki author or even the asterisk developers might be interested as well in a unified api command table. 3. i implemented methods sip_peers and db_get which register for the query result events, then unregister again and return a list of Event objects containing the data which was asked for. as already said, it's all pretty alpha, but very useful for me, and i'll go on developing it for my needs. i passed it to stephen for a test drive. regards j. |
From: Tito G. <tit...@gm...> - 2008-04-23 01:29:06
|
Sorry, I didn't understand what you're trying to do... Could you explain? On Tue, Apr 22, 2008 at 8:49 PM, Stephen Cattaneo < ste...@u4...> wrote: > Hi Jan, > Just send the file to stephen ( dot ) cattaneo ( at ) u4eatech ( dot ) > com > Cheers, > > Stephen > > Jan Müller wrote: > > Stephen Cattaneo schrieb: > > > >> Hi Jan, > >> > >> I would gladly use it, as far review goes, I think I'm too new to > >> asterisk for that. > >> > >> Cheers, > >> > >> Stephen > >> > >> Jan Müller wrote: > >> > >> > >>> hi, > >>> > >>> triggered by the recent mailing list activities, i just began to scan > >>> the code of manager.py, and i found this: > >>> > >>> def event_dispatch(self): > >>> """This thread is responsible fore dispatching events""" > >>> > >>> # loop dispatching events > >>> while self._running.isSet(): > >>> # get/wait for an event > >>> ev = self._event_queue.get() > >>> > >>> # if we got None as an event, we are finished > >>> if not ev: > >>> break > >>> > >>> # dispatch our events > >>> > >>> # first build a list of the functions to execute > >>> callbacks = self._event_callbacks.get(ev.name, []) > >>> callbacks.extend(self._event_callbacks.get('*', [])) # <- > !!! > >>> > >>> # now execute the functions > >>> for callback in callbacks: > >>> if callback(ev, self): > >>> break > >>> > >>> what happens here is that the '*' callback handlers are explicitly > added > >>> to the (mutable) list of ev.name handlers. > >>> i haven't tried it but this should lead to problems when unsubscribing > a > >>> '*' handler since it still remains an > >>> ev.name handler. i suggest a list addition to prevent manipulation of > >>> the list of ev.name handlers: > >>> > >>> [...] > >>> # first build a list of the functions to execute > >>> callbacks = self._event_callbacks.get(ev.name, []) + > >>> self._event_callbacks.get('*', []) > >>> [...] > >>> > >>> when i find time (might take a while), i might try and implement some > >>> more of the API in the Manager class for myself. > >>> > >>> for instance, for an event/callback driven command 'Action: sippeers', > i > >>> would implement a method that yields a set of the 'Event: PeerEntry' > >>> Events to spare a user the trouble of (un)subscribing a callback, > making > >>> up ActionIds, etc. > >>> > >>> anyone besides me interested in this, both using and reviewing it? > >>> > >>> regards, Jan > >>> > >>> > ------------------------------------------------------------------------- > >>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > >>> Don't miss this year's exciting event. There's still time to save > $100. > >>> Use priority code J8TL2D2. > >>> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > >>> _______________________________________________ > >>> Pyst-users mailing list > >>> Pys...@li... > >>> https://lists.sourceforge.net/lists/listinfo/pyst-users > >>> > >>> > >>> > >> > ------------------------------------------------------------------------- > >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > >> Don't miss this year's exciting event. There's still time to save $100. > >> Use priority code J8TL2D2. > >> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > >> _______________________________________________ > >> Pyst-users mailing list > >> Pys...@li... > >> https://lists.sourceforge.net/lists/listinfo/pyst-users > >> > >> > > hi stephen, > > > > there is a first alpha version ready. beware, it's not tested at all. if > > you wish to use or test it, please give me your mail address (or is it > > ok to paste a messy 1000-line code here?). > > > > to whom else it may concern: > > > > 1. i implemented a metamethod which takes the api help and generates > > methods for all simple (only response, no events) api actions from it: > > > > <code>[..., > > ('mailbox_status', 'MailboxStatus', """Action: MailboxStatus > > Synopsis: Check Mailbox > > Privilege: call,all > > Description: Checks a voicemail account for status. > > Variables: (Names marked with * are required) > > *mailbox: Full mailbox ID <mailbox>@<vm-context> > > actionid: Optional ActionID for message matching > > Returns number of messages. > > Message: Mailbox Status > > Mailbox: <mailboxid> > > Waiting: <count> > > """, ["mailbox", "actionid=None"]), > > ...] > > </code) > > yields > > <code> > > def mailbox_status(self, mailbox, actionid=None): > > [...] > > return self.send_action({'Action': 'MailboxStatus', 'mailbox': > > mailbox, 'actionid': actionid} # actionid only included if not None > > </code> > > so, extending it for other simple actions (e.g., "Zap..." which I did > > not implement because I have no zap module) boils down to adding some > > lines to a table. If the API doc stirngs were a little more > > standardized, one could even fully automatically parse the > documentation. > > > > 2. í also implemented event callback handlers for 'SipPeers' and > > 'DBGet'. the corresponding methods yield a list(Event) (method > > sip_peers) and an Event (method db_get). > > > > regards j. > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > https://lists.sourceforge.net/lists/listinfo/pyst-users > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- Linux User #387870 ____ _/_õ|__| º[ .-.___.-._| . . . . _(o).__(o).:_____ |
From: Stephen C. <ste...@u4...> - 2008-04-22 23:56:59
|
Hi Jan, Just send the file to stephen ( dot ) cattaneo ( at ) u4eatech ( dot ) com Cheers, Stephen Jan Müller wrote: > Stephen Cattaneo schrieb: > >> Hi Jan, >> >> I would gladly use it, as far review goes, I think I'm too new to >> asterisk for that. >> >> Cheers, >> >> Stephen >> >> Jan Müller wrote: >> >> >>> hi, >>> >>> triggered by the recent mailing list activities, i just began to scan >>> the code of manager.py, and i found this: >>> >>> def event_dispatch(self): >>> """This thread is responsible fore dispatching events""" >>> >>> # loop dispatching events >>> while self._running.isSet(): >>> # get/wait for an event >>> ev = self._event_queue.get() >>> >>> # if we got None as an event, we are finished >>> if not ev: >>> break >>> >>> # dispatch our events >>> >>> # first build a list of the functions to execute >>> callbacks = self._event_callbacks.get(ev.name, []) >>> callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! >>> >>> # now execute the functions >>> for callback in callbacks: >>> if callback(ev, self): >>> break >>> >>> what happens here is that the '*' callback handlers are explicitly added >>> to the (mutable) list of ev.name handlers. >>> i haven't tried it but this should lead to problems when unsubscribing a >>> '*' handler since it still remains an >>> ev.name handler. i suggest a list addition to prevent manipulation of >>> the list of ev.name handlers: >>> >>> [...] >>> # first build a list of the functions to execute >>> callbacks = self._event_callbacks.get(ev.name, []) + >>> self._event_callbacks.get('*', []) >>> [...] >>> >>> when i find time (might take a while), i might try and implement some >>> more of the API in the Manager class for myself. >>> >>> for instance, for an event/callback driven command 'Action: sippeers', i >>> would implement a method that yields a set of the 'Event: PeerEntry' >>> Events to spare a user the trouble of (un)subscribing a callback, making >>> up ActionIds, etc. >>> >>> anyone besides me interested in this, both using and reviewing it? >>> >>> regards, Jan >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>> Don't miss this year's exciting event. There's still time to save $100. >>> Use priority code J8TL2D2. >>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>> _______________________________________________ >>> Pyst-users mailing list >>> Pys...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyst-users >>> >>> >>> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Pyst-users mailing list >> Pys...@li... >> https://lists.sourceforge.net/lists/listinfo/pyst-users >> >> > hi stephen, > > there is a first alpha version ready. beware, it's not tested at all. if > you wish to use or test it, please give me your mail address (or is it > ok to paste a messy 1000-line code here?). > > to whom else it may concern: > > 1. i implemented a metamethod which takes the api help and generates > methods for all simple (only response, no events) api actions from it: > > <code>[..., > ('mailbox_status', 'MailboxStatus', """Action: MailboxStatus > Synopsis: Check Mailbox > Privilege: call,all > Description: Checks a voicemail account for status. > Variables: (Names marked with * are required) > *mailbox: Full mailbox ID <mailbox>@<vm-context> > actionid: Optional ActionID for message matching > Returns number of messages. > Message: Mailbox Status > Mailbox: <mailboxid> > Waiting: <count> > """, ["mailbox", "actionid=None"]), > ...] > </code) > yields > <code> > def mailbox_status(self, mailbox, actionid=None): > [...] > return self.send_action({'Action': 'MailboxStatus', 'mailbox': > mailbox, 'actionid': actionid} # actionid only included if not None > </code> > so, extending it for other simple actions (e.g., "Zap..." which I did > not implement because I have no zap module) boils down to adding some > lines to a table. If the API doc stirngs were a little more > standardized, one could even fully automatically parse the documentation. > > 2. í also implemented event callback handlers for 'SipPeers' and > 'DBGet'. the corresponding methods yield a list(Event) (method > sip_peers) and an Event (method db_get). > > regards j. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > |
From: Jan M. <jpm...@gm...> - 2008-04-22 23:45:05
|
Stephen Cattaneo schrieb: > Hi Jan, > > I would gladly use it, as far review goes, I think I'm too new to > asterisk for that. > > Cheers, > > Stephen > > Jan Müller wrote: > >> hi, >> >> triggered by the recent mailing list activities, i just began to scan >> the code of manager.py, and i found this: >> >> def event_dispatch(self): >> """This thread is responsible fore dispatching events""" >> >> # loop dispatching events >> while self._running.isSet(): >> # get/wait for an event >> ev = self._event_queue.get() >> >> # if we got None as an event, we are finished >> if not ev: >> break >> >> # dispatch our events >> >> # first build a list of the functions to execute >> callbacks = self._event_callbacks.get(ev.name, []) >> callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! >> >> # now execute the functions >> for callback in callbacks: >> if callback(ev, self): >> break >> >> what happens here is that the '*' callback handlers are explicitly added >> to the (mutable) list of ev.name handlers. >> i haven't tried it but this should lead to problems when unsubscribing a >> '*' handler since it still remains an >> ev.name handler. i suggest a list addition to prevent manipulation of >> the list of ev.name handlers: >> >> [...] >> # first build a list of the functions to execute >> callbacks = self._event_callbacks.get(ev.name, []) + >> self._event_callbacks.get('*', []) >> [...] >> >> when i find time (might take a while), i might try and implement some >> more of the API in the Manager class for myself. >> >> for instance, for an event/callback driven command 'Action: sippeers', i >> would implement a method that yields a set of the 'Event: PeerEntry' >> Events to spare a user the trouble of (un)subscribing a callback, making >> up ActionIds, etc. >> >> anyone besides me interested in this, both using and reviewing it? >> >> regards, Jan >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Pyst-users mailing list >> Pys...@li... >> https://lists.sourceforge.net/lists/listinfo/pyst-users >> >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > hi stephen, there is a first alpha version ready. beware, it's not tested at all. if you wish to use or test it, please give me your mail address (or is it ok to paste a messy 1000-line code here?). to whom else it may concern: 1. i implemented a metamethod which takes the api help and generates methods for all simple (only response, no events) api actions from it: <code>[..., ('mailbox_status', 'MailboxStatus', """Action: MailboxStatus Synopsis: Check Mailbox Privilege: call,all Description: Checks a voicemail account for status. Variables: (Names marked with * are required) *mailbox: Full mailbox ID <mailbox>@<vm-context> actionid: Optional ActionID for message matching Returns number of messages. Message: Mailbox Status Mailbox: <mailboxid> Waiting: <count> """, ["mailbox", "actionid=None"]), ...] </code) yields <code> def mailbox_status(self, mailbox, actionid=None): [...] return self.send_action({'Action': 'MailboxStatus', 'mailbox': mailbox, 'actionid': actionid} # actionid only included if not None </code> so, extending it for other simple actions (e.g., "Zap..." which I did not implement because I have no zap module) boils down to adding some lines to a table. If the API doc stirngs were a little more standardized, one could even fully automatically parse the documentation. 2. í also implemented event callback handlers for 'SipPeers' and 'DBGet'. the corresponding methods yield a list(Event) (method sip_peers) and an Event (method db_get). regards j. |
From: Stephen C. <ste...@u4...> - 2008-04-18 21:53:07
|
Hi Jan, I would gladly use it, as far review goes, I think I'm too new to asterisk for that. Cheers, Stephen Jan Müller wrote: > hi, > > triggered by the recent mailing list activities, i just began to scan > the code of manager.py, and i found this: > > def event_dispatch(self): > """This thread is responsible fore dispatching events""" > > # loop dispatching events > while self._running.isSet(): > # get/wait for an event > ev = self._event_queue.get() > > # if we got None as an event, we are finished > if not ev: > break > > # dispatch our events > > # first build a list of the functions to execute > callbacks = self._event_callbacks.get(ev.name, []) > callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! > > # now execute the functions > for callback in callbacks: > if callback(ev, self): > break > > what happens here is that the '*' callback handlers are explicitly added > to the (mutable) list of ev.name handlers. > i haven't tried it but this should lead to problems when unsubscribing a > '*' handler since it still remains an > ev.name handler. i suggest a list addition to prevent manipulation of > the list of ev.name handlers: > > [...] > # first build a list of the functions to execute > callbacks = self._event_callbacks.get(ev.name, []) + > self._event_callbacks.get('*', []) > [...] > > when i find time (might take a while), i might try and implement some > more of the API in the Manager class for myself. > > for instance, for an event/callback driven command 'Action: sippeers', i > would implement a method that yields a set of the 'Event: PeerEntry' > Events to spare a user the trouble of (un)subscribing a callback, making > up ActionIds, etc. > > anyone besides me interested in this, both using and reviewing it? > > regards, Jan > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > |
From: Jan M. <jpm...@gm...> - 2008-04-18 21:09:56
|
hi, triggered by the recent mailing list activities, i just began to scan the code of manager.py, and i found this: def event_dispatch(self): """This thread is responsible fore dispatching events""" # loop dispatching events while self._running.isSet(): # get/wait for an event ev = self._event_queue.get() # if we got None as an event, we are finished if not ev: break # dispatch our events # first build a list of the functions to execute callbacks = self._event_callbacks.get(ev.name, []) callbacks.extend(self._event_callbacks.get('*', [])) # <- !!! # now execute the functions for callback in callbacks: if callback(ev, self): break what happens here is that the '*' callback handlers are explicitly added to the (mutable) list of ev.name handlers. i haven't tried it but this should lead to problems when unsubscribing a '*' handler since it still remains an ev.name handler. i suggest a list addition to prevent manipulation of the list of ev.name handlers: [...] # first build a list of the functions to execute callbacks = self._event_callbacks.get(ev.name, []) + self._event_callbacks.get('*', []) [...] when i find time (might take a while), i might try and implement some more of the API in the Manager class for myself. for instance, for an event/callback driven command 'Action: sippeers', i would implement a method that yields a set of the 'Event: PeerEntry' Events to spare a user the trouble of (un)subscribing a callback, making up ActionIds, etc. anyone besides me interested in this, both using and reviewing it? regards, Jan |
From: Tito G. <tit...@gm...> - 2008-04-18 14:18:45
|
Hi Steve, I've expanded my asterisk.manager a little... so here is the sippeers method: def sippeers(self): cdict = {'Action' : 'Sippeers'} response = self.send_action(cdict) return response Tito Garrido On Thu, Apr 17, 2008 at 9:26 PM, Stephen Cattaneo < ste...@u4...> wrote: > Hi Tito, > > My asterisk.manager does not have a method sippeers() I downloaded the > pyst module from sourceforge. > ( http://sourceforge.net/project/showfiles.php?group_id=76162 ) > version = 0.2 > > Cheers, > > Steve > > Tito Garrido wrote: > > Try to use the method sippeers() and get the callback of the event > > PeerEntry. > > > > self.register_event('PeerEntry', self.handle_peerentry) > > > > def handle_peerentry(self, event, manager): > > var1 = event.message.get_header('ObjectName') > > var2 = event.message.get_header('Channeltype') > > var3 = event.message.get_header('Status') > > > > Something like this... > > > > Regards, > > > > Tito > > > > On Thu, Apr 17, 2008 at 3:11 PM, Matthew Nicholson > > <mni...@di... <mailto:mni...@di...>> wrote: > > > > In that case, that functionality may just be broken. > > > > On Thu, 2008-04-17 at 11:02 -0700, Stephen Cattaneo wrote: > > > Hi Matthew, > > > > > > Thanks for the response. > > > From the ami: > > > action: command > > > command: sip show peers > > > > > > Response: Follows > > > Privilege: Command > > > Name/username Host Dyn Nat ACL Port > > Status > > > 1044 (Unspecified) D 0 > > Unmonitored > > > 1045/1045 *MailScanner warning: numerical links > > are often malicious:* 192.168.14.218192. <http://192.168.14.218> > > D 5060 Unmonitored > > > 1001/1001_6187 *MailScanner warning: numerical links > > are often malicious:* 192.168.14.218192. <http://192.168.14.218> > > D 5060 Unmonitored > > > 2002 (Unspecified) D 0 > > Unmonitored > > > 2001/2001 *MailScanner warning: numerical links > > are often malicious:* 192.168.15.175192. <http://192.168.15.175> > > D 5060 Unmonitored > > > 5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, > 2 > > > offline] > > > --END COMMAND-- > > > > > > 'print asterManger.command('sip show peers').data' returns: > > > No clue what we got > > > --END COMMAND-- > > > > > > Name/username Host Dyn Nat ACL Port > > Status > > > > > > Matthew Nicholson wrote: > > > > Try something like 'print asterManger.command('sip show > > peers').data' > > > > and see if that works for you. > > > > > > > > On Thu, 2008-04-17 at 10:01 -0700, Stephen Cattaneo wrote: > > > > > > > >> Hello all, > > > >> > > > >> I was hoping to be able to view the list of registered sip > > peers using > > > >> asterisk.manager.command(). > > > >> Documentation seems to be pretty scarce. I would assume > either: > > > >> asterisk.manager.command('sip show peers') or > > > >> asterisk.manager.command('command: sip show peers') > > > >> to be the correct. Neither of these seem to work. Any help > > would be > > > >> appreciated. > > > >> > > > >> The following code returns: > > > >> No clue what we got > > > >> --END COMMAND-- > > > >> > > > >> thanks, > > > >> > > > >> Steve > > > >> > > > >> [code] > > > >> #!/usr/bin/python > > > >> > > > >> from asterisk import manager > > > >> > > > >> asterisk_ip = "*MailScanner has detected a possible fraud > > attempt from "192.168.13.3" claiming to be* > > 192.168.13.3192.168.13.3 <http://192.168.13.3>" > > > >> asterisk_user = "root" > > > >> asterisk_passwd = "voice123" > > > >> > > > >> def handle_shutdown(event, manager): > > > >> print "Received shutdown event" > > > >> manager.close() > > > >> > > > >> def handle_event(event, manager): > > > >> print "Received event: "+ event.name <http://event.name> > > > >> > > > >> asterManger = manager.Manager( ) > > > >> asterManger.connect( asterisk_ip ) > > > >> asterManger.login( asterisk_user, asterisk_passwd ) > > > >> > > > >> #register some call backs > > > >> asterManger.register_event('Shutdown', handle_shutdown) # > > shutdown > > > >> asterManger.register_event('*', handle_event) # > > catch all > > > >> > > > >> print asterManger.command('sip show peers') > > > >> > > > >> print asterManger.command('command: sip show peers') > > > >> [/code] > > > >> > > > >> > > > ------------------------------------------------------------------------- > > > >> This SF.net email is sponsored by the 2008 JavaOne(SM) > Conference > > > >> Don't miss this year's exciting event. There's still time to > > save $100. > > > >> Use priority code J8TL2D2. > > > >> > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaonewww > . > > < > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > > >> _______________________________________________ > > > >> Pyst-users mailing list > > > >> Pys...@li... > > <mailto:Pys...@li...> > > > >> https://lists.sourceforge.net/lists/listinfo/pyst-userswww. > > <https://lists.sourceforge.net/lists/listinfo/pyst-users> > > > >> > > > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > Don't miss this year's exciting event. There's still time to > > save $100. > > > Use priority code J8TL2D2. > > > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaonewww > . > > < > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > > _______________________________________________ > > > Pyst-users mailing list > > > Pys...@li... > > <mailto:Pys...@li...> > > > https://lists.sourceforge.net/lists/listinfo/pyst-userswww. > > <https://lists.sourceforge.net/lists/listinfo/pyst-users> > > -- > > Matthew Nicholson > > Digium > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save > > $100. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaonewww > . > > < > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > <mailto:Pys...@li...> > > https://lists.sourceforge.net/lists/listinfo/pyst-userswww. > > <https://lists.sourceforge.net/lists/listinfo/pyst-users> > > > > > > > > > > -- > > Linux User #387870 > > ____ > > _/_õ|__| > > º[ .-.___.-._| . . . . > > _(o).__(o).:_____ > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > https://lists.sourceforge.net/lists/listinfo/pyst-users > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- Linux User #387870 ____ _/_õ|__| º[ .-.___.-._| . . . . _(o).__(o).:_____ |
From: Stephen C. <ste...@u4...> - 2008-04-18 00:33:11
|
Hi Tito, My asterisk.manager does not have a method sippeers() I downloaded the pyst module from sourceforge. ( http://sourceforge.net/project/showfiles.php?group_id=76162 ) version = 0.2 Cheers, Steve Tito Garrido wrote: > Try to use the method sippeers() and get the callback of the event > PeerEntry. > > self.register_event('PeerEntry', self.handle_peerentry) > > def handle_peerentry(self, event, manager): > var1 = event.message.get_header('ObjectName') > var2 = event.message.get_header('Channeltype') > var3 = event.message.get_header('Status') > > Something like this... > > Regards, > > Tito > > On Thu, Apr 17, 2008 at 3:11 PM, Matthew Nicholson > <mni...@di... <mailto:mni...@di...>> wrote: > > In that case, that functionality may just be broken. > > On Thu, 2008-04-17 at 11:02 -0700, Stephen Cattaneo wrote: > > Hi Matthew, > > > > Thanks for the response. > > From the ami: > > action: command > > command: sip show peers > > > > Response: Follows > > Privilege: Command > > Name/username Host Dyn Nat ACL Port > Status > > 1044 (Unspecified) D 0 > Unmonitored > > 1045/1045 *MailScanner warning: numerical links > are often malicious:* 192.168.14.218192. <http://192.168.14.218> > D 5060 Unmonitored > > 1001/1001_6187 *MailScanner warning: numerical links > are often malicious:* 192.168.14.218192. <http://192.168.14.218> > D 5060 Unmonitored > > 2002 (Unspecified) D 0 > Unmonitored > > 2001/2001 *MailScanner warning: numerical links > are often malicious:* 192.168.15.175192. <http://192.168.15.175> > D 5060 Unmonitored > > 5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 2 > > offline] > > --END COMMAND-- > > > > 'print asterManger.command('sip show peers').data' returns: > > No clue what we got > > --END COMMAND-- > > > > Name/username Host Dyn Nat ACL Port > Status > > > > Matthew Nicholson wrote: > > > Try something like 'print asterManger.command('sip show > peers').data' > > > and see if that works for you. > > > > > > On Thu, 2008-04-17 at 10:01 -0700, Stephen Cattaneo wrote: > > > > > >> Hello all, > > >> > > >> I was hoping to be able to view the list of registered sip > peers using > > >> asterisk.manager.command(). > > >> Documentation seems to be pretty scarce. I would assume either: > > >> asterisk.manager.command('sip show peers') or > > >> asterisk.manager.command('command: sip show peers') > > >> to be the correct. Neither of these seem to work. Any help > would be > > >> appreciated. > > >> > > >> The following code returns: > > >> No clue what we got > > >> --END COMMAND-- > > >> > > >> thanks, > > >> > > >> Steve > > >> > > >> [code] > > >> #!/usr/bin/python > > >> > > >> from asterisk import manager > > >> > > >> asterisk_ip = "*MailScanner has detected a possible fraud > attempt from "192.168.13.3" claiming to be* > 192.168.13.3192.168.13.3 <http://192.168.13.3>" > > >> asterisk_user = "root" > > >> asterisk_passwd = "voice123" > > >> > > >> def handle_shutdown(event, manager): > > >> print "Received shutdown event" > > >> manager.close() > > >> > > >> def handle_event(event, manager): > > >> print "Received event: "+ event.name <http://event.name> > > >> > > >> asterManger = manager.Manager( ) > > >> asterManger.connect( asterisk_ip ) > > >> asterManger.login( asterisk_user, asterisk_passwd ) > > >> > > >> #register some call backs > > >> asterManger.register_event('Shutdown', handle_shutdown) # > shutdown > > >> asterManger.register_event('*', handle_event) # > catch all > > >> > > >> print asterManger.command('sip show peers') > > >> > > >> print asterManger.command('command: sip show peers') > > >> [/code] > > >> > > >> > ------------------------------------------------------------------------- > > >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > >> Don't miss this year's exciting event. There's still time to > save $100. > > >> Use priority code J8TL2D2. > > >> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaonewww. > <http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone> > > >> _______________________________________________ > > >> Pyst-users mailing list > > >> Pys...@li... > <mailto:Pys...@li...> > > >> https://lists.sourceforge.net/lists/listinfo/pyst-userswww. > <https://lists.sourceforge.net/lists/listinfo/pyst-users> > > >> > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to > save $100. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaonewww. > <http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone> > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > <mailto:Pys...@li...> > > https://lists.sourceforge.net/lists/listinfo/pyst-userswww. > <https://lists.sourceforge.net/lists/listinfo/pyst-users> > -- > Matthew Nicholson > Digium > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaonewww. > <http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone> > _______________________________________________ > Pyst-users mailing list > Pys...@li... > <mailto:Pys...@li...> > https://lists.sourceforge.net/lists/listinfo/pyst-userswww. > <https://lists.sourceforge.net/lists/listinfo/pyst-users> > > > > > -- > Linux User #387870 > ____ > _/_õ|__| > º[ .-.___.-._| . . . . > _(o).__(o).:_____ > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > ------------------------------------------------------------------------ > > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > |
From: Tito G. <tit...@gm...> - 2008-04-17 21:54:15
|
Try to use the method sippeers() and get the callback of the event PeerEntry. self.register_event('PeerEntry', self.handle_peerentry) def handle_peerentry(self, event, manager): var1 = event.message.get_header('ObjectName') var2 = event.message.get_header('Channeltype') var3 = event.message.get_header('Status') Something like this... Regards, Tito On Thu, Apr 17, 2008 at 3:11 PM, Matthew Nicholson <mni...@di...> wrote: > In that case, that functionality may just be broken. > > On Thu, 2008-04-17 at 11:02 -0700, Stephen Cattaneo wrote: > > Hi Matthew, > > > > Thanks for the response. > > From the ami: > > action: command > > command: sip show peers > > > > Response: Follows > > Privilege: Command > > Name/username Host Dyn Nat ACL Port Status > > 1044 (Unspecified) D 0 > Unmonitored > > 1045/1045 192.168.14.218 D 5060 > Unmonitored > > 1001/1001_6187 192.168.14.218 D 5060 > Unmonitored > > 2002 (Unspecified) D 0 > Unmonitored > > 2001/2001 192.168.15.175 D 5060 > Unmonitored > > 5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 2 > > offline] > > --END COMMAND-- > > > > 'print asterManger.command('sip show peers').data' returns: > > No clue what we got > > --END COMMAND-- > > > > Name/username Host Dyn Nat ACL Port Status > > > > Matthew Nicholson wrote: > > > Try something like 'print asterManger.command('sip show peers').data' > > > and see if that works for you. > > > > > > On Thu, 2008-04-17 at 10:01 -0700, Stephen Cattaneo wrote: > > > > > >> Hello all, > > >> > > >> I was hoping to be able to view the list of registered sip peers > using > > >> asterisk.manager.command(). > > >> Documentation seems to be pretty scarce. I would assume either: > > >> asterisk.manager.command('sip show peers') or > > >> asterisk.manager.command('command: sip show peers') > > >> to be the correct. Neither of these seem to work. Any help would be > > >> appreciated. > > >> > > >> The following code returns: > > >> No clue what we got > > >> --END COMMAND-- > > >> > > >> thanks, > > >> > > >> Steve > > >> > > >> [code] > > >> #!/usr/bin/python > > >> > > >> from asterisk import manager > > >> > > >> asterisk_ip = "192.168.13.3" > > >> asterisk_user = "root" > > >> asterisk_passwd = "voice123" > > >> > > >> def handle_shutdown(event, manager): > > >> print "Received shutdown event" > > >> manager.close() > > >> > > >> def handle_event(event, manager): > > >> print "Received event: "+ event.name > > >> > > >> asterManger = manager.Manager( ) > > >> asterManger.connect( asterisk_ip ) > > >> asterManger.login( asterisk_user, asterisk_passwd ) > > >> > > >> #register some call backs > > >> asterManger.register_event('Shutdown', handle_shutdown) # shutdown > > >> asterManger.register_event('*', handle_event) # catch all > > >> > > >> print asterManger.command('sip show peers') > > >> > > >> print asterManger.command('command: sip show peers') > > >> [/code] > > >> > > >> > ------------------------------------------------------------------------- > > >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > >> Don't miss this year's exciting event. There's still time to save > $100. > > >> Use priority code J8TL2D2. > > >> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > >> _______________________________________________ > > >> Pyst-users mailing list > > >> Pys...@li... > > >> https://lists.sourceforge.net/lists/listinfo/pyst-users > > >> > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- > Matthew Nicholson > Digium > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- Linux User #387870 ____ _/_õ|__| º[ .-.___.-._| . . . . _(o).__(o).:_____ |
From: Matthew N. <mni...@di...> - 2008-04-17 18:11:45
|
In that case, that functionality may just be broken. On Thu, 2008-04-17 at 11:02 -0700, Stephen Cattaneo wrote: > Hi Matthew, > > Thanks for the response. > From the ami: > action: command > command: sip show peers > > Response: Follows > Privilege: Command > Name/username Host Dyn Nat ACL Port Status > 1044 (Unspecified) D 0 Unmonitored > 1045/1045 192.168.14.218 D 5060 Unmonitored > 1001/1001_6187 192.168.14.218 D 5060 Unmonitored > 2002 (Unspecified) D 0 Unmonitored > 2001/2001 192.168.15.175 D 5060 Unmonitored > 5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 2 > offline] > --END COMMAND-- > > 'print asterManger.command('sip show peers').data' returns: > No clue what we got > --END COMMAND-- > > Name/username Host Dyn Nat ACL Port Status > > Matthew Nicholson wrote: > > Try something like 'print asterManger.command('sip show peers').data' > > and see if that works for you. > > > > On Thu, 2008-04-17 at 10:01 -0700, Stephen Cattaneo wrote: > > > >> Hello all, > >> > >> I was hoping to be able to view the list of registered sip peers using > >> asterisk.manager.command(). > >> Documentation seems to be pretty scarce. I would assume either: > >> asterisk.manager.command('sip show peers') or > >> asterisk.manager.command('command: sip show peers') > >> to be the correct. Neither of these seem to work. Any help would be > >> appreciated. > >> > >> The following code returns: > >> No clue what we got > >> --END COMMAND-- > >> > >> thanks, > >> > >> Steve > >> > >> [code] > >> #!/usr/bin/python > >> > >> from asterisk import manager > >> > >> asterisk_ip = "192.168.13.3" > >> asterisk_user = "root" > >> asterisk_passwd = "voice123" > >> > >> def handle_shutdown(event, manager): > >> print "Received shutdown event" > >> manager.close() > >> > >> def handle_event(event, manager): > >> print "Received event: "+ event.name > >> > >> asterManger = manager.Manager( ) > >> asterManger.connect( asterisk_ip ) > >> asterManger.login( asterisk_user, asterisk_passwd ) > >> > >> #register some call backs > >> asterManger.register_event('Shutdown', handle_shutdown) # shutdown > >> asterManger.register_event('*', handle_event) # catch all > >> > >> print asterManger.command('sip show peers') > >> > >> print asterManger.command('command: sip show peers') > >> [/code] > >> > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > >> Don't miss this year's exciting event. There's still time to save $100. > >> Use priority code J8TL2D2. > >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > >> _______________________________________________ > >> Pyst-users mailing list > >> Pys...@li... > >> https://lists.sourceforge.net/lists/listinfo/pyst-users > >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew Nicholson Digium |
From: Stephen C. <ste...@u4...> - 2008-04-17 18:08:19
|
Hi Matthew, Thanks for the response. From the ami: action: command command: sip show peers Response: Follows Privilege: Command Name/username Host Dyn Nat ACL Port Status 1044 (Unspecified) D 0 Unmonitored 1045/1045 192.168.14.218 D 5060 Unmonitored 1001/1001_6187 192.168.14.218 D 5060 Unmonitored 2002 (Unspecified) D 0 Unmonitored 2001/2001 192.168.15.175 D 5060 Unmonitored 5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 2 offline] --END COMMAND-- 'print asterManger.command('sip show peers').data' returns: No clue what we got --END COMMAND-- Name/username Host Dyn Nat ACL Port Status Matthew Nicholson wrote: > Try something like 'print asterManger.command('sip show peers').data' > and see if that works for you. > > On Thu, 2008-04-17 at 10:01 -0700, Stephen Cattaneo wrote: > >> Hello all, >> >> I was hoping to be able to view the list of registered sip peers using >> asterisk.manager.command(). >> Documentation seems to be pretty scarce. I would assume either: >> asterisk.manager.command('sip show peers') or >> asterisk.manager.command('command: sip show peers') >> to be the correct. Neither of these seem to work. Any help would be >> appreciated. >> >> The following code returns: >> No clue what we got >> --END COMMAND-- >> >> thanks, >> >> Steve >> >> [code] >> #!/usr/bin/python >> >> from asterisk import manager >> >> asterisk_ip = "192.168.13.3" >> asterisk_user = "root" >> asterisk_passwd = "voice123" >> >> def handle_shutdown(event, manager): >> print "Received shutdown event" >> manager.close() >> >> def handle_event(event, manager): >> print "Received event: "+ event.name >> >> asterManger = manager.Manager( ) >> asterManger.connect( asterisk_ip ) >> asterManger.login( asterisk_user, asterisk_passwd ) >> >> #register some call backs >> asterManger.register_event('Shutdown', handle_shutdown) # shutdown >> asterManger.register_event('*', handle_event) # catch all >> >> print asterManger.command('sip show peers') >> >> print asterManger.command('command: sip show peers') >> [/code] >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Pyst-users mailing list >> Pys...@li... >> https://lists.sourceforge.net/lists/listinfo/pyst-users >> |
From: Matthew N. <mni...@di...> - 2008-04-17 17:25:56
|
Try something like 'print asterManger.command('sip show peers').data' and see if that works for you. On Thu, 2008-04-17 at 10:01 -0700, Stephen Cattaneo wrote: > Hello all, > > I was hoping to be able to view the list of registered sip peers using > asterisk.manager.command(). > Documentation seems to be pretty scarce. I would assume either: > asterisk.manager.command('sip show peers') or > asterisk.manager.command('command: sip show peers') > to be the correct. Neither of these seem to work. Any help would be > appreciated. > > The following code returns: > No clue what we got > --END COMMAND-- > > thanks, > > Steve > > [code] > #!/usr/bin/python > > from asterisk import manager > > asterisk_ip = "192.168.13.3" > asterisk_user = "root" > asterisk_passwd = "voice123" > > def handle_shutdown(event, manager): > print "Received shutdown event" > manager.close() > > def handle_event(event, manager): > print "Received event: "+ event.name > > asterManger = manager.Manager( ) > asterManger.connect( asterisk_ip ) > asterManger.login( asterisk_user, asterisk_passwd ) > > #register some call backs > asterManger.register_event('Shutdown', handle_shutdown) # shutdown > asterManger.register_event('*', handle_event) # catch all > > print asterManger.command('sip show peers') > > print asterManger.command('command: sip show peers') > [/code] > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew Nicholson Digium |
From: Stephen C. <ste...@u4...> - 2008-04-17 17:08:17
|
Hello all, I was hoping to be able to view the list of registered sip peers using asterisk.manager.command(). Documentation seems to be pretty scarce. I would assume either: asterisk.manager.command('sip show peers') or asterisk.manager.command('command: sip show peers') to be the correct. Neither of these seem to work. Any help would be appreciated. The following code returns: No clue what we got --END COMMAND-- thanks, Steve [code] #!/usr/bin/python from asterisk import manager asterisk_ip = "192.168.13.3" asterisk_user = "root" asterisk_passwd = "voice123" def handle_shutdown(event, manager): print "Received shutdown event" manager.close() def handle_event(event, manager): print "Received event: "+ event.name asterManger = manager.Manager( ) asterManger.connect( asterisk_ip ) asterManger.login( asterisk_user, asterisk_passwd ) #register some call backs asterManger.register_event('Shutdown', handle_shutdown) # shutdown asterManger.register_event('*', handle_event) # catch all print asterManger.command('sip show peers') print asterManger.command('command: sip show peers') [/code] |
From: Matthew N. <mni...@di...> - 2008-04-14 17:41:24
|
Ahh ok. Well I am not the original author. I sort of maintain the project now, but currently there is not active work on it, and I don't really plan to use it for any new projects at the moment. I don't know what the original author's motivation was. I worked on the project because I initially needed something to use asterisk agi with python. After using pyst for that I needed something to connect to the manager, and at the time pyst had a partially functioning manager component, which I morphed into a mostly functioning component. It still needs some work. On Mon, 2008-04-14 at 14:33 -0300, Tito Garrido wrote: > I'll have to mention pyst to use in my academic project... The only > documentation that I found was how I could use the manage.py... > I read the source code, but I want to know more about the > project ,like motivation, the author and etc.. > > Any information will be appreciated. > > Regards, > > Tito Garrido > > On Mon, Apr 14, 2008 at 2:03 PM, Matthew Nicholson > <mni...@di...> wrote: > On Sat, 2008-04-12 at 19:35 -0300, Tito Garrido wrote: > > Hi everybody! > > > > I'm from Brazil and I'm using pyst to make a XML-RPC > interface for > > Asterisk. It will be my project to graduate in Computer > Science... > > So.. this project is still active? I had read the archive > and the last > > message is at Sep 2007. :( > > > > I would like some information about the project, principally > about the > > interface with Manager. > > > What kind of information are you looking for? There is not a > lot of > documentation available. > -- > Matthew Nicholson > Digium > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) > Conference > Don't miss this year's exciting event. There's still time to > save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > > > > > -- > Linux User #387870 > ____ > _/_õ|__| > º[ .-.___.-._| . . . . > _(o).__(o).:_____ > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ Pyst-users mailing list Pys...@li... https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew Nicholson Digium |
From: Tito G. <tit...@gm...> - 2008-04-14 17:33:33
|
I'll have to mention pyst to use in my academic project... The only documentation that I found was how I could use the manage.py... I read the source code, but I want to know more about the project ,like motivation, the author and etc.. Any information will be appreciated. Regards, Tito Garrido On Mon, Apr 14, 2008 at 2:03 PM, Matthew Nicholson <mni...@di...> wrote: > On Sat, 2008-04-12 at 19:35 -0300, Tito Garrido wrote: > > Hi everybody! > > > > I'm from Brazil and I'm using pyst to make a XML-RPC interface for > > Asterisk. It will be my project to graduate in Computer Science... > > So.. this project is still active? I had read the archive and the last > > message is at Sep 2007. :( > > > > I would like some information about the project, principally about the > > interface with Manager. > > What kind of information are you looking for? There is not a lot of > documentation available. > -- > Matthew Nicholson > Digium > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > -- Linux User #387870 ____ _/_õ|__| º[ .-.___.-._| . . . . _(o).__(o).:_____ |
From: Matthew N. <mni...@di...> - 2008-04-14 17:03:27
|
On Sat, 2008-04-12 at 19:35 -0300, Tito Garrido wrote: > Hi everybody! > > I'm from Brazil and I'm using pyst to make a XML-RPC interface for > Asterisk. It will be my project to graduate in Computer Science... > So.. this project is still active? I had read the archive and the last > message is at Sep 2007. :( > > I would like some information about the project, principally about the > interface with Manager. What kind of information are you looking for? There is not a lot of documentation available. -- Matthew Nicholson Digium |
From: Matthew N. <mni...@di...> - 2008-04-14 17:02:37
|
This is probably possible. If you track the time between Link and Unlink events, in theory that should be the talk time. On Sat, 2008-04-12 at 20:41 -0700, FERNANDO VILLARROEL wrote: > Hello List. > > It is possible using manager.py obtain the duration of > the call in real time while the user talks? > > Any example or idea. > > Thanks > > Fernando Villarroel N. > Chile. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew Nicholson Digium |