Using Asterisk 13 (With FreePBX) with the FCSDK Sample App.

Requirements

This guide assumes the following environment is already in place.

  • AsteriskNow 13 with FreePBX Pre-Installed
  • Web Gateway Installed & Configured with correct routing parameters
    • FCSDK Sample Application
    • LiveAssist Sample Application
  • MediaBroker Installed & Configured with correct routing parameters
  • Various SIP endpoints with support for vp8/h264 codecs.
    • iOS
      • Linphone
      • Zoiper
    • Android
      • Linphone
      • SipDroid
      • Zoiper
    • Windows
      • Linphone
      • Zoiper
    • Linux
      • Linphone
      • Zoiper

Asterisk Setup

Please check that your Asterisk machine is fully network capable.

 Upon Login to Asterisk, you will be presented with a MAC address, network adapter & IP address. 

Please also check the Hostname is correct

FreePBX Administration

 If you are inexperienced with Asterisk, you will find setup & maintenance is much easier through FreePBX, an open source GUI for Asterisk.

 You can access this by going to [http://YOUR_SERVER/admin/config.php]

 You may be presented with an ‘Initial Setup’ page, please create an administrative user account now.

You will only be changing a few things inside of Asterisk in order to get the setup working with FCSDK.

The first Task is to deal with your NAT configuration

NAT Configuration 

To configure your NAT settings, go to Settings > Asterisk SIP settings 

Click ‘Detect External IP’ & Asterisk should detect your network setup. Make any additional changes, such as adding/editing local networks that are required. 

Submit the page & Apply Config.

SIP & PJSIP 

These settings can be edited by going to Settings > Asterisk SIP settings

 

Set Allow Anonymous Inbound SIP Calls to Yes

 

At the top-right of this page you will see a navigation menu

By Default in Asterisk 13, PJSIP is set to use SIP default port [5060] & protocols which can cause conflicts if you wish to use SIP with Asterisk. PJSIP works by default with FCSDK for Audio-Only calls. However PJSIP currently has issues with Video due to being in an experimental stage with FreePBX. 

Please use the regular SIP protocol for this How To, as PJSIP is in an experimental phase with FreePBX. 

Turn off PJSIP ‘Port & protocol hijacking by going into ‘Chan PJSIP’

 Set ‘Show Advanced Settings’ to ‘Yes’

 Set the transport protocol to something that you will not be using. Leaving it set to udp - 0.0.0.0 - All will cause PJSIP to hijack all incoming/outgoing udp traffic.

 I set it to the websocket loopback, ws - 127.0.0.1 - lo.



Change the ‘Listen on Port’

 

Click Submit

Click Apply Config at the top of the page

 You must now Reboot Asterisk by rebooting the machine. Or else you will be unable to register SIP devices as they will be attempting to register to PJSIP endpoints, not SIP endpoints. This is due to PJSIP continuing to override all udp traffic if Asterisk is not rebooted. Reloading Asterisk is not sufficient.

 Do not turn off PJSIP.

Now go into ‘Chan SIP’

Edit your NAT settings to whatever is required, if they differ from what was set in ‘General SIP settings’

Enable Video support, Select h264 and vp8 as supported codecs. Set the max bitrate to 1200kb/s

Set the Bind Port to 5060

Submit Changes & Apply Config.

Extension Setup

Go to Applications > Extensions

 Select Generic CHAN SIP Device

  • Set User Extension
  • Set Display Name
  • Set Secret
  • Link to a Default user ‘Create New User’
  • Set Password to the same as the secret.
  • Set the Users & Extensions to ‘type = peer’ rather than ‘type = friend’

 Submit Page & Apply Config. Repeat for additional Extensions.

Friend requires authorisation whereas peer does not. This can result in asterisk sending a 401 unauthorised to mediabroker when attempting to dial extensions.

User Setup

User setup should not be required as it was included during the creation of Extensions, If you need to adjust user settings you can do so in

 Admin > User Management

Common Issues

One Way Media/Audio/Video

This is usually due to either Codec Settings, or NAT configuration. Monitor the SDP on Asterisk & MediaBroker to see if the problem is related to Codec negotiation.

In Mediabroker, This is done in the calls.log logfile.

In Asterisk, this is done in the asterisk -r / rasterisk command line interface. Once you have entered the CLI use the command set sip debug on to enable sip message logging on the asterisk command line.

In these areas you can monitor the SDP negotiation to ensure the issue is not related to codecs.

If the problem is NAT configuration, please ensure all of your networks are included in the NAT Configuration section of this guide.

 

Unable to Login to the CSDK Sample App when using Asterisk as an External Registrar

This is due to your CSDK sample application users & Asterisk users not having the same configuration. Please ensure the users in your csdksample-db.xml are configured according to Asterisk’s expected username/password combinations.

If you need to change the users in your CSDK sample application, please redeploy the csdksample-db.xml file with the correct details using the FAS web GUI or CLI.

 

Asterisk replies to INVITE with 401 UNAUTHORISED when attempting to dial from csdk-sample

This is due to the Extension & User being set to ‘friend’ instead of ‘peer’. Please set the extension & user you are attempting to dial to ‘type = peer’

 

Have more questions? Submit a request

Comments

Powered by Zendesk