Back to listing

Asterisk PBX via GELF HTTP

GELF Library No release yet

After a lot of sweat in search of ways to use Graylog with Asterisk, I discovered that through the GELF method we can create several custom views through scrpts that can be written in your preferred language.

omalisson
free!

Published

11 Apr 10:04

Last Push

11 Apr 09:53

Marketplace Rating

No rating yet

Discussion

1 Comments

Your Rating

Please sign in to rate this add-on.

Comments

omalisson 3 months ago

Here's a simple example script to send incoming call logs:

#!/bin/bash
#
# Variáveis consumidas do Asterisk:
NUM=$1 #1 CALLERID(num) --> Telefone externo
DN=$2 #2 EXTEN --> Ramal interno
SIPPEERS=$3 #3 SIPPEERS --> Total de chamadas ativas no tronco
GPCNT=$4 #4 GRPCOUNT-CALLS --> Contagem de chamadas concorrentes: ${GROUP_COUNT(OUT_GVT_edserj)}
FCHN=$5 #5 CDR(channel) --> Canal inicial da chamda de entrada
CONTEXT=$6 #6 CONTEXT --> Contexto de entrada da chamada
HOST=`hostname | cut -d. -f1`

curl -X POST -H 'Content-Type: application/json' -d
'{
"source": "'$HOST'",
"application": "incoming_call",
"link": "GVT", "site": "EDSERJ",
"from_external": "'$NUM'",
"dial_number": "'$DN'",
"all_calls": "'$SIPPEERS'",
"concurrent_INC_calls": "'$GPCNT'",
"message": "'$FCHN'",
"context": "'$CONTEXT'"
}' 'http://10.101.2.210:12201/gelf'

Please sign in to comment.

Back to listing