# Asterisk PJSIP Tips and Tricks

**Category:** PBX Setup Guides
**URL:** https://www.simtex.com.au/support/kb/pbx-setup-guides/pjsip-tips-tricks
**Published:** 2018-01-10

Using PJSIP and wanting to have multiple devices registered to the same extension?

## Simtex SIP Trunks from $4.99/month

Geo-redundant SIP trunking with Australian-based support. Pay-as-you-go or unlimited plans.

- [View SIP Trunk Plans](/products/sip-trunks)
- [Contact Sales](/contact)

## Multiple Devices per Extension

To ring multiple devices on a single extension, increase `max_contacts` on the AOR and use `PJSIP_DIAL_CONTACTS` in your dialplan.

### pjsip.conf

```
`[6001_Aors]
type = aor
max_contacts = 2
qualify_frequency = 50`
```

### extensions.conf

```
`; Old (rings only the last registered device):
exten => _6XXX,1,Dial(PJSIP/${EXTEN})

; New (rings ALL registered devices simultaneously):
exten => _6XXX,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})})`
```

`PJSIP_DIAL_CONTACTS` expands to a comma-separated list of all registered contacts for that endpoint, so every device rings.

## Useful CLI Commands

These Asterisk CLI commands are essential for debugging PJSIP trunk and endpoint issues.

### Registration & Trunk Status

```
`# Check trunk registration status
asterisk -rx 'pjsip show registrations'

# Show all configured endpoints
asterisk -rx 'pjsip show endpoints'

# Detailed view of a specific endpoint
asterisk -rx 'pjsip show endpoint Simtex_Endpoint'

# Show AOR contact bindings (which devices are registered)
asterisk -rx 'pjsip show aors'

# Check a specific AOR's contacts
asterisk -rx 'pjsip show aor 6001_Aors'`
```

### Live Debugging

```
`# Watch SIP traffic in real time (signalling only)
asterisk -rx 'pjsip set logger on'

# Turn it off when done (very verbose)
asterisk -rx 'pjsip set logger off'

# Show active channels / calls
asterisk -rx 'core show channels'

# Show active calls with detail
asterisk -rx 'core show calls'

# Reload PJSIP config without restart
asterisk -rx 'pjsip reload'`
```

> **Tip:**
> **`pjsip set logger on`** is the PJSIP equivalent of `sip set debug on` from chan_sip. It dumps full SIP message traces to the CLI &mdash; invaluable for diagnosing registration failures, one-way audio, or codec negotiation issues. Remember to turn it off when done.

## Common Troubleshooting

### Trunk won't register

```
`# Check registration status and error
asterisk -rx 'pjsip show registrations'

# Look for auth failures in the log
asterisk -rx 'pjsip set logger on'
# Then trigger a re-register:
asterisk -rx 'pjsip send unregister Simtex'
asterisk -rx 'pjsip send register Simtex'`
```

Common causes: wrong credentials, firewall blocking outbound SIP, DNS resolution failure.

### One-way audio

Usually a NAT issue. Verify your transport config includes:

```
`[Transport-TCP]
type = transport
protocol = tcp
bind = 0.0.0.0
local_net = 192.168.0.0/16
external_media_address = YOUR.PUBLIC.IP
external_signaling_address = YOUR.PUBLIC.IP`
```

### No audio at all

```
`# Check RTP port range is open
asterisk -rx 'rtp show settings'

# Verify codec negotiation
asterisk -rx 'pjsip show endpoint Simtex_Endpoint' | grep allow`
```

## Simtex Portal &mdash; Live Endpoint Monitoring

In addition to Asterisk CLI tools, the **Simtex Customer Portal** provides real-time visibility into your SIP registrations without needing SSH access to your PBX.

### Subscriptions Page

Navigate to **Subscriptions** in the portal to see:

- **Endpoint status indicators** &mdash; green (registered), red (unregistered), grey (unknown) for every SIP endpoint on your account
- **Endpoint filtering** &mdash; search and filter endpoints to quickly find specific devices
- **Registration data** &mdash; view the registered contact URI, user agent, and last registration timestamp

### SIP Events Timeline

Click into an endpoint to access the **SIP Events Timeline** &mdash; a chronological view of registration and unregistration events. Useful for:

- Confirming whether a phone has registered recently
- Diagnosing intermittent registration drops
- Verifying failover behaviour after network changes
- Correlating phone issues with network events

> **Tip:**
> If a customer reports their phone "isn't working", check the **Subscriptions** page first &mdash; you can instantly see if the endpoint is registered without touching the PBX. The SIP Events Timeline will show you exactly when it dropped.

## Caller ID Tips

### Set outbound caller ID per trunk

```
`[Simtex_Endpoint]
type = endpoint
from_user = 214XXXXXXX
send_pai = yes
send_rpid = yes
trust_id_inbound = yes`
```

### Override caller ID per call in dialplan

```
`; Set caller ID before dialling out
exten => _0.,1,Set(CALLERID(num)=61894883344)
 same => n,Dial(PJSIP/${EXTEN}@Simtex_Endpoint)`
```

> **Info:**
> Simtex validates outbound caller IDs against your account. Only DIDs allocated to your trunk will be transmitted &mdash; any other number is replaced with your main trunk number.

## Related

**[PJSIP Configuration on Asterisk](/support/kb/pbx-setup-guides/pjsip-configuration-asterisk)** &mdash; full trunk setup guide

## Related

- Article: https://www.simtex.com.au/support/kb/pbx-setup-guides/pjsip-tips-tricks
- Category: https://www.simtex.com.au/support/kb/pbx-setup-guides
- Knowledge Base: https://www.simtex.com.au/support/kb
- Full AI reference: https://www.simtex.com.au/llms-full.txt
