How to send a SIP message with a batch program

2

I must be missing something. I can't seem to find how to send an instant message via SIP using a simple batch program to which I can pipe the content of the message.

I know how to do it interactively with something like Linphone, and I've seen various pages explaining how Asterisk can send messages (but I can't seem to understand how that would work from a batch program), I also found pjsua (which is using a text GUI, so it's somewhat closer to what I want, but I still haven't found a way to make it send a SIP message in a batch context).

[ If needed, I could probably settle for another open protocol, like XMPP/Jabber, but not SMTP, since the whole point is to alert me when I receive specific email messages. ]

Any hint?

Stefan

Posted 2015-10-27T13:32:39.267

Reputation: 1 052

What have you tried? What is your OS (Linux, Windows, OSX)? Which software will receive the SIP message? – jcbermu – 2015-10-27T14:01:06.093

I'm using Debian GNU/Linux, and the clients will be varied, tho the main ones should be Linphone and Ekiga. I haven't been able to try anything concretely yet (other than search the web) because I didn't find anything to start with. – Stefan – 2015-10-27T14:46:25.760

The usual way SIP works is that SIP clients (Ekiga or Linphone) log in a server (asterisk, for example) and from then, the server or the client use SIP to signalize the start or end of multimedia connections. Your idea will be better implemented using XMPP or websockets

– jcbermu – 2015-10-27T14:52:03.637

Yes, I know how SIP works. I need a SIP client that I can tell in batch mode to "log into my SIP account, then send <this-message> to <this-sip-address>". It should be fairly infrequent so it's OK if it has to "login" and then "logout" every time. I mentioned, I could probably accomodate a solution using XMPP instead, tho I'm not sure if that'd help (AFAIK this also usually works by registering with a server, pretty much like SIP). – Stefan – 2015-10-27T14:56:39.033

Vote to close because: ....."Yes, I know how SIP works. I need a SIP client that I can tell ....." ..... – Xavierjazz – 2015-10-27T14:58:41.863

Answers

1

I think the following post applies to you. It talks about Command Line SIP solutions available in Linux. https://serverfault.com/questions/231597/command-line-sip-dialer

Noshad Chaudhry

Posted 2015-10-27T13:32:39.267

Reputation: 138

Indeed, thanks. These are solutions to perform audio SIP calls rather than to send instant messages. Oddly enough, it seems that command-line (SIP) phone calls are easier to do :-( – Stefan – 2015-10-29T05:21:22.207

0

Pjsua offers command line SIP Messaging capabilites.

jkow

Posted 2015-10-27T13:32:39.267

Reputation: 1

It seemed like it might be able to do it, indeed, but I couldn't figure out how (it always seemed to require interaction). Could you give some details in your answer? – Stefan – 2017-01-11T14:11:20.133

Please read How do I recommend software for some tips as to how you should go about recommending software. You should provide at least a link, some additional information about the software itself, and how it can be used to solve the problem in the question.

– DavidPostill – 2017-01-11T16:18:31.763