[asterisk-dev] Asterisk Manager/Gateway Interface SOAP (gSOAP)

Gregory Nietsky gregnietsky at gmail.com
Sat Sep 22 07:04:56 CDT 2007


i have a requirement for sending AMI events to a Commercial CRM server
for things like  inbound call notification and data push to the client.

there 2 approaches the invasive and non invasive approach the non
invasive is a simple daemon/soap client that fires off a packet when one
is received
a rather trivial task ..the invasive approach will be to compile the
bindings for a predefined WSDL file into a shared lib with gSOAP this
will be linked to
asterisk and any manager event will be sent to to the current AMI and
fired off in a soap envelope to the configured server.

wether it is done as a standalone daemon or integrated the generation of
the WSDL is the key i have one that im using on apache/php for sending
CLI commands and reading responces from a drop down list of servers
uptime/show chan/sip show peer .... im extending this to sending events
and prehaps this should be hooked into the webserver on asterisk instead
of apache running on the box ...to make asterisk 100% SOAP ... allowing
for some some interesting  possibilities ...Email  integration  more
consoles with wider features ....

if you got so far you might be asking about licencing ...

gSOAP is released under 3 licences allowing for commercial use alongside
the GPL

The gSOAP Public License 1.3
<http://www.cs.fsu.edu/%7Eengelen/license.html> is based on MPL1.1
<http://www.opensource.org> (Mozilla Public License 1.1).

The license allows for commercial and non-commercial use of gSOAP
without fees or royalties. It also allows products to be built on top
and distributed under any license (including commercial). Products
developed with gSOAP should include a notice of copyright and a
disclaimer of warranty in the product's documentation (License Exhibit B).

The gSOAP public license requires modifications that are distributed as
part of an open source product based on gSOAP to be submitted back to us.

Note that the wsdl2h tool, UDDI code, Web server, and sample
applications are NOT covered by the gSOAP public license. These are
offered under a choice of GPL or commercial licensing.

this does get a bit murky as the code generated from the parser is done
so under the GPL or there own 195$ comercial licence.there is no need
for concern if the parser is not used and the header file is programed
correctly (this is prefered as the WSDL file can be generated from this
header saving the pain of setting up a WSDL file)

http://www.genivia.com/Products/gsoap/GeniviaGSoapLicense.pdf

prehaps this is a problem for digium ??

gSOAP consists of a WSDL parser and header file generator (wsdl2h) this
is a code generator in a similar way to flex/bison there is then a soap
skeleton/stub compiler that generates the C code
(dont be mislead by cpp it does both C/C++) once this is done it is a
matter of compiling the stub with a distributed file to buld the lib to
be linked to a application

here is a example to build a base lib to interface with amazon ...

wsdl2h -c -o amazon.h 
http://soap.amazon.com/schemas2/AmazonWebServices.wsdl
soapcpp2 -c -pamazon amazon.h
gcc -fPIC -shared -o libamazon.so
<PATH_TO_GSOAP_SRC>/soapcpp2/stdsoap2.c amazonC.c amazonClientLib.c
gcc -o amazon amazon.c -L. -lamazon
./amazon <DEVKEY free from www.amazonaws.com> <SEARCH KEY>

if any one wants if a 46 line program that does a search on amazon and
lists the first 10 books matching the key word that links to this lib
.... of witch < 10 lines are the business bit 2 includes and the
function call / error check.

the idea will be to

#ifdef SOAP_AMI
#include ...
#endif

in manager.c in manager_event???  ... fire off a soap measage

#ifdef SOAP_AMI
send message/check for error ...
#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070922/2039eaf6/attachment.htm 


More information about the asterisk-dev mailing list