VoIP Phones - Asterisk: Difference between revisions
Appearance
Content deleted Content added
| Line 7: | Line 7: | ||
= Configuration = |
= Configuration = |
||
Asterisk has two methods to configure SIP connections. The legacy "sip.conf" (SIP) and the more modern "pjsip.conf" (PJSIP). |
|||
Newer installations of Asterisk should be configured to use PJSIP as it will be more supported as Asterisk development continues. It isn't a good idea to have an installation that mixes sip.conf with pjsip.conf. |
|||
When reading the instructions below be aware which are for sip.conf and which are for pjsip.conf. PJSIP examples are below the SIP examples on this page. |
|||
== Incoming Calls == |
== Incoming Calls == |
||
=== User Section === |
=== User Section === |
||
| Line 77: | Line 82: | ||
==Note: Order of sip.conf is important== |
==Note: Order of sip.conf is important== |
||
In sip.conf, ensure that your incoming config is before the config for the outgoing. |
In sip.conf, ensure that your incoming config is before the config for the outgoing. |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
==Note: Asterisk and IPv6 SLAAC addresses== |
==Note: Asterisk and IPv6 SLAAC addresses== |
||
| Line 103: | Line 97: | ||
Localnet should of course be set to whatever RFC1918 range you are using on your LAN. |
Localnet should of course be set to whatever RFC1918 range you are using on your LAN. |
||
=PJSIP= |
|||
==Dialplan== |
==Dialplan== |
||
| Line 117: | Line 112: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
==PJSIP: Trunk registration== |
|||
Here is an example of a working pjsip.conf setup where Asterisk will register with A&A to receive calls. |
|||
In pjsip.conf: |
|||
[reg_442082881111] |
|||
type = registration |
|||
retry_interval = 20 |
|||
fatal_retry_interval = 20 |
|||
forbidden_retry_interval = 20 |
|||
max_retries = 9999 |
|||
auth_rejection_permanent = no |
|||
contact_user = maininbound |
|||
expiration = 120 |
|||
outbound_auth = auth_reg_442082881111 |
|||
client_uri = sip:+442082881111@voiceless.aa.net.uk |
|||
server_uri = sip:voiceless.aa.net.uk |
|||
[auth_reg_442082881111] |
|||
type = auth |
|||
password = BusinessPaidGrewCome |
|||
username = +442082881111 |
|||
[aaisptrunk] |
|||
type = aor |
|||
contact = sip:+442082881111@voiceless.aa.net.uk |
|||
qualify_frequency=20 |
|||
[aaisptrunk] |
|||
type = identify |
|||
endpoint = aaisptrunk |
|||
match = voiceless.aa.net.uk |
|||
[aaisptrunk] |
|||
type = endpoint |
|||
context = maininbound |
|||
dtmf_mode = rfc4733 |
|||
disallow = all |
|||
allow = alaw |
|||
allow = ulaw |
|||
direct_media = no |
|||
aors = aaisptrunk |
|||
outbound_auth=auth_reg_442082881111 |
|||
Calls come into the context "maininbound" in extensions.conf - in this example calls get sent onto extension 222 and 205 for 20 seconds and then go to voicemail. |
|||
[maininbound] |
|||
exten = maininbound,1,Dial(PJSIP/222&PJSIP/205,20) |
|||
exten = maininbound,n,Voicemail(222@default,us) |
|||
In extensions.conf you can dial out via the trunk with: |
|||
Dial(PJSIP/0800500005@aaisptrunk,,) |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
=Further Help= |
=Further Help= |
||