14

Is there a simple command line SIP dialer for unix which can connect to SIP server, make a call and play some media file (wav/mp3)? In ideal I would look like this:

sip-dailer +1xxxxxxxxxx /path/to/message.mp3
2
  • I've done some research into SIP. My sense is that it's very vendor specific. You might have to purchase a specific unix compatible SIP server.
    – SLY
    Feb 5, 2011 at 16:02
  • twilio has an API call for this. Maybe not one line, but close to.
    – Thufir
    Feb 17, 2018 at 7:58

6 Answers 6

13

With sipcmd https://github.com/tmakkonen/sipcmd you can do it on one line:

sipcmd -u <login> -c <passwd> -P sip -w <sipproxy> -x "c<phonenum>;ws3000;v<audiofile>;h"
1
  • Add your country code in front of the number. Like 001 for the US and Canada. Jul 21, 2021 at 13:21
11

There is a free (GPL) tool called SIPp (distributed as sip-tester by Debian and its derivatives) that will allow you do something along these lines.

For example:

./sipp -sn uac <IP address>

tells it to use the built in UAC scenario and to send the request to the IP address specified.

Once the call is answered it can play audio, but this needs to be provided as a raw RTP stream (passing a .pcap capture file works well) and you will need to build your own 'scenario' for this, which involves writing/modifying a bit of XML.

2
  • 2
    This comment was super useful for me. I wrote up a detailed set of instructions on getting SIPp up and running here. Thanks!
    – muirbot
    Mar 7, 2012 at 23:57
  • Hello, do you have details on these instructions? Aug 20, 2012 at 1:46
5

If you already have Asterisk running, setting up a task to dial a number and wait for the other side to answer and play an audio file is not that hard. But 'having Asterisk running' does not answer 'simple'.

Google suggests pjsua.

3

linphonec support remote_ring option(wav file to play to advertise remote ringing). You can configure Asterisk.

1
  • Thanks, I tried it and it was quiet simple, there is a special command play for playing WAVs, and config where you can set sip_proxy. Almost what I need.
    – troex
    Feb 6, 2011 at 6:37
1

Maybe have a look at http://www.pjsip.org/pjsua.htm. While I am not sure it has an autoplay-option for outgoing calls, I guess you could fiddle with input devices a little bit to make it possible.

1
  • I've seen this, very interesting library but it's not ready-to-use solution, though there are good python examples howto use it
    – troex
    Feb 5, 2011 at 19:11
0

There is a little simple batch script, using netcat here:

https://github.com/rundekugel/callSip.sh

I use it to test connections and phones. It calls and hang up, but contains no audio support.

1
  • 1
    The OP is asking specifically for a solution that can play audio.
    – aseques
    Apr 18, 2019 at 7:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .