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.confdetermine 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=friendis 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=dynamictells Asterisk to learn the endpoint's current address from registration rather than requiring a fixed IP address.secretis the shared SIP password. The client must use the matching value.context=internalassigns the endpoint to theinternaldialplan context.calleridis 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:
ekigaUse 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
- Open Ekiga's account manager or account settings.
- Choose the option to add or create an account.
- Select SIP as the account type or protocol.
- Enter the Asterisk server address and the credentials for one endpoint.
- Save or apply the account.
- 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.10orpbx.example.test - User:
bob - Authentication user:
bob - Password: The strong secret configured for the
[bob]endpoint - Registration expiry:
3600seconds, 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 field | Value to enter | Asterisk source or configuration counterpart | Notes |
|---|---|---|---|
| Account name or label | A local description such as Bob at local PBX | No direct authentication counterpart | Descriptive only; it is not the SIP username. |
| Registrar | Asterisk DNS name or IP address | The server running the SIP service | Use a stable hostname or correctly routed private address when appropriate. |
| User | bob or alice | Usually the chan_sip section name, such as [bob] | This identifies the SIP endpoint. |
| Authentication user | Normally the same endpoint identifier | The identity expected during SIP authentication | It may differ in advanced deployments. |
| Password | The endpoint's shared secret | secret=... | The client and server values must match exactly. |
| Registration timeout or expiry | For example, 3600 seconds | The requested SIP registration interval | The 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 -rvvvThen list legacy chan_sip peers:
sip show peersInspect a particular peer in more detail with:
sip show peer bobThe peer list can show concepts such as:
- Peer name: The configured identity, such as
boboralice. - Host or address: The current network address associated with the peer.
- Dynamic registration: A peer configured with
host=dynamicreceives 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
1001matches the first rule and calls the legacy chan_sip endpointbob. - Dialing
1002matches the second rule and calls the legacy chan_sip endpointalice. Dial(SIP/bob)uses the chan_sip channel technology and the endpoint name fromsip.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 reloadIf you changed the legacy SIP endpoint definitions, reload chan_sip as well:
sip reloadThe basic test flow is now:
- Bob registers with Asterisk.
- Bob dials
1002. - Asterisk looks for
1002in Bob's assignedinternalcontext. - The dialplan invokes
SIP/alice. - 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.
| Task | Legacy chan_sip | PJSIP-based Asterisk |
|---|---|---|
| List endpoint status | sip show peers | pjsip show endpoints |
| Inspect a specific endpoint | sip show peer bob | pjsip show endpoint bob |
| Reload SIP configuration | sip reload | pjsip 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
| Symptom | Likely cause | How to verify | Corrective action |
|---|---|---|---|
| Authentication rejected | Wrong username, authentication user, password, or registrar | Compare Ekiga with the endpoint definition; inspect Asterisk CLI messages and run sip show peer bob. | Correct the registrar, identity, authentication identity, or secret. |
| Server unreachable | Asterisk is stopped, the address is wrong, or routing or firewall rules block SIP signaling | Confirm 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 unregistered | The endpoint configuration is inactive, the client cannot reach the server, or the address is incorrect | Check 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 another | Both devices use the same SIP account and the endpoint accepts one contact | Compare 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 fail | No matching dialplan extension, wrong context, wrong endpoint target, or an unreloaded dialplan | Check 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 audio | RTP firewall blocks, incomplete NAT settings, unreachable advertised media address, or incompatible codecs | Review 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.confsection name, and the password matchessecret. host=dynamicmeans Asterisk learns the endpoint's current address through registration.- The endpoint's
contextdetermines which dialplan namespace it can access. - Use
sip show peersandsip show peerfor 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.