It should not shock anyone that Asterisk wants to talk VoIP. In any case, so as to do as such, Asterisk has to figure out which work it is to play out: that of voip client, server, or both. One of the most unpredictable and regularly confounding ideas in Asterisk is the naming plan of inbound and outbound verification.
Users, Peers and Friends in asterisk
Associations that confirm to us, or that we validate, are characterized in the iax.conf and sip.conf documents as users and companions. Associations that do both might be characterized as companions. While figuring out what direction the validation is happening, it is constantly critical to see the bearing of the channels from Asterisk's perspective, as associations are being acknowledged and made by the Asterisk server.
An association characterized as a user is any framework/user/endpoint that we permit to interface with us. Remember that a user definition doesn't give a technique which to call that userthe user type is used just to make a channel for approaching calls.120 A user definition will require a context name to be characterized to show where the approaching validated call will be set in the dialplan (in extensions.conf).
120 In SIP, this isn't generally the situation. In the event that the endpoint is a SIP intermediary administration (instead of a user operator), Asterisk will validate dependent on the friend definition, coordinating the IP address and port in the Contact field of the SIP header against the hostname (and port, whenever determined) characterized for the companion (if the port isn't indicated, the one characterized in the [general] segment will be used). See the conversation of the SIP shaky alternative in Appendix A for additional regarding this matter.
An association characterized as a companion type is an active association. Consider it along these lines: users place calls to us, while we place calls to our companions. Since peers don't put calls to us, a friend definition doesn't commonly require the design of a context name. In any case, there is one special case: if calls that start from your framework are come back to your framework in a loopback, the approaching calls (which begin from a SIP intermediary, not a user operator) will be coordinated on the friend definition. The default context should deal with these approaching calls suitably, in spite of the fact that it's best for contexts to be characterized for them on a for each companion premise.
So as to realize where to send a call to a host, we should know its area comparable to the Internet (that is, its IP address). The area of a companion might be characterized either statically or powerfully. A unique friend is designed with host=dynamic under the companion definition heading. Because the IP address of a powerful friend may change continually, it must enroll with the Asterisk box to tell it what its IP address is, so calls can effectively be directed to it. On the off chance that the remote end is another Asterisk box, the use of a register explanation is required, as examined underneath.
Characterizing a sort as a companion is an alternate way for characterizing it as both a user and a friend. Be that as it may, associations that are both a user and a friend aren't constantly characterized along these lines, because characterizing every bearing of call creation exclusively (utilizing both a user and a companion definition) permits greater granularity and power over the individual associations.
Figure 8-1 shows the progression of confirmation control comparable to Asterisk.
A register explanation is a method for telling a remote companion where your Asterisk confine is connection to the Internet. Asterisk uses register explanations to verify to remote suppliers when you are utilizing a powerful IP address, or when the supplier doesn't have your IP address on record. There are circumstances when a register articulation isn't required, however to exhibit when a register explanation is required, we should take a gander at a model.
Let's assume you have a remote companion that is giving DID administrations to you. At the point when somebody calls the number +1-800-555-1212, the bring goes over the physical PSTN network to your specialist co-op and into their Asterisk server, perhaps over their T-1 association. This call is then directed to your Asterisk server by means of the Internet.
Your specialist co-op will have a definition in either their sip.conf or iax.conf arrangement record (contingent upon whether you are associating with the SIP or IAX convention, separately) for your Asterisk server. On the off chance that you get calls just from this supplier, you would characterize them as a user (in the event that they were another Asterisk framework, you may be characterized in their framework as a friend).
Presently suppose that your crate is on your home Internet association, with a powerful IP address. Your specialist organization has a static IP address (or maybe a completely qualified space name), which you place in your design document. Since you have a unique location, your specialist organization determines host=dynamic in its setup record. So as to realize where to course your +1-800-555-1212 call, your specialist organization has to know where you are situated comparable to the Internet. This is the place the register proclamation comes into use.
The register proclamation is a method for validating and telling your friend where you are. In the [general] area of your arrangement document, you would put an announcement like this:
register => username:secret@my_remote_peer
You can check a fruitful register with the use of the iax2 show vault and sip show library directions at the Asterisk reassure.