Re: Zoneminder et asterisk

BERTRAND Joël <[email protected]>
Newsgroups gmane.linux.debian.user.french
Message-ID <[email protected]>
NoSpam a écrit :
> Voici le lien vers mon script
> 
> https://tdrive.tootai.net/s/5q6Nxzbd5RrGs2n

	Merci.

	Personnellement, j'ai commis ceci :

#!/bin/bash

MONITOR_NAME=$1
EVENT_ID=$2
TIME=$3
ALARM=$4
SCORE=$5

expect << EOS
        spawn telnet 127.0.0.1 5038
        expect "Asterisk Call Manager"
        stty -echo
        send -- "Action: Login\r"
        send -- "Username: zoneminder\r"
        send -- "Secret: JSUDDkHQ82\r"
        send -- "\r"
        expect {
                "Message: Authentication accepted" {
                }

                "Message: Authentication failed" {
                        exit
                }

                timeout {
                        exit
                }

                eof {
                        exit
                }
        }

        send -- "Action: MessageSend\r"
        send -- "ActionID: $EVENT_ID\r"
        send -- "To: pjsip:6003\r"
        send -- "From: \"Notification Zoneminder\"
<sip:[email protected]>\r"
        send -- "Body: Événement $EVENT_ID sur le moniteur
$MONITOR_NAME. heure $TIME, nombre d'images en alarme $ALARM, score
$SCORE.\r"
        send -- "\r"

        expect {
                "Message successfully sent" {
                }

                timeout {
                        exit
                }

                eof {
                        exit
                }
        }

        send -- "Action: Logoff\r"
        send -- "\r"

        expect {
                "Thanks for all the fish." {
                }

                timeout {
                        exit
                }

                eof {
                        exit
                }
        }

        exit
EOS

exit 0

	Ça fonctionne depuis la ligne de commande en simple utilisateur.
Problème, zoneminder ne l'appelle pas. J'ai pourtant ce qu'il me semble
correct dans un filtre spécifique et un événement qui "matche". Je
demande au filtre d'exécuter :

/usr/local/bin/zm-asterisk-alert.sh "%MN%" "%EID%" "%ET%" "%EFA%" "%ESA%"

et au filtre de tourner en arrière plan toutes les minutes.

	JB
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQQj8MW8iOsC2RXEznnFW/s/mMLXCAUCanyO1gAKCRDFW/s/mMLX
CGN1AQCm1uy8uaH8MhHVXYxGI8IZIHZAS45+p0KAQtityQxQJAEAoh6X7gAio8RR
hKO4NN6jfMcNhd/HG0U4fZIuuslabwo=
=COoD
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.