Multiple asterisk servers SIP or PJSIP realtime - asterisk

I have two Asterisk(sip1 and sip2) with one realtime MySQL DB. So any user can register on sip1 or sip2. No problems with outgoing calls to other providers.
The issue I’m having is calling across servers. Say 101 calls 102 - where 101 is registered to sip1 and 102 is on sip2.
When use SIP:
In sip.conf
[general]
rtsavesysname=yes
In sip_peers DB table field "regserver" is filled correctly. But don't understand how can I Dial to each peer
It would be really great if 101 can call to 102 across server.
Maybe it's easier on PJSIP?
I'm using last asterisk version from git by 13/03/2019

You should use ENUM or DUNDi, not realtime peer if you trying to find on which server your extension.

Related

How to signal RPi-WebRTC-Streamer External IP address to the coTurn server?

At the moment, my RWS (RPi-WebRTC-Streamer) application works on my local network. I am now trying to connect it to my hosted coTURN server.
My main_rws_orig.js is pointing at my coTurn server:
var localTestingUrl = "ws://10.0.0.11:8889/rws/ws";
//var pcConfig = {"iceServers": [{"urls": "stun:stun.l.google.com:19302"}]};
var pcConfig = {"iceServers": [{"urls": "stun:172.104.xxx.xxx:3478"}]};
In using https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
I get the following when testing TURN and STUN:
0.009 rtp host 3376904655 udp c7f50fee-cbd0-4332-ae51-a013c4d35c5e.local 41771 126 | 30 | 255
0.091 rtp srflx 842163049 udp 42.116.95.19 41771 100 | 30 | 255
0.158 rtp relay 3617893847 udp 172.104.xxx.xxx 17857 2 | 30 | 255
39.809 Done
39.811
My coTurn web configuration tool is working also.
I have read about a signalling server, but have not found much documentation regarding it. I am just trying to figure out how to finish. How do connect my RWS application to the outside world using coturn.
Any tips or information will be greatly appreciated.
A signalling server is basically a service that sends the ICE candidates betweens the peers of your conversation. Usually it uses Websockets for this communication. The ICE candidates may include the CoTurn server credentials you provide to the WebRTC Object in JavaScript. But you need to share all candidates between the participants and for THIS you need the signalling server. You can use any language that supports full websockets communication like NodeJS or Java (not PHP!).
Take a look at this article, it describes this very well: https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/#how-can-i-build-a-signaling-service
Except you explicitly want to use Peer-To-Peer WebRTC, I recommend you also to take a look at the tutorials of Kurento Media Server to get a better understanding of this principle, the NodeJS/Java is signalling between Kurento and your browser. Please note by using a media server it will be always in the middle between the participants, what has advantages like reducing the network usage of each participant + recording the whole conversation on the media server, but also disadvantages like no end-to-end encryption.
NodeJS example: https://doc-kurento.readthedocs.io/en/6.14.0/tutorials/node/tutorial-one2one.html
Java example: https://doc-kurento.readthedocs.io/en/6.14.0/tutorials/java/tutorial-one2one.html

How to get call on an extension, which is registered when a call towards it reach Kamailio

I am using Kamailio 4.4 as the proxy with my Asterisk server. I am trying to develop a scenario where an extension gets registered on asterisk via Kamailio when it receives a push notification. This push notification is sent to the sip extension when a call towards this extension reaches to the Kamailio.
For example, suppose there is two SIP extension( extension 1 and extension 2) registered on Asterisk via Kamailio. When a call from extension 1 reaches the asterisk, it forwards the INVITE request towards extension 2 via Kamailio.Kamailio will try to forward it to extension 2. suppose the extension 2 is not able to receive the INVITE request from Kamailio. When extension two receive a push notification, it will register on asterisk.
So I need to get the call on extension 2 through the new registration.
We are trying to simulate registration of extension to the asterisk when receiving the push notification.
First, we registered extension 2 and disconnected the network. Then we tried to register the same extension when a call from extension 1 reaches to Kamailio. This is a simulation of push-based registration since an extension that receives the push will attempt to register when an incoming call is received.
When asterisk sends INVITE request to Kamailio, it immediately responded with 100 trying provisional response. This 100 response by Kamailio towards asterisk prevents asterisk from re-transmitting the INVITE.
Then Kamailio tried to send and retransmit the packet to extension 2, which does not have network access. This extension 2 was on port number 24071. Even after successful registration(in port 59995) of the extension 2, Kamailio continued to transmit the packets to the old port.
After that, we have configured Kamailio in a way that it won't send an immediate provisional reply(100 trying ) for INVITE request.
Here Kamailio is not immediately sending 100 trying message to Asterisk. This forces Asterisk to re-transmit. Asterisk was found to retransmit the same packets. However, even after the successful registration of extension 2, asterisk continued to send the old invite to Kamailio not the new one to the latest port.
This is the problem for me since push relies on the INVITE reaching the phone at the correct port number.
So, is there other good approaches to solve this issue?
One thing I would like to try is modifying the pending INVITE request towards old registered port with the new port details when new registration reaches to Kamailio. Can I get the ongoing requests from Kamailio?
Please suggest a viable solution.
Almost any kamailio config availible do similar thing.
You have save into location and consult it when do call.
However if you need really scalable platform you SHOULD NOT forward register requests to asterisk at all.
If kamailio send invite to wrong port, likly that mean you have TWO records in location.

Testing Asterisk SIP and DAHDI local calls

I am a real beginner in asterisk, so please tolerate my question :)
I tried to configure asterisk for realtime and it is working fine for local sip calls. Now, I am trying to make the following test with dahdi calls:
I connected an analog phone to an FXS channel of my Digium card and tried to call this phone (exten 124) from a sip softphone (X-lite).
I get the following error:
-- Executing [124#from-sip:1] Dial("SIP/2000-00000004", "SIP/124")
[May 31 10:24:22] WARNING[5457]: chan_sip.c:5667 create_addr: Purely numeric hostname (124), and not a peer--rejecting
my extensions.conf:
[from-sip]
switch =>Realtime
[from-pstn]
exten => 124,1,Dial(DAHDI/3)
It seems that the dial is done using from-sip context not from-pstn context as required.
Anyone to advise or correct my understanding?
Thanks million
Zak
In Asterisk realtime and not realtime you can configure where to send calls from particular extension, this should be configured in "context"(for realtime check context column), so I believe in your case it is "from-sip". This means all calls from that extension will hit this context, you can't send one call from same extension to one context and other to another, all calls will hit "from-sip" context.

With Asterisk, how to make a call between 2 externals then hangup?

My problem is the following.
I want:
to be called by A
read a code from A (ex. 15334#)
retrieve the phone number of B from a database with the code readed from A
call B
once A is in communication with B, hangup after 3 seconds
For now, it works, BUT when I hangup (after 3 seconds), communication between A and B is closed.
A and B are external numbers.
How to hangup server without closing communication between A & B?
Thanks a lot,
Doing it way you did it called "bridged call". So when you close bridge,it hangup. You need transfer call. Unfortanly that require transfer support from provider side. For sure no one of providers will do this for you for zero cost.
Provider can organize that using other asterisk(at provider side) or special hardware pbx or other hardware/softswitch solution. If provider can do that feature for you, provider will inform you how to do. For example some provider allow do transfer using flash+dtmf command(on analog lines).

Asp.Net Membership with ActiveDirectoryMembership Provider

We're having speed problems still with the login control and the Ad membership provider.
We've tracked it down to a specific issue, when initally trying to connect for the first time, it sends this SAM LOGON message:
117 10.717526 10.140.4.84 10.140.4.223 SMB_NETLOGON SAM LOGON request from client
It Gets sent 4 seperate time on udp port 138 trying to connect to our AD server.
This takes over 30 seconds, the vast majority of our login times.
Is there any way to configure the Ad Membership Privder to not attempt to udp on this port/SAM LOGON,and just skip that step?
or does anyone know what needs to be altered on the server to make it respons to this request?
There was no firewall or anything like that between the machines. They were on the same switch.
Thanks,
adServer was notaccepting connections on 636 so we had to set connectionprotection = none.
it was not documetned anywhere, but I had to put ad\ in front of the username
or connection proteciton=none threw errors.
Once that was fixed the communication was only on 385 and login was very fast.
E-

Resources