Search code examples
rubysip

Ruby SIP requests


I have been tasked with sending alert messages via SIP (Session Initiation Protocol). I use Ruby (on Rails).

I have seen How to send ‘SIP request‘ (SIP client) in java and it appears it is just about streaming a string over a UDP socket. Am I correct?

Does anyone know of any good Gems that could support this? I have looked at several but they tend to be SIP servers rather than clients / senders. e.g.: https://github.com/turboladen/sdp


Solution

  • Perhaps you could just use some already existing solution and run a command-line client from Ruby that does the work for you.

    Here I found an SDK library with a command-line interface:
    https://sipsimpleclient.org/

    Here's their example of sending a message with their command-line interface:
    https://docs-new.sipthor.net/w/sip_clients/sip_message/

    Sending a message like this could then be accomplished with a simple Ruby system call.

    system('sip-message [..account options..] -m "Hello World"')