[asterisk-dev] Asterisk Library (.so) Files

Atis Lezdins atis at iq-labs.net
Wed Oct 17 10:01:31 CDT 2007


On Wednesday 17 October 2007 17:44:32 Lee Jenkins wrote:
> Lee Jenkins wrote:
> > Lee Jenkins wrote:
> >> I'm a bit new to linux and Asterisk, been using both for about a year
> >> now.  I have written a few AGI applications using Lazarus/Freepascal
> >> which is nice for me because they are natively compiled executables and
> >> I am already proficient in ObjectPascal.
> >>
> >> I'm wondering if I could create an .so module and then be able to call
> >> its function/s directly from Asterisk and register it as an application
> >> instead of using AGI calls?
> >>
> >> I've written many DLL's for Windows (in Delphi), but no .so libraries
> >> for linux as of yet, but I would assume that this would work as long as
> >> the .so library was using correct calling convention such as cdecl???
> >
> > Let me expound on this as I may not have been clear on what I'm asking.
> >
> > I am a Delphi (ObjectPascal) programmer mostly (done some C#, but is the
> > closest to C I've come) and I would like to write some add-on to
> > Asterisk in Lazarus/Freepascal but I am unsure of the calling
> > convention, actually anything at all about the code of Asterisk.
> >
> > Thanks again for any input.
>
> Shall I lay rice offerings and frankincense at the feet of the Asterisk
> developer divinity to secure an answer? ;)
>
> Seriously, can anyone lend an answer to this?

Well, as much as i know pascal - you would need header files for all the 
structures you're gonna use .That means - you have to translate C header 
files to pascal (and i've seen some structures that i was unable to translate 
to Kylix). If you got past that - sure - you can write them in Freepascal. 
However my opinion is that it's not worth the effort. If you intend to write 
some that AGI can do - better leave it in AGI - as any mistake you're gonna 
make will lead to crash of asterisk. If you intend to add some functionality 
that cannot be accomplished in AGI - you better do that in C, as i doubt that 
FreePascal code will be accepted in Digium SVN (unless you want to keep it 
only for yourself).

Regards,
Atis

-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835



More information about the asterisk-dev mailing list