login | register
Sat 05 of Jul, 2008 [23:20 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Samuel, Thu 03 of Jul, 2008 [13:41 UTC]: ok thank you
  • Mats Karlsson, Thu 03 of Jul, 2008 [13:37 UTC]: Nice Samuel, will look forward to rad it.
  • bwl_fernstudent, Thu 03 of Jul, 2008 [09:08 UTC]: Your blog shows some usefull code
  • Samuel, Thu 03 of Jul, 2008 [08:04 UTC]: I'll translate it, for sure
  • Mats Karlsson, Wed 02 of Jul, 2008 [20:46 UTC]: LOL, in french! Translate it to English and I will read it.
  • Samuel, Wed 02 of Jul, 2008 [08:07 UTC]: Hello, i wrote a blog about Asterisk, speaking about installation,programming and more http://sambranche.blogspot.com/
  • Nick Barnes, Tue 01 of Jul, 2008 [17:46 UTC]: Steve - Asterisk doesn't 'fit into linux' - it's an application which runs on top of Linux.
  • Steve, Mon 30 of Jun, 2008 [18:07 UTC]: anyone know where I can find a block diagram of how asterisk fits into linux. my f'ing bosses want me to draw something up.. ugh.
  • akbar, Fri 27 of Jun, 2008 [10:37 UTC]: marley_boyz@yahoo.com how to configure call forward, call back, call pick up using TDM and asterisk 1.2.13... please help me.. thx...
  • Matthew Williams, Tue 24 of Jun, 2008 [22:37 UTC]: We are looking for Tier II VoIP Support Technicians in St Louis. Send resumes to mwilliams AT voxitas DOT com.
Server Stats
  • Execution time: 0.37s
  • Memory usage: 2.60MB
  • Database queries: 33
  • GZIP: Disabled
  • Server load: 0.86

AstManProxy

AstManProxy is a multi-threaded proxy server for Asterisk written in C/P-threads. It is designed to handle communication with multiple Asterisk servers and to act as a single point of contact for applications. Astmanproxy supports multiple input/output formats, including Standard, XML, CSV, and HTTP, HTTPS and SSL.

It has been under development since April 2005 and is currently at version 1.21.




Astmanproxy is the fast, flexible proxy server for Asterisk's Manager Interface. With version 1.21, Astmanproxy allows you to
communicate with multiple Asterisk boxes from a single point of contact using a variety of I/O formats, now including support for XML, HTTP, HTTPS, SSL, CSV, and the Asterisk-native standard format. Astmanproxy is written in c/pthreads (just like Asterisk) for speed and robustness.

Many other features have been added, including a new authentication layer and support for the Action: Challenge MD5 authentication method. SSL is now supported, so you can encrypt from client->proxy->asterisk, end-to-end.
Talking to Asterisk via SSL requires that you are running an SSL-capable version of Asterisk (see bugs.digium.com #6812), but if you're not ready to do that then you can talk client->proxy via SSL.

One really interesting side effect of having both SSL and HTTP support natively is that we in fact now support HTTPS!

With the proxy configured on localhost:1234, you can do things along these lines:

https://localhost:1234/?Action=ShowChannels&ActionID=Foo

This has been tested extensively with good results. The HTTP handler supports both GET and POST and can properly deal with XML or Standard output formats. With Autofilter=on, this paradigm is ideal for creating a simple REST-like interface into Asterisk (even multiple boxes!) with no web servers needed.

Digium has graciously offered the use of their SVN community server to host Astmanproxy development.

For the 1.21 release, 'svn checkout' from:

For the development trunk (cvs-head), checkout:

And there is a yahoo-groups mailing list here for users and developers of Astmanproxy:

There are many new features, changes, and enhancements. Please check them out and get us your feedback! We would love to hear what you think!

Gaetan Minet provides a patch that fixes the ActionID which are ignored during authentication in the standard distribution. The modified version with the patch applied now works with common libraries for the Manager API like Asterisk-Java.

Additional Background Information on AstManProxy:

Developing web-based realtime applications for the asterisk open-source PBX often requires interacting with asterisk's Manager interface. The Asterisk Manager runs on port 5038 by default and provides a simple TCP interface into several common asterisk functions, including call origination, redirection, hangup, and many other functions.

Each interaction from a web-based application requires a separate connection to the manager interface. Asterisk, being a real time
application, shouldn't have to deal with the load of constant connections, disconnections, and authentications from a single trusted client, namely your web app.

In the same way that web developers have solved this problem for other similar services (imapproxy for IMAP web mail clients, database connection caches, etc), 'astmanproxy' sets out to solve this problem for asterisk.

This project started out as a simple proof-of-concept script called "simpleproxy.pl" which was made available in September 2004, following a discussion at the Astricon conference regarding the need for such a proxy. That code was based on Nicolas Gudino's manager proxy for his excellent Flash Operator Panel. Written in perl and as a single-threaded select-based "dumb" proxy, simpleproxy.pl has been widely used as a basis for experimentation, but I wanted something more robust and that could act as a basis for additional features.

Asterisk Manager Proxy is a multithreaded proxy server for Asterisk Manager written in c, and based on several of the same data structures and routines found in the asterisk manager itself. This insures a very high degree of compatibility with Asterisk; it should also be very robust and scalable.

Asterisk Manager Proxy gives the ability to support multiple input and output formats, configurable on a per-client basis.
Created by davetroy, Last modification by srt on Tue 02 of Oct, 2007 [00:23 UTC]

Comments Filter

About the ActionID Patch

by Thilo Stallherm on Monday 11 of February, 2008 [17:54:12 UTC]
The ActionID-Patch segfaults Astmanproxy when authentication fails.

fix (also mailed to author):

diff -ruN astmanproxy-1.21.backup/src/proxyfunc.c astmanproxy-1.21/src/proxyfunc.c

+++ astmanproxy-1.21/src/proxyfunc.c 2008-02-11 18:27:31.000000000 +0100 @@ -185,9 +185,9 @@
       pthread_mutex_unlock(&userslock);

       if( !pu ) {
- AddHeader(&m, "Response: Error");
+ AddHeader(&mo, "Response: Error");                AddHeader(&mo, "ActionID: %s", actionID);
- AddHeader(&m, "Message: Authentication failed");
+ AddHeader(&mo, "Message: Authentication failed");                s->output->write(s, &mo);
               pthread_mutex_lock(&s->lock);
               s->authenticated = 0;

Sane XML Output type Patch

by trapped_vector on Monday 14 of January, 2008 [16:33:38 UTC]
Hi,
noticed that the XML stream output by astmanproxy doesnt conform to specs. For interested ones, below is a patch that does that bit.

xml.c 2007-12-26 09:55:56.000000000 -0600
@@ -76,8 +76,7 @@

      pthread_mutex_lock(&s->lock);
      ast_carefulwrite(s->fd, buf, strlen(buf), s->writetimeout);
- strcpy (outstring,"Content-Type:");
- strcat (outstring,"text/xml\r\n\r\n");
+ strcpy (outstring,"Content-Type:text/xml\r\n\r\n");
      for (i=0; i<m->hdrcount; i++) {
              memset(xmlescaped, 0, sizeof xmlescaped);
@@ -87,11 +86,15 @@
              if (dpos && *(lpos)!= ' ' && strlen(xmlescaped)<30 ) {
                      strcat(outstring, " <");
                      strncat(outstring, lpos, dpos-lpos);
- strcat(outstring, " Value=\"");
+ strcat(outstring, ">");                       strncat(outstring, dpos+2, strlen(dpos)-2);
- strcat(outstring, "\"/>\r\n");
+ strcat(outstring, " </"); + strncat(outstring, lpos, dpos-lpos); + strcat(outstring, ">\r\n");               } else
- sprintf(outstring, " <%s Value=\"%s\"/>\r\n",XML_UNPARSED, lpos);
+ sprintf(outstring, " <NaVs</%s>\r\n",XML_UNPARSED, lpos,XML_UNPARSED); + +               ast_carefulwrite(s->fd, outstring, strlen(outstring),s->writetimeout);
      }
      sprintf(buf, "</%s>\r\n\r\n", xmldoctag);



Apply the patch be entering the src directory, then run it.
Run the change only by running the following.
gcc -Wall -O2 -D_REENTRANT -fPIC -Isrc/include -I/usr/include/openssl -I- '-DPROXY_VERSION="1.21"' '-DCDIR="/etc/asterisk"' '-DCFILE="astmanproxy.conf"' '-DMDIR="/usr/lib/astmanproxy/modules"' '-DPDIR="/etc/asterisk"' '-DPFILE="astmanproxy.users"' -c -o xml.o src/xml.c gcc -shared -Xlinker -x xml.o -o xml.so
install xml.so standard.so csv.so http.so /usr/lib/astmanproxy/modules


regards,
ashutosh
nextstag
ashutosh DOT kumars AT gmail DOT com

About the XML Interface...

by telenieko on Wednesday 28 of December, 2005 [22:24:16 UTC]
Where can I read more about that speciffic point? (I mean, the point about not to add XML Interface on the Asterisk core)
Thanks, Marc.
    >>>> Mark Spencer has made it clear that he does not want to add XML interfaces into the Asterisk core. This is an understandable design decision. 


Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver