Posts

Asterisk Queues Realtime Dashboard with amiws and Vue

Image
Project "amiws_queue" is a small dashboard for Asterisk queues management and monitoring. It can work with multiple Asterisk servers and basically visualises AMI queue events from the servers. It is an open source project and can be found on github: https://github.com/staskobzar/amiws_queue Top panel provides information about all queues from all Asterisk servers: active and waiting callers abandoned and completed calls paused and active queue agents Search fields allows to filter by queue name. It accepts regex as well. Also dashboard can send AMI command to pause/unpause all agents in all filtered queues. Each queue card shows queue's settings and allows to pause/activate all queue's agents as well as open the list of agents and queue callers. Monitoring calls in queue. Agents list can sent remove from queue AMI message to Asterisk and allows to drag and drop agents to other queues. When there are calls in

YAML syntax processing in C with libyaml and lemon parser generator (part 2)

Image
In previous part of the blog we have created the basis of the program. In this part we will work on lemon parser grammar file "parser.y". Lemon is an application that can be installed from packages (comes almost with all Linux distributions), with Homebrew on Mac OS. Or you can build it from the sources. It is to find in Internet how to do that.  When lemon is installed, we can run command "lemon" with a path to the grammar file as an argument.  Using Makefile will much improve our build process: We can simply run "make" command in our working directory and it will generate the parser .c and .h files. Libyaml wiki has a grammar explained for events: http://pyyaml.org/wiki/LibYAML#Events This is basically the same for tokens. Let's start with a very minimal ( minimum minimorum ) YAML syntax (file minimum.yaml):   key : value If we run now our program, we will have this in output: Here, the "key" and the &q

YAML syntax processing in C with libyaml and lemon parser generator (part 1)

Image
This article continues previous blog on YAML data serialization format processing with C. I have mentioned there that libyaml perfectly fits to be used with parser generators like GNU bison, yacc or lemon. Usually, these tools are used with lexical analyser (flex, lex) that parses input sequence of bytes (text) and produces tokens for parser. In case of YAML the C library "libyaml" is do the job. Libyaml can scan YAML file or stream and produces events or tokens. In this article I will try use libyaml with lemon parser to implement YAML processing. Sure thing, bison and yacc can be used too. Let's with simple function that will use libyaml to scan file. For that I took the example from "libyaml" wiki:  http://pyyaml.org/wiki/LibYAML#ParserAPISynopsis Here what I got for the bootstrap main.c file: Note that here we use function "yaml_parser_scan" that produces tokens. To compile the scenario we can run command: # gcc main.c -

SIP stack libre: creating simple OPTIONS SIP request

Libre is a powerful and simple library than implements SIP and many other real-time communication protocol. Full list of features and protocols can be found on its web-page:  http://creytiv.com/re.html . There are several open source SIP stacks on C available: Libre Sofia-SIP PJSIP libeXosip2 reSIProcate bell-sip I have tried do some simple SIP UA with four of them: libre, sofia-sip, pjsip and libeXosip2. These scripts can be found at my github project . Some of them are used with big projects. For example, PJSIP is now a part of Asterisk project (starting from version 11) and Sofia-sip is a core SIP library of FreeSWITCH project. Asterisk team has made some good research on SIP Stacks when they were chosing one for their project. It can be found here: https://wiki.asterisk.org/wiki/display/AST/SIP+Stack+Research I do like sofia-sip, but, unfortunately, it was not updated for very long time (since 2011).  Libre looks like relatively new to other project,

amiws - AMI (Asterisk Manager Interface) to web-socket proxy

Image
This article is about simple networking utility that allows to connect multiple Asterisk PBX servers via AMI (Asterisk Management Interface), listen to Asterisk events and other message and convert them to JSON. Users can connect to the utility with HTTP protocol and get JSON messages via WebSocket.

Google Cloud DNS API example with ruby

Image
Recently, I did my first steps with Google Cloud DNS API. I was using ruby to do my development and ruby library is in early-stage (May 2017) and has only alpha version. It still works pretty well and I have been able to implement everything I needed. However, I had some hard time to figure out how to do that. Despite there are lots of documentations in the beginning I was a bit confused. There are lots of articles about popular Google API, but not match about DNS and ruby. So I decided to share my experience and put the whole process here in simple steps: Setup Authorization Create record Delete record Update existing record 1. Setup Google provide ruby libriry via gem. To install it simply run: gem install google-api-client or set it with Gemfile. More information can be found on Google's github page: https://github.com/google/google-api-ruby-client Google API has three types of  authentication schemes: API keys Service accounts User accounts

YAML documents parsing with libyaml in C

YAML markup standard (or human-readable data serialization language as it stands in wikipedia ) is widely used these days as alternative to XML, JSON or others. Anybody who does some ruby-on-rails uses YAML configuration for database connection. It is simple, but in the same time, flexible standard which definitely should replace outdated formats like INI. YAML is supported by lots of programming languages. Check projects list at yaml.org .