VoIP Phones - Asterisk: Difference between revisions
Appearance
Content deleted Content added
m Make the outbound context clear |
m Don't feel comfortable with live number in example. No point in allowing ulaw because AAISP don't use it |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 26: | Line 26: | ||
==PJSIP: Trunk registration== |
==PJSIP: Trunk registration== |
||
Here is an example of a working pjsip.conf setup where Asterisk will register with A&A |
Here is an example of a working pjsip.conf setup where Asterisk will register with A&A in the same way as a SIP phone does in order to make outgoing calls. Incoming calls are sent to all registered SIP "phones".<br /> |
||
It is recommended you read the "PJSIP: NAT Issues: Keep-Alive / Anti-Idle" section below as you may wish to comment out or drastically increase the qualify_frequency line(s) if your Asterisk is not behind NAT. |
It is recommended you read the "PJSIP: NAT Issues: Keep-Alive / Anti-Idle" section below as you may wish to comment out or drastically increase the qualify_frequency line(s) if your Asterisk is not behind NAT. |
||
In pjsip.conf: |
In pjsip.conf: |
||
[ |
[reg_441234567890] |
||
type = registration |
type = registration |
||
retry_interval = 20 |
retry_interval = 20 |
||
| Line 39: | Line 39: | ||
contact_user = maininbound |
contact_user = maininbound |
||
expiration = 120 |
expiration = 120 |
||
outbound_auth = |
outbound_auth = auth_reg_441234567890 |
||
client_uri = sip:+ |
client_uri = sip:+441234567890@voiceless.aa.net.uk |
||
server_uri = sip:voiceless.aa.net.uk |
server_uri = sip:voiceless.aa.net.uk |
||
[ |
[auth_reg_441234567890] |
||
type = auth |
type = auth |
||
password = |
password = SecretPasswordGoesHere |
||
username = + |
username = +441234567890 |
||
[aaisptrunk] |
[aaisptrunk] |
||
type = aor |
type = aor |
||
contact = sip:+ |
contact = sip:+441234567890@voiceless.aa.net.uk |
||
qualify_frequency=20 |
qualify_frequency=20 |
||
[aaisptrunk_servera] |
[aaisptrunk_servera] |
||
type = aor |
type = aor |
||
contact = sip:+ |
contact = sip:+441234567890@a.voiceless.aa.net.uk |
||
qualify_frequency=20 |
qualify_frequency=20 |
||
[aaisptrunk_serverb] |
[aaisptrunk_serverb] |
||
type = aor |
type = aor |
||
contact = sip:+ |
contact = sip:+441234567890@b.voiceless.aa.net.uk |
||
qualify_frequency=20 |
qualify_frequency=20 |
||
| Line 74: | Line 74: | ||
disallow = all |
disallow = all |
||
allow = alaw |
allow = alaw |
||
allow = ulaw |
|||
direct_media = no |
direct_media = no |
||
rtp_symmetric = yes |
rtp_symmetric = yes |
||
aors = aaisptrunk,aaisptrunk_servera,aaisptrunk_serverb |
aors = aaisptrunk,aaisptrunk_servera,aaisptrunk_serverb |
||
outbound_auth= |
outbound_auth=auth_reg_441234567890 |
||
The "contact_user" option in the registration section sets the context for incoming calls to Asterisk, in this example calls come into the context "maininbound" in extensions.conf |
|||
===extensions.conf=== |
===extensions.conf=== |
||
| Line 88: | Line 87: | ||
exten = maininbound,n,Voicemail(222@default,us) |
exten = maininbound,n,Voicemail(222@default,us) |
||
You can dial out via the trunk with: |
You can dial out via the trunk with (probably in a context like "from-internal"): |
||
[mainoutbound] |
|||
exten => _X.,1,Dial(PJSIP/${EXTEN}@aaisptrunk,,) |
exten => _X.,1,Dial(PJSIP/${EXTEN}@aaisptrunk,,) |
||
| Line 98: | Line 97: | ||
==PJSIP: Trunk without registration== |
==PJSIP: Trunk without registration== |
||
If you don't need Asterisk to make outgoing calls, you can have A&A send incoming calls directly to Asterisk. Use the above example but do not include the top section for "[reg_442082881111]" and the 'outbound_auth' item in the aaisptrunk endpoint. |
|||
Then set the AAISP control panel to point to your server by hostname or IP address:<br /> |
Then set the AAISP control panel to point to your server by hostname or IP address:<br /> |
||
Outgoing calls require registration, and you'll automatically receive incoming calls to registered "phones". If you register Asterisk and have calls sent directly to Asterisk you'll receive 2 copies of each call. |
|||
[[File:Asterisk pjsip noregistration.png|border]] |
[[File:Asterisk pjsip noregistration.png|border]] |
||
| Line 232: | Line 234: | ||
exten => _X.,1,Dial(SIP/voiceless-out/${EXTEN}) |
exten => _X.,1,Dial(SIP/voiceless-out/${EXTEN}) |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
For inbound calls (assuming you're routing |
For inbound calls (assuming you're routing calls to a context named "snom"): |
||
<syntaxhighlight lang="ini"> |
<syntaxhighlight lang="ini"> |
||
[voiceless-in] |
[voiceless-in] |
||