Workshop: verschil tussen versies

Uit Limesco Wiki
Ga naar: navigatie, zoeken
(Start of Workshop)
 
Regel 37: Regel 37:
  
 
As soon as the SIP phone is connected, call 1234 on it. You will hear a thank-you message from Asterisk.
 
As soon as the SIP phone is connected, call 1234 on it. You will hear a thank-you message from Asterisk.
 +
 +
= Calling smbp =
 +
 +
The rules in your dialplan (<tt>Answer, Wait, Playback, Hangup</tt>) are <strong>applications</strong>. There are many applications that you can use during a call. To get a list of applications, open your Asterisk CLI and run:
 +
 +
<pre>
 +
yourpbx*CLI> core show applications
 +
</pre>
 +
 +
One of the applications is called <tt>Dial</tt>. You use it to forward the call to other channels, for example SIP channels. The top of <tt>sip.conf</tt> explains how to use <tt>Dial</tt> to call SIP channels. Hint: the extension rule starts with <tt>exten => 1234,n,Dial(SIP/</tt>...
 +
 +
smbp's IP address is 192.168.178.170. Call the extension "1234" on it to receive the same message. Don't forget to reload your dialplan after changing it using <tt>dialplan reload</tt>.

Versie van 16 sep 2013 om 20:24

SIP registration

Add to sip.conf:

[sipphone]
type=friend
host=dynamic
context=from-sipphone
secret=geheim
insecure=invite

Add to extensions.conf:

[from-sipphone]
; Here will be the dialplan rules that are relevant
; when we call a number from the SIP phone.
exten => 1234,1,Answer
exten => 1234,n,Wait(1)
exten => 1234,n,Playback(demo-thanks)
exten => 1234,n,Hangup

Open your Asterisk console using asterisk -vvvR (may need to run as root), then:

yourpbx*CLI> sip reload
yourpbx*CLI> dialplan reload
yourpbx*CLI> sip show peers
Name/username      Host               Dyn Forcerport ACL Port     Status     
sipphone/sipphone  (Unspecified)      D   N              0        Unmonitored

Now, configure your phone to connect to your Asterisk instance (over UDP). Watch your Asterisk log. When it connects, you will see a message. If it doesn't, use sip set debug on to find out whether you're receiving INVITE messages and see their contents.

As soon as the SIP phone is connected, call 1234 on it. You will hear a thank-you message from Asterisk.

Calling smbp

The rules in your dialplan (Answer, Wait, Playback, Hangup) are applications. There are many applications that you can use during a call. To get a list of applications, open your Asterisk CLI and run:

yourpbx*CLI> core show applications

One of the applications is called Dial. You use it to forward the call to other channels, for example SIP channels. The top of sip.conf explains how to use Dial to call SIP channels. Hint: the extension rule starts with exten => 1234,n,Dial(SIP/...

smbp's IP address is 192.168.178.170. Call the extension "1234" on it to receive the same message. Don't forget to reload your dialplan after changing it using dialplan reload.