Asterisk sip trunk peer NIC - asterisk

I'm working with Asterisk 14.7.6 and Freepbx 14.0.13.23 in a ec2 instance on AWS
At this moment I have a sip trunk with 3CX server working, I need to make another one with the same one.
I have had an idea of add another NIC in the asterisk and add externip parameter in the sip.conf file to add anocher sip trunk and I did it. When I puted sip show peers in the asterisk console, it shows "Status OK (100 ms)" but in 3CX the traffic incoming was from the first trunk.
It's possible create this kind of sip trunk? or I need to launch another machine create a kind of bridge between my asterisk and 3CX?
Thanks,

Only way do that without starting second INSTANCE of asterisk is use chan_pjsip or combination of chan_pjsip+chan_sip.
For first variant you should do multiple endpoints entity. For second just put one channel on one ip, second on other ip.
You also can start more than one asterisk process on host by using
asterisk -C asterisk_config.conf

Related

Losing Synergy connection to server with VPN

I'm using a Cisco client to connect to a VPN but also using Synergy (Symless) to connect to the machine. It works fine initially but will drop out after machine sleep (or sometimes seemingly randomly), then I have to restart the VPN connection. Not the end of the world, but it is irritating.
Are there any config changes I can do to Networks settings, VPN or Synergy to stop this dropping out?
Found this which I hope will fix it.
https://blog.lan-tech.ca/2013/02/21/access-local-and-vpn-network-simultaneously/
"you just need to add the local devices to the windows routing tables so that it knows to access them when the VPN is active.
See the windows “route” command – E.G. route -p add MASK 255.0.0.0 METRIC IF
To help discover what you need to use, disconnect from your VPN, make sure you can connect to your local device, then run a “route print” show the current active routes and find your device. (generally in the IPv4 Route Table)
It will also list the ‘Metric’ to use, and at the top of the listing is the “Interface List” which lists the network interfaces on your system. You’ll need to figure out which one to use. For example, I know my system has a gigabit network adapter and in the list I see a “Intel(R) Gigabit Network Connection” – bingo – that’s it. The first column is the interface id, 49 in my case.
The “-p” option makes your configuration persistent – meaning that it will be there again next time you boot.
SO, as an example, let’s say I want a local network share at 192.168.1.43 to be accessible to my machine while connected to the VPN, so I would add the route like so:
route -p add 192.168.1.43 MASK 255.0.0.0 192.168.1.1 METRIC 15 IF 49
Now if I run route print, I see this new route in the list of persistent routes for IPv4.
I turn my VPN back on, and instead of the device ‘disappearing’ as it normally does, windows can still find it because it is in the persistent route list."

Route Call in Asterisk Server

I have a scenario in which I want to route calls to sip a server from Asterisk but I want to do some thing like this
the sip server is running on : 192.168.1.10 and
Asterisk server is running on : 192.168.1.4
client Diales---->sip:111#192.168.1.4---->To Asterisk and then Asterisk route the calls------->sip:111#192.168.1.10 --------> sip server
Can someone tell me how can I do this in Asterisk configuration routing file .
As os11k said, you need SIP trunk to do this. I'll add some detail information about issues we encountered when we setup SIP trunk between two cities.
Add a SIP trunk in sip.conf
Make sure you put sendrpid=yes in the SIP trunk configuration, or, 192.168.1.10 will not get the caller id.
Optionally, you may want to set context of the SIP trunk to a different context rather than default, say context=sip-server-192-168-1-10.
Optionally, you may disallow or allow some codecs if 192.168.1.10 only works with specific codecs.
SIP trunk sample
[general]
register => SIP_ACCOUNT:SIP_PASSWORD#TheOtherSipServer
[TheOtherSipServer]
type=peer
context=sip-server-192-168-1-10
host=192.168.1.10
defaultuser=THE_ACCOUNT_HERE
fromuser=THE_ACCOUNT_HERE
remotesecret=THE_PASSWORD_OF_ACCOUNT_HERE
; if you want to send the remote caller id to 192.168.1.10, then set sendrpid=yes .
; you also need to trust the remote caller id in 192.168.1.10 .
sendrpid=yes
; if 192.168.1.10 can dial out from here, you need to set trustrpid=yes so you can get the caller id
;trustrpid=yes
; if 192.168.1.10 is picky on codecs
;disallow=all
;allow=THE_CODEC_NAME_ALLOWED_BY_THE_OTHER_SIP_SERVER
Setup dial plan in extensions.conf
Dial is all you needed unless you need special requirement.
Dialplan sample
[globals]
SIPTrunk=SIP/TheOtherSipServer
[sip-server-192-168-1-10]
;exten=>111,1,Dial(SIP/TheOtherSipServer/111)
exten=>111,1,Dial(${SIPTrunk}/${EXTEN})
You need to set-up sip trunk on your Asterisk server.
Check this page for more info:
https://www.beardy.se/how-to-set-up-a-sip-trunk-in-the-asterisk-pbx
http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf

Asterisk multiple IP registration

I have Linux box with several IP addresses running Asterisk.
Is there a way to force asterisk to make trunk registrations from specific (not default) IP addresses? I need to connect 2 users from the same asterisk box to the same provider via different IPs.
Thanks a lot in advance for your help.
You have use 3 trunks and source-based routing.
Asterisk will select interface from which packet have be send based on source-routing.
Put Host="Client IP Address" in the sip peers. You need to create two different sip peers for two users.
You can use the trunk using pattern matchin/ dial plan.

connect to specific asterisk instance CLI

On a centos dedicated server,
I'm running two asterisk instances on different bind IPs.
when I do
asterisk -r
It connects to default asterisk instance which was started first.
I have tried :
asterisk -r -s NEW_IP_OF_SECOND_INSTANCE:5060
It gives unable to connect.
But IP and port are both correct. netstat shows listening ports.
How to I connect to that second asterisk instance?
-s option is used to specify Asterisk socket file (like /var/run/asterisk/asterisk.ctl). If you have multiple Asterisk instances running on one server, use this option with appropriate asterisk.ctl file.
5060 is a SIP port number, used to originate and receive VoIP calls rather than for management purposes, so you can't use it with asterisk -r command

Softphone & Asterisk on same machine in centos?

I am using Asterisk & java application for voip project in centos.
Now i am trying to use open source softphone on same machine where asterisk present. I try pjsua but when ever asterisk on pjsua not work & when ever asterisk stop pjsua works...
Now i am also trying to find out in Asterisk there is App-Konference..is there way to fetch audio coming from 1 sip phone to asterisk & we can send it. like softphone do?
Means person who handle asterisk server he also talk with other sip phones...
Is this possible?
You need to change the port pjsua is listening on. Asterisk is listening on udp 5060 and your phone wants to listen on the same port.
Change the port to 5061 and you will be fine.
I do not understand the sacond part of your question.
What do you want to do exactely?

Resources