VMware ESXi and vSphere Cluster Management

Register SIP Phones to an Asterisk Server

Learn how to configure Ekiga SIP accounts, register phones with Asterisk, verify peers, and prepare a basic dialplan for test calls.

What SIP registration does

SIP, or Session Initiation Protocol, is used for signaling such as registration, call setup, ringing, and call teardown. A SIP endpoint is a phone, softphone, or device identity that connects to Asterisk. A softphone is telephone software running on a computer; Ekiga is an example.

When a SIP phone registers, it authenticates with Asterisk and supplies its current contact address. Asterisk can then determine where to send calls for that endpoint. Registration is therefore about authentication and endpoint location.

Registration does not, by itself, allow two extensions to call each other. Call behavior is controlled separately by the dialplan, which is Asterisk's set of rules for mapping dialed numbers to actions.

  • SIP client: Ekiga sends registration requests and handles calls on the user's computer.
  • Asterisk server: The PBX authenticates the client, stores its current contact address, and processes calls.
  • SIP account credentials: The username, authentication user, and shared secret identify and authenticate the endpoint.
  • Dialplan: Rules in files such as extensions.conf determine which destinations the endpoint may call and how those calls are handled.

Prerequisites

Before configuring Ekiga, confirm all of the following:

  • Asterisk is installed, running, and reachable from the computer running Ekiga.
  • A SIP endpoint definition already exists on the server for each phone.
  • Ekiga is installed on the client computer.
  • You know the Asterisk server's IP address or hostname.
  • You know the endpoint username or account name.
  • You know the authentication password, called a secret in a legacy Asterisk SIP configuration.
  • The client and server can communicate over the network, including any required SIP signaling and RTP media ports.

This lesson uses the legacy chan_sip driver and its sip.conf terminology. Current Asterisk installations commonly use PJSIP, configured through pjsip.conf. PJSIP uses different configuration objects and CLI commands, so do not copy a chan_sip example directly into a PJSIP configuration.

Define SIP endpoints on the Asterisk server

In the legacy model, a peer is a configured SIP endpoint or remote SIP device. A minimal teaching example for two local users is:

[bob]
type=friend
host=dynamic
secret=replace-with-a-strong-bob-secret
context=internal
callerid=Bob <1001>

[alice]
type=friend
host=dynamic
secret=replace-with-a-strong-alice-secret
context=internal
callerid=Alice <1002>

These sections would normally be placed in the chan_sip configuration, commonly sip.conf or a file included by it. The exact file layout depends on the Asterisk installation.

  • [bob] and [alice] are endpoint section names. In a basic setup, they correspond to the usernames entered in the softphones.
  • type=friend is legacy chan_sip terminology for an endpoint that can authenticate and place calls. Its behavior should be reviewed before using it in a production design.
  • host=dynamic tells Asterisk to learn the endpoint's current address from registration rather than requiring a fixed IP address.
  • secret is the shared SIP password. The client must use the matching value.
  • context=internal assigns the endpoint to the internal dialplan context.
  • callerid is optional and supplies a name and number that may be presented during calls.

Every device should have its own endpoint identity and its own strong, unique secret. For example, Bob's client uses bob and Bob's secret, while Alice's client uses alice and Alice's different secret.

Start Ekiga

Launch Ekiga from the desktop environment using the applications menu. You can also start it from a terminal:

ekiga

Use the normal desktop user account. Elevated privileges are generally not required for a desktop softphone unless a particular operating environment specifically demands them.

After Ekiga opens, reach its account management interface through the account settings or accounts manager. Menu names can vary by Ekiga version and desktop integration. Look for an option to manage accounts and then add a new account.

Add a SIP account in Ekiga

  1. Open Ekiga's account manager or account settings.
  2. Choose the option to add or create an account.
  3. Select SIP as the account type or protocol.
  4. Enter the Asterisk server address and the credentials for one endpoint.
  5. Save or apply the account.
  6. Watch the account list or status indicator for a registered state.

For Bob, an illustrative account could use these values:

  • Account label: Bob at local PBX
  • Registrar: 192.0.2.10 or pbx.example.test
  • User: bob
  • Authentication user: bob
  • Password: The strong secret configured for the [bob] endpoint
  • Registration expiry: 3600 seconds, unless the deployment requires another interval

The account label or display name is only a descriptive local identifier. It helps you recognize the account in Ekiga, but it does not replace the SIP username.

Map Ekiga fields to Asterisk

Ekiga fieldValue to enterAsterisk source or configuration counterpartNotes
Account name or labelA local description such as Bob at local PBXNo direct authentication counterpartDescriptive only; it is not the SIP username.
RegistrarAsterisk DNS name or IP addressThe server running the SIP serviceUse a stable hostname or correctly routed private address when appropriate.
Userbob or aliceUsually the chan_sip section name, such as [bob]This identifies the SIP endpoint.
Authentication userNormally the same endpoint identifierThe identity expected during SIP authenticationIt may differ in advanced deployments.
PasswordThe endpoint's shared secretsecret=...The client and server values must match exactly.
Registration timeout or expiryFor example, 3600 secondsThe requested SIP registration intervalThe client renews registration when the interval expires; the server may apply its own limits.

The registrar is the SIP server address to which the client sends registration requests. The registration expiry is the interval associated with a registration, after which the client renews it. In a simple chan_sip setup, the endpoint section name commonly corresponds to the username entered in the phone.

Recognize a successful registration

Ekiga normally shows an account status such as Registered, an active account indicator, or an equivalent success message. A failure indicator, warning, or repeated authentication prompt means that registration has not completed successfully.

On the Asterisk server, open the Asterisk console:

asterisk -rvvv

Then list legacy chan_sip peers:

sip show peers

Inspect a particular peer in more detail with:

sip show peer bob

The peer list can show concepts such as:

  • Peer name: The configured identity, such as bob or alice.
  • Host or address: The current network address associated with the peer.
  • Dynamic registration: A peer configured with host=dynamic receives its current contact address when it registers.
  • Reachability: A status indicating whether Asterisk can communicate with the peer.
  • Latency: A measured response time when available.

A dynamically registered endpoint obtains a current contact address because the client tells Asterisk where it can currently be reached. This is useful for laptops and devices whose local address may change.

Register a second phone

Configure Alice as a separate Ekiga account, either on another computer or in a second client instance:

  • User: alice
  • Authentication user: alice
  • Password: A separate strong secret matching [alice]
  • Registrar: The same Asterisk server address

After both clients register, run sip show peers again. Bob and Alice should appear as separate configured peers, with their own current contact or host addresses and reachability states.

Prepare a basic dialplan

Registration tells Asterisk where a device is and verifies its credentials. The dialplan decides what happens when a caller enters a number. Add matching rules to the internal context in extensions.conf:

[internal]
exten => 1001,1,Dial(SIP/bob)
exten => 1001,n,Hangup()

exten => 1002,1,Dial(SIP/alice)
exten => 1002,n,Hangup()

Here, the extension number entered by the caller is matched against the left side of an exten rule:

  • Dialing 1001 matches the first rule and calls the legacy chan_sip endpoint bob.
  • Dialing 1002 matches the second rule and calls the legacy chan_sip endpoint alice.
  • Dial(SIP/bob) uses the chan_sip channel technology and the endpoint name from sip.conf.
  • Hangup() ends the call flow after the dialing application finishes.

The endpoint's context=internal setting must match the [internal] context containing these rules. Contexts help restrict which dialplan destinations an endpoint may access.

Reload the dialplan from the Asterisk CLI:

dialplan reload

If you changed the legacy SIP endpoint definitions, reload chan_sip as well:

sip reload

The basic test flow is now:

  1. Bob registers with Asterisk.
  2. Bob dials 1002.
  3. Asterisk looks for 1002 in Bob's assigned internal context.
  4. The dialplan invokes SIP/alice.
  5. Alice's Ekiga client rings if it is registered and reachable.

chan_sip and PJSIP command comparison

Use commands that match the SIP driver installed and configured on your system.

TaskLegacy chan_sipPJSIP-based Asterisk
List endpoint statussip show peerspjsip show endpoints
Inspect a specific endpointsip show peer bobpjsip show endpoint bob
Reload SIP configurationsip reloadpjsip reload

PJSIP endpoint configuration is not interchangeable with the sip.conf example. If your installation uses PJSIP, identify its endpoint, authentication, address-of-record, transport, and dialplan settings using the PJSIP configuration.

Registration troubleshooting

SymptomLikely causeHow to verifyCorrective action
Authentication rejectedWrong username, authentication user, password, or registrarCompare Ekiga with the endpoint definition; inspect Asterisk CLI messages and run sip show peer bob.Correct the registrar, identity, authentication identity, or secret.
Server unreachableAsterisk is stopped, the address is wrong, or routing or firewall rules block SIP signalingConfirm the Asterisk service and CLI; test DNS or IP connectivity and review firewall policy.Start Asterisk, use the correct server address, and permit the required signaling traffic.
Peer remains unregisteredThe endpoint configuration is inactive, the client cannot reach the server, or the address is incorrectCheck the peer list, client status, network path, and recent configuration changes.Restore connectivity, correct the address, and reload the relevant SIP configuration.
One phone replaces anotherBoth devices use the same SIP account and the endpoint accepts one contactCompare usernames on both clients and review the endpoint's contact behavior.Create separate endpoint identities and secrets, such as bob and alice.
Registration works but calls failNo matching dialplan extension, wrong context, wrong endpoint target, or an unreloaded dialplanCheck the caller's context, verify the dialed number, and observe dialplan execution in the CLI.Align the context and extension rules, target the correct peer, and run dialplan reload.
Calls connect but have no audioRTP firewall blocks, incomplete NAT settings, unreachable advertised media address, or incompatible codecsReview RTP firewall rules, NAT and address settings, codec lists, and carefully collected SIP or RTP diagnostics.Correct RTP access, NAT configuration, address advertisement, or codec compatibility.

Operational and security considerations

  • Use strong, unique secrets instead of sample values. Do not reuse a password across endpoints.
  • Do not expose SIP services directly to the public internet without firewall rules, access controls, monitoring, and anti-fraud protections.
  • Use a stable hostname or a correctly routed private address for the registrar according to the deployment.
  • NAT and firewall problems can allow registration to succeed while preventing calls or two-way audio. SIP signaling and RTP media may require different network rules.
  • Keep the dialplan restrictive. An endpoint context should grant only the destinations that endpoint is intended to use.

Exam-relevant summary

  • Registration authenticates a SIP endpoint and records its current contact address.
  • Registration is not call routing; the dialplan is required to make extensions call one another.
  • In a basic chan_sip setup, the Ekiga user often matches the sip.conf section name, and the password matches secret.
  • host=dynamic means Asterisk learns the endpoint's current address through registration.
  • The endpoint's context determines which dialplan namespace it can access.
  • Use sip show peers and sip show peer for chan_sip, but use PJSIP-specific commands on PJSIP systems.
  • Separate phones should normally use separate endpoint identities and credentials.

For a compact workflow, define the endpoint on Asterisk, create the matching SIP account in Ekiga, confirm its registered status in Ekiga and the Asterisk CLI, assign the endpoint to the intended context, add dialplan rules, reload the configuration, and place a test call.