Asterisk Project : Making a Phone Call

At this point, you should be able to pick up Alice's phone and dial extension 6002 to call Bob, and dial 6001 from Bob's phone to call Alice. As you make a few test calls, be sure to watch the Asterisk command-line interface (and ensure that your verbosity is set to a value three or higher) so that you can see the messages coming from Asterisk, which should be similar to the ones below:

server*CLI>     -- Executing [6002@from-internal:1] Dial("SIP/demo-alice-00000000", "SIP/demo-bob,20") in new stack
    -- Called demo-bob
    -- SIP/demo-bob-00000001 is ringing
    -- SIP/demo-bob-00000001 answered SIP/demo-alice-00000000
    -- Native bridging SIP/demo-alice-00000000 and SIP/demo-bob-00000001
  == Spawn extension (from-internal, 6002, 1) exited non-zero on 'SIP/demo-alice-00000000'

As you can see, Alice called extension 6002 in the [from-internal] context, which in turn used the Dial application to call Bob's phone. Bob's phone rang, and then answered the call. Asterisk then bridged the two calls (one call from Alice to Asterisk, and the other from Asterisk to Bob), until Alice hung up the phone.

At this point, you have a very basic PBX. It has two extensions which can dial each other, but that's all. Before we move on, however, let's review a few basic troubleshooting steps that will help you be more successful as you learn about Asterisk.

Icon
Basic PBX Troubleshooting

The most important troubleshooting step is to set your verbosity level to three (or higher), and watch the command-line interface for errors or warnings as calls are placed.

To ensure that your SIP phones are registered, type sip show peers(chan_sip), or pjsip show endpoints(chan_pjsip) at the Asterisk CLI.

To see which context your SIP phones will send calls to, type sip show users(chan_sip) or pjsip show endpoint <endpoint name>(chan_pjsip).

To ensure that you've created the extensions correctly in the [from-internal] context in the dialplan, type dialplan show from-internal.

To see which extension will be executed when you dial extension 6002, type dialplan show 6002@from-internal.

Comments:

I am having a lot of trouble getting this tutorial (Basic PBX functionality) to work. The functionality demoed here was simple for me using AsteriskNow/FreePBX, but I need Asterisk 13 for its ARI features, so I downloaded the source for Asterisk 13 and am forced to use PJSIP as chan_sip support is either not available yet on Asterisk 13 or I cannot get the config to work on make menuselect (marked XXX).

Anyway, the specific issue I am having is that the caller's speaker indicates ringing, but the callee is not ringing, and indeed, doesn't even show a call appearing into the phone. Moreover, the CLI keeps reporting the following:

[Jan  6 21:46:55] WARNING[21829]: res_pjsip_pubsub.c:2858 pubsub_on_rx_publish_request: No registered publish handler for event presence
[Jan  6 21:46:55] WARNING[21829]: res_pjsip_pubsub.c:608 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo

I am using zoiper client on Mac OSX and iPhone as both caller and callee. Any help is appreciated.

Posted by srajagopalan at Jan 06, 2015 12:48

I discovered the issue is that the IP address for the contacts registering is not correct, but still don't know how to fix this issue. My two phones and asterisk are all on the same internal network, with IPs 192.168.1.25 (Asterisk 13.1.0 with PJSIP), 192.168.1.26 (Alice) and 192.168.1.27 (Bob). When I do pjsip show endpoints, I get wrong IP addresses, and so I can hear my caller ringing the callee, but the callee is not rining because the IP address the PBX is reaching out to is incorrect. How do I fix this problem?

asterisk13FFP*CLI> pjsip show endpoints  
...
 Endpoint:  demo-alice                                           Not in use    0 of inf
     InAuth:  demo-alice/demo-alice
        Aor:  demo-alice                                         1
      Contact:  demo-alice/sip:demo-alice@146.115.163.234:38519  Unknown               nan
 
 Endpoint:  demo-bob                                             Not in use    0 of inf
     InAuth:  demo-bob/demo-bob
        Aor:  demo-bob                                           1
      Contact:  demo-bob/sip:demo-bob@146.115.163.234:55527;tra  Unknown               nan

 

 

Posted by srajagopalan at Jan 07, 2015 02:15

This tutorial was not written for PJSIP. So I wouldn't really expect it to work. In the near future we will be rewriting all of this content or adding content for PJSIP. You can currently find the Asterisk PJSIP documentation elsewhere on the wiki.

chan_sip is still available in Asterisk 13 and is still supported, but only as extended support. We do recommend that you start using PJSIP as that is where all the development work will be going.

I'm not sure what is going on with your errors. This is not a support forum. You may want to ask for assistance on the mailing lists or forums.

 

Posted by rnewton at Jan 14, 2015 05:06

You may want to ask for assistance on the mailing lists or forums.

That being said - you can turn on "pjsip set logger on" to show a SIP trace. I'd look into the SDP sent by your clients to see why Asterisk is receiving the inappropriate contact addresses.

Posted by rnewton at Jan 14, 2015 05:08