Set up Asterisk Server on Ubuntu VM in VirtualBox to test Linphone : Part 2

We continue from the Set up Asterisk Server on Ubuntu VM in VirtualBox to test Linphone : Part 1, and will show how to configure Asterisk and Linphone as SIP client on two devices to call each other over WiFi.


Step 1: Establish IP connection between the SIP client (Linphone) and the Asterisk server

First let’s put the ubuntu virtual machine on the same IP subnet as your mobile device. Assume that your mobile device running Linphone is on wifi at home. The simplest way to establish IP connection between the virtual machine and your mobile device is to put the virtual machine to be on the same subnet.

To do so, assume the machine the VirtualBox is running on is already on the same WiFi network as your phone. To check, you can check the IP address of your phone and then check that of your VirtualBox host. The first three octets of both IP addresses should match. For example, my iPhone’s IP is 192.168.1.103 and my macbook air hosting VirtualBox has IP of 192.168.1.105. The first three octets are “192.168.1″. To test, you can “ping” your phone from your host machine. Say from my macbook air, to ping my phone, I would run the following command from a terminal

| | | Next → |

29 thoughts on “Set up Asterisk Server on Ubuntu VM in VirtualBox to test Linphone : Part 2”

  1. Hi,
    The two mobile phones have successfully registered.

    While calling I am facing this error:

    NOTICE[1165][C-0000000e]: chan_sip.c:25772 handle_request_invite: Call from ‘6004’ (xxx.xxx.xxx.xxx:5060) to extension ‘sip/6003’ rejected because extension not found in context ‘public’.

    Can you please help me…

    • Hi vijay, please make sure 6003 and 6004 are in “my-phone” context and that “my-phone” context info is added to extensions.conf

      • Hi Jessica Chiang,

        In this Path: /etc/asterisk/extensions.conf I added these 3 lines.

        [my-phone]
        exten=>6003,1,Dial(SIP/6003)
        exten=>6004,1,Dial(SIP/6004)

        I reload the Asterisk Server. And in mobile accounts are registered, while making calling 6004 from 6003 it showing user not found.

        • Hey vijay glad that SIP is working out for you. To configure IAX, you would need to enable the IAX module. I will update the blog sometime this week to add that as part 3

          • Hey vijay, I have to correct myself. Linphone currently only supports SIP and not IAX. You could configure two asterisk servers to communicate to each other over IAX, but I doubt that’s what you want.

  2. Hi Jessica,
    Yes, Linphone supports only SIP.
    I am trying both Linphone and Zoiper. Zoiper suppors IAX so for that I need to enable IAX protocol.

  3. hi Jessica : ) how about accessing the phones behind NATs (i.e. without public IP) ? i’ve read that Linphone somehow deals with this issue, making use of STUN, but i don’t know how. maybe you have any idea or may suggest some article to read?

  4. Hi Jessica,
    I have problem when connect to Asterisk server with Linphone, it shows “Register failed”? Can I fix it?
    Sorry but you can explains for me about domain in Settings?
    What is that?
    Thank you.

    • Hi Long,
      If it says register failed, then it’s likely the following
      1) Linphone can’t reach the asterisk server via IP
      – Asterisk not running
      – Asterisk not accepting IP of the Linphone (Are your asterisk server and Linphone on the same machine? Say Linphone is simulated?)
      – Linphone can’t ping the host that the asterisk server runs on
      2) Authentication failed
      – check the password

      Also, does your asterisk server show any error message? To increase the debug level, log on to asterisk cli, and enter “set verbose 11”

  5. Hi Jessica,
    Everytime I try to use linphone to call it says “Forbidden”. What can I do to solve this problem?

  6. dude, thanks! BUT…

    you need to homologate the passwords between the ones on this page (“test100”) and the ones on the finished sip.conf (“ping”). this little mistake cost my newbie ass about 20 minutes of confusion-induced headache.

    still, this straightforward tutorial gave me the confidence to “get it done” in a deliciously offhand, essential and preliminary manner, on which i can totally build on and perfect.

    again, much thanks!

    ps: it seems like you also skipped the part about modules.conf!

Leave a Comment