8
votes

I almost managed to init a 2 sided call (click to call): 1st to my office and the 2nd to my cell using Michal Niklas answer (thanks Michal) on Asterisk click to call.

The major ISSUE is that the 2 call participants can not hear one each other, I used from-internal context for both of them. The system status web UI shows me 4 active channels and 2 external calls when the call is connected with both sides.

I configured the Channel: local/MY OFFICE PHONE@from-internal Extension: MY CELL PHONE

when I set the Channel to Sip/1 and check it with soft phone it works great!

Thanks for helping...

6

6 Answers

12
votes

seems to be NAT issue. here are some suggestions for sip.conf

put nat=yes in user definition and in [general] tag, put externip and localnet

e.g.

[general]
externip=<your global IP>
localnet=192.168.2.0/255.255.0.0
1
votes

Sounds like a NAT issue; did you correctly forward the RTP ports? Did you configure the STUN server in the softphone (if any)?

1
votes

configure in /etc/asterisk/rtp.conf

[general]
rtpstart=10000
rtpend=20000

go to asterisk cli

rasterisk -vvvvvvvvvvvvvvvv
core reload
1
votes

In my case, I had to go change the chan sip settings (freepbx.tld/admin/config.php?display=sipsettings) from nat to route

enter image description here

1
votes

Besides NAT problems I've also faced this issues on 3 cases:

1) Missconfigured parameter localnet: on /etc/asterisk/sip.conf make sure you set the network address for the phones. You can alos add multiple networks, for example: localnet=172.16.1.0/24 localnet=192.168.1.0/24

2) Not answered calls: in your dialplan (/etc/asterisk/extensions.conf) you need to answer calls before they can send any audio (RTP), make sure every call runs through an Answer().

3) Multiple answers in a single call: a call can be answered only a single time, in some asterisk versions you won't receive audio if a call is answered twice or more times so make sure you don't.

Anyways, why is Asterisk placing 2 calls? The general workaround for a click to call is: to call Alice and when Alice answers (and only when it answers) place a call to Bob, which will be connected directly to Alice, so you should have only 1 call with 2 channels anytime.

Maybe this can help: https://community.asterisk.org/t/how-to-make-a-click-to-call/74080/2

-1
votes

Try adding/changing you're IPAddress in sip_nat.conf

vi /etc/asterisk/sip_nat.conf

Add/change

nat=yes
externip=XXX.XXX.XXX.XXX

Save, quit and restart