TIPS res_corosync.c: won't compile

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
I've been spending days to figure out how to exchange device states on different sites.

Corosync seemed to be my first choice, the setup is straight-forward and simple (https://wiki.asterisk.org/wiki/display/AST/Corosync).

But when compiling asterisk, the res_corosync.c is skipped, trying to compile is manually (gcc) fails as well.

Also the res_corosync.so is not included in any bootable distribution so far (Freepbx, Raspbx ..)

The corosync-service is working (installed manually) , but I can't call "corosync show members" from the CLI because the module is not loaded in asterisk (res_corosync.so missing).

I'm using asterisk 13.10.0.

I would be grafeful for any suggestions to setup cross-site states.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
If you have installed the pre-requisites (corosync and corosysnc-dev or devel depending on your OS) AND then run ./configure AGAIN, the make menuselect should show it "makeable".

And BTW , it works perfectly.
 
Last edited:

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
You mean to run ./configure in the Asterisk-Source?
I've tried to do so, but it won't compile..

Now I'm running a PHP script to update the BLF cross-site, but it's complicated and Pick-up isn't possible either.
 

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
It works!!
"corosysnc-dev" was the necessary part I forgot to install :)
 

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
Now I'm getting:
res_corosync.c:891 load_module: Failed to initialize cfg: (100)"
res_corosync.c:858 cleanup_module: Failed to finalize cfg (9)

At least the module is found by asterisk now..
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
Corosync needs to be running and the asterisk user needs to have access to it, I think you forget to do a little bit more while reading that link you posted.
 

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
Just added "/etc/corosync/uidgid.d/asterisk" with the asterisk credentials, but I'm stil getting "Failed to initialize..".
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
I guess you didn't read my "Corosync needs to be running" bit
 

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
The service is running:
sudo service --status-all
...
[ + ] corosync
 

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
Suddenly the service is up and running...magic..

module load res_corosync
Loaded res_corosync
== Parsing '/etc/asterisk/res_corosync.conf': Found
Loaded res_corosync.so => (Corosync)


Is there anything else I need to set up?

How exactly does it work?
Do I just add a custom extension on Site B dialing an extension on Site A?
How do I get the BLF status?
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
You just subscribe to the hints of the devices on the other machine. It doesn't provide you to pick up or place calls directly of course.
 
Last edited:

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
Now I'm getting:

corosync show members

=============================================================
=== Cluster members =========================================
=============================================================
===
=== Node 1
=== --> Group: asterisk
=== --> Address 1: 192.168.2.65
===
=============================================================


Note that just one Site is set up yet, but it looks promising now :)


This is my virtual extension on Site A, put in the extensions.conf on site B.
When someone dials "67" on Site A, Ext. 67 on Site B is called:

[ext-local]
exten => 67,1,Set(PEERNAME=IAX2/67})
same => 67,2,Dial(IAX2/SITE-A/67)

So everything I need to do is to assign the virtual extension to a BLF-key and that's it?
I guess this automatically sets a subscription to the respective extension and the hints are set up by corosync?
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
No, the hints are not set up by corosync, they are merely transported by it (you will need two machines up and running though ;-)
res_corosync superseded res_ais and there is "more flesh on the bones" if you google that. The behavior of the buttons you have subscribed to a hint on is dependent on the particular phone, many change their behavior depending on the BLF hint, in effect making them a DSS (direct station select button) buy you need seemless dialing between your two systems to achieve whatever subscription to a hint on the other box requires. I suggest a little more research is needed by yourself, then a lot of experimentation, then a little bit of provisioning of the phones.
 

TristanS

New Member
Joined
Oct 15, 2016
Messages
18
Reaction score
2
Finally Corosync seems to be working on both servers.
Is it necessary, that the the servers are in the same local network or can I connect via internet?
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,633
Reaction score
842
Finally Corosync seems to be working on both servers.
Is it necessary, that the the servers are in the same local network or can I connect via internet?


It is normally set up in the same network but communicates by multicasting , which although is technically routable , rarely is enablws on all routers between two machines in the I ternet.
 

Members online

Forum statistics

Threads
25,812
Messages
167,763
Members
19,241
Latest member
bellabos
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top