[asterisk-dev] ast_safe_system() from within chan_sip.c

Jaco Kroon jaco at uls.co.za
Mon Feb 22 13:52:55 CST 2016


Hi,

And please keep in mind that SIP calls (in asterisk 11 at least) are
very much serialized and you're going to affect the response times to
SIP frames by introducing extra work there - really do look at the ASF.

Frankly, if you're after what I think you're after, I've been parsing
the logs for exactly that since before ASF ... and I should probably
convert, but for now the tail -F ... | sed -nre '...' | banscript is
working quite nicely.

Kind Regards,
Jaco

On 22/02/2016 18:28, Scott Griepentrog wrote:
> ​> unsuccessful register count
>
> Why not use the security event logging system instead?  Would be
> easier than modifying chan_sip, and less prone to introducing
> undesired side affects by inserting a system call.
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+Security+Framework
>>
> On Mon, Feb 22, 2016 at 10:06 AM, Pedro Guillem [e-Mediate]
> <pg at e-mediate.co <mailto:pg at e-mediate.co>> wrote:
>
>     Hi Folks
>
>     I haven´t used C in a decade so i´m kind of rusty, but I
>     understand the advanced basics of it.
>
>      
>
>     I know there is a function called ast_safe_system() declared on
>     asterisk.c used to perform system calls.
>
>     I need chan_sip.c to call a local program each time a registration
>     is unsuccessful.
>
>      
>
>     I know the exact line of chan_sip.c where I can trigger this
>     system call, but I don´t know if I can use ast_safe_system()  from
>     within a function of chan_sip.c.
>
>      
>
>     Any ideas?
>
>     Should I include an additional header files to chan_sip.c in order
>     to call this function?
>
>      
>
>     Best
>
>     Pedro
>
>      
>
>     PS: Yeah.. most of you will probably ask why on earth would I want
>     to do that..
>
>     Quick answer is I don´t want to modify chan_sip.c that much in
>     order to do something like keeping an unsuccessful register count…
>     so i´d rather delegate that to a third party script
>
>      
>
>      
>
>      
>
>      
>
>
>     Este correo electrónico se ha enviado desde un equipo libre de
>     virus y protegido por Avast.
>     www.avast.com <https://www.avast.com/sig-email>
>
>
>     --
>     _____________________________________________________________________
>     -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
>     asterisk-dev mailing list
>     To UNSUBSCRIBE or update options visit:
>        http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
>
>
> -- 
> Digium logo
> Scott Griepentrog
> Digium, Inc · Software Developer
> 445 Jan Davis Drive NW · Huntsville, AL 35806 · US
> direct/fax: +1 256 428 6239 · mobile: +1 256 580 6090
> Check us out at: http://digium.com · http://asterisk.org
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20160222/8aac6b1d/attachment.html>


More information about the asterisk-dev mailing list