Register SIP Phones to an Asterisk Server
Learn how to configure Ekiga as a SIP endpoint, register it with Asterisk, verify peers from the CLI, and prepare the dialplan for calls.
A SIP phone or softphone must register with Asterisk before the PBX can normally reach it. This lesson uses Ekiga as the client and the legacy chan_sip configuration model as the server-side example.
Registration is only one part of a working phone system. It tells Asterisk where an endpoint is currently located, but the dialplan must separately define what happens when a user dials a number.
What SIP registration does
SIP, or Session Initiation Protocol, is used for signaling tasks such as registering an endpoint and starting a call. A SIP phone can be a hardware device or an application. A softphone is a SIP phone implemented in software on a computer or mobile device.
During registration, the endpoint authenticates to Asterisk and reports a current contact address. This address usually contains an IP address and port where Asterisk can send signaling. Asterisk stores the contact temporarily, until the registration expires or the endpoint registers again.
- Endpoint identity: The account name that identifies the phone, such as
bob. - Credentials: The authentication username and secret used to prove that the endpoint may use the account.
- Contact address: The current network address supplied by the phone.
- Registration state: Whether Asterisk currently has a valid contact for that account.
The SIP server accepting registrations is called the registrar. In this setup, Asterisk is the registrar. A successful registration means that Asterisk knows how to attempt to reach the endpoint; it does not automatically create an extension, a calling permission, or a route to another phone.
Prerequisites
Before configuring Ekiga, confirm the following:
- Asterisk is installed, running, and reachable from the computer running Ekiga.
- A SIP account or peer already exists in the Asterisk SIP configuration.
- You know the Asterisk server's IP address or hostname.
- You know the SIP extension or account name, authentication username, and password.
- Ekiga is installed and started. See Install Ekiga on Ubuntu if needed.
- Network connectivity and firewall rules permit SIP signaling and the media traffic negotiated for calls.
You should also understand basic IP addresses, hostnames, terminal commands, Asterisk configuration files, and the Asterisk architecture. Registration may work while audio fails if media ports, NAT, or firewalls are configured incorrectly.
Define SIP accounts in Asterisk
In the legacy chan_sip model, SIP peers are stored in sip.conf. A peer is a configured SIP endpoint or remote SIP entity known to Asterisk. The bracketed section name is the account identifier. For a basic setup, that name is entered as the phone's SIP username.
For example, two independently authenticated accounts might look like this:
[bob]
type=friend
host=dynamic
secret=<strong-unique-bob-password>
context=<internal-context>
[alice]
type=friend
host=dynamic
secret=<strong-unique-alice-password>
context=<internal-context>These are configuration patterns, not passwords to copy. Replace the placeholders with strong, unique secrets and an actual dialplan context.
type=friendis a legacy chan_sip peer behavior that permits the account to be used for both matching and making calls in common configurations.host=dynamictells Asterisk that the endpoint's network address is supplied when it registers. This is appropriate for phones whose address can change, such as clients using DHCP.secretis the SIP password. The same value must be entered in the client.contextassigns the peer to a dialplan context. That context controls which call-routing rules the endpoint can access.- Codec settings can also be specified where required by the deployment. Both sides must have a compatible codec for media negotiation.
After editing sip.conf, reload chan_sip where supported:
sip reloadThat command is entered at the Asterisk CLI, not at the ordinary Linux shell. Configuration changes should be checked carefully, especially when the server is handling active calls.
Configure an Ekiga SIP account
Use the following workflow for the bob account. Menu wording can vary slightly between Ekiga releases.
- Launch Ekiga. Use ordinary desktop privileges unless your environment specifically requires otherwise. An elevated command such as
sudo ekigashould not be the normal choice. - Open the account management interface through Edit, then Accounts.
- Choose the action to add a SIP account.
- Enter the Asterisk server address and the account credentials.
- Save or enable the account, then wait for Ekiga to display a registered state.
| Ekiga field | Value to enter | Asterisk-side source or meaning | Notes |
|---|---|---|---|
| Account name | A descriptive label, such as Bob office phone | Client-side label | It helps you identify the account and does not necessarily have to equal the peer name. |
| Registrar | Asterisk IP address or resolvable hostname | The Asterisk SIP registrar | Use the server that accepts registrations, not an unrelated web or DNS server. |
| User | bob | The bracketed peer name, [bob] | This is the endpoint identity in the basic example. |
| Authentication user | bob | The identity Asterisk expects during authentication | It commonly matches User, but some deployments use a separate authentication identity. |
| Password | The secret configured for bob | secret in sip.conf | Enter the exact value and do not reuse it for another endpoint. |
| Registration timeout | The normal client default | Registration expiry interval | The client refreshes registration after this period. Change it only when the deployment requires a different value. |
The User field identifies the SIP account. The Authentication user is the identity used during the authentication exchange. In a simple Asterisk configuration, both are bob. They can differ in more advanced environments, so use the values supplied by the administrator.
The registration timeout, also called the expiry, is the period for which the server treats the contact as valid. Before it expires, Ekiga normally sends another registration. Retaining a reasonable default is suitable for a basic LAN setup.
After saving the account, look for a visual status such as Registered, an enabled account indicator, or a green status icon. A disabled, offline, or failed status means the client has not completed registration.
Verify registration from the Asterisk CLI
Attach to a running Asterisk instance from a system terminal:
asterisk -rvvvThe Asterisk CLI is the interactive console used to inspect status and administer Asterisk. At the Asterisk prompt, list chan_sip peers:
sip show peersFind bob in the results. The exact columns vary by Asterisk version, but useful information commonly includes:
- The peer name, such as
bob. - The current address or contact recorded by Asterisk.
- The SIP port, commonly a UDP port selected by the endpoint.
- Reachability or qualify information.
- A status indicating whether the peer is reachable, registered, or unavailable.
A configured peer with no current address often means that it has not registered, its registration expired, or Asterisk could not use the supplied contact. A peer marked unavailable may also indicate a firewall, NAT, or network path problem.
To test a second endpoint, configure another Ekiga installation or another SIP client with:
- Registrar: the same Asterisk address.
- User:
alice. - Authentication user:
alicefor the basic example. - Password: the secret configured in the
[alice]section.
When both clients have registered, run sip show peers again. The server-side list should contain both alice and bob, each with a current contact and an acceptable status.
Registration does not create calling rules
Two phones can both be registered and still be unable to call one another. Registration provides endpoint authentication and current reachability. The dialplan provides call-routing logic: it matches what a user dials and selects the actions Asterisk should perform.
Each SIP account has a context. A context is a named section of the dialplan that determines which rules the endpoint may use. The context must contain appropriate extensions or route to a context that does.
The next configuration step is therefore to create dialplan extensions for the numbers users will dial and route those destinations to the corresponding SIP endpoints. For example, an administrator might choose numeric extensions such as 601 for Bob and 602 for Alice, then create rules that call the bob and alice SIP channels. The account names and dialable numbers do not have to be identical, but the mapping must be explicit.
After adding or changing dialplan rules, apply the dialplan configuration, then place a test call while watching the Asterisk CLI. Learn more about contexts, extensions, and what a dialplan is.
| Capability | Provided by | Example evidence | Additional configuration needed |
|---|---|---|---|
| Endpoint authentication | SIP account definition and client credentials | Ekiga reports Registered | Correct peer and secret must exist. |
| Current endpoint reachability | SIP registration and contact storage | sip show peers displays an address | Network, NAT, and firewall support may be required. |
| Dialed-number matching | Dialplan extension patterns or explicit extensions | The dialed string matches a rule | The endpoint context must have access to that rule. |
| Call routing between Alice and Bob | Dialplan applications and SIP destinations | A call to Alice reaches the Alice device | Define routes, reload the dialplan, and verify media. |
Registration verification checklist
| Check location | Expected result | What it confirms | If unsuccessful |
|---|---|---|---|
| Ekiga account status | Registered or equivalent enabled status | The client reached the registrar and completed authentication | Check server address, credentials, Asterisk state, and signaling firewalls. |
| Asterisk peer listing | The peer has an address, port, and reachable or registered status | Asterisk stored a usable contact | Check expiry, NAT, contact information, and network paths. |
| Second endpoint registration | Both alice and bob appear | Each account works independently | Compare the second account's identity and secret with its peer section. |
| Call test after dialplan configuration | The selected destination rings and audio works | Registration, routing, and media are functioning together | Inspect contexts, extension matching, dialplan reloads, NAT, and media ports. |
Troubleshoot registration failures
Ekiga never shows Registered
- Verify the registrar hostname or IP address and test basic connectivity.
- Confirm that Asterisk is running and listening for SIP signaling.
- Compare the User, Authentication user, and password with the peer definition.
- Confirm that the peer permits dynamic registration and that the configuration was loaded.
- Check firewall and NAT behavior. A signaling request may reach the server while the response is blocked.
- Watch the Asterisk CLI while attempting registration; authentication and address errors often appear there.
The peer has no contact or is unreachable
- Restart or re-register the softphone in case its registration expired.
- Review the address, port, and status shown by
sip show peers. - Check whether the endpoint is behind NAT and whether the recorded contact is usable from the server.
- Confirm that the client registered to the intended server and account.
- Use SIP debugging cautiously and only in a controlled environment, because verbose signaling output can expose credentials or private network details.
Both phones register but calls fail
- Confirm registration first; a dialplan problem is different from an authentication problem.
- Check that each account's context contains or can reach the intended dialplan rules.
- Verify that the dialed string matches an extension or pattern.
- Confirm that the route sends the call to the intended SIP endpoint.
- Reload the dialplan after changes and monitor the CLI during a test call.
Authentication repeatedly fails
- Re-enter the password exactly as configured.
- Verify whether the authentication username differs from the displayed SIP user.
- Disable or remove stale duplicate accounts in the client.
- Confirm that the requested account section exists on Asterisk.
- Replace potentially exposed credentials with a newly generated strong secret.
Security and deployment practices
- Use long, random, unique SIP secrets for every endpoint. Do not use simple tutorial passwords in production.
- Never reuse one SIP credential across multiple phones. Separate credentials make revocation and auditing possible.
- Avoid exposing unauthenticated SIP services directly to the public internet.
- Restrict permitted source networks with appropriate access controls where possible.
- Protect the Asterisk management interface and limit administrative access.
- Use TLS for SIP signaling and secure RTP for media when supported and required by the deployment.
- Review NAT, firewall, codec, and media-port settings as a complete design rather than assuming that successful registration proves audio will work.
Key points
- Registration authenticates a SIP endpoint and gives Asterisk its current contact address.
- The peer name, credentials, contact, and registration state describe different parts of the endpoint relationship.
- In the legacy chan_sip model, accounts are commonly defined in
sip.confwith settings such ashost=dynamic,secret, andcontext. - Ekiga's registrar is the Asterisk server address; User and Authentication user commonly match the peer name in a basic setup.
asterisk -rvvvopens the CLI, andsip show peersdisplays chan_sip peer status.- Registered phones still require dialplan rules before users can place calls between them.
- Strong credentials, network restrictions, protected management access, and encrypted signaling and media are important deployment safeguards.