I will give an example of setting up a SIP Trunk in Asterisk from Kyivstar. Once it was necessary to increase the number of incoming lines, at first I used Goip4 gateways and 6 Kyivstar SIM cards, but when all the lines were busy, the clients could not get through, even hear the answering machine / voice menu, so I signed a contract for SIP Trunk with the Kyivstar manager.
To make forwarding from the last GSM SIM card to a SIP number free, the manager added this GSM and SIP number to the same group. I left everything with GSM SIM cards, since they will work even when there is no Internet in the call center, and the SIP number works via the Internet. With USSD requests, I set up forwarding on “Busy” and “Unavailable”, example:
GSM1->GSM2->GSM3->GSM4->GSM5->GSM6->SIP
For a SIP number and a group, the monthly fee was about a little over $30 per month.
Enabling and activating call forwarding on “Unavailable” (check *#62#):
**62*Number#
Enabling and activating forwarding when “Busy” (check *#67#):
**67*Number#
Read more about forwarding on the official website
kyivstar.ua/ru/mm/services/network/divert
You can contact the manager by submitting an application on the page
kyivstar.ua/uk/business/fixed/services/ip-telephone-lines
The Kyivstar manager reported the following parameters:
UDP protocol, G.711a codec, packetization: 20ms; without CN(RFC3389).
DTMF transmission method: RFC2833, payload type: 101
Well g711a is alaw (G.711 A-law), let’s see the list of available codecs:
asterisk -rvv
core show codecs
exit
Since the connection will be via UDP protocol, registration does not need to be performed, and authorization will be based on the IP address of the server with Asterisk, which I told the manager.
In the /etc/asterisk/users.conf file I added the following parameters:
[kyivstarsip]
trunkname=kyivstarsip
host=x.x.x.x(IP Kyivstar)
context=from-kyivstarsip
insecure=port,invite
fromuser=xxx(SIP number)
fromdomain=x.x.x.x(IP Kyivstar)
type=peer
disallow=all
allow=alaw
nat=no
canreinvite=no
dtmfmode=rfc2833
qualify=yes
qualifyfreq=20
Next, set up as usual, a simple example for incoming calls:
[from-kyivstarsip]
exten => s,1,DIAL(SIP/205,60)
exten => s,n,Hangup()
After changing the configuration, restart Asterisk or tell it to reread the configuration files.
See also my articles:
Configuring SIP Trunk in Asterisk from Ukrtelecom
My other articles about Asterisk