Skip to main content

Posts

Showing posts with the label Lua

A rudimentary dissector for Wireshark (Lua)

  Wireshark offers a simple but effective option to extend its capabilities, by using Lua dissectors . Just to give an example, recently received a pcap file containing some traffic (it was RTP) encapsulated inside a UDP header. The reason for encapsulation was transporting over a VPN. I'm in such a habit to look into RTP streams on Wireshark, that I have a setting that tells it to try an interpret any UDP packet automatically as carrying RTP ( I wrote how here ). That also failed. So Wireshark was not able to interpret those frames as RTP (or anything else, for what matters), and I remembered time ago writing a custom dissector. Wireshark allows to do that simply in Lua and add it as a plugin. The code is available here . I just had to make it available inside '$HOME/.local/lib/wireshark/plugins/`.

The interesting case of Lua in RTC world

An interesting pattern that caught my attention is the role that Lua is gaining in the RTC (Real-Time Communications) world. Lua is a small-footprint programming language, powerful while keeping a simple syntax. I’ve been using Lua to script dialplan actions for FreeSWITCH since about 2014. It has provided me with a way to define relatively complex logic and speed up the definition of FS’ behaviour. Delegating this type of logic to a scripting language had several advantages, such as: It’s easier to read and understand than native dialplans or native routing logic. Makes unit testing of the dialplan possible/easier. Allows changing some pieces of logic easily, in many cases preventing expensive reload of modules or restart of applications. I’ve been using Lua for Kamailio as well. Kamailio is an open source programmable SIP Proxy . In a specific case, some bits of the routing logic required regex processing and was expecting to change often: an ideal case for...