Community Documentation - Remote BLF’s using PJSIP

Announcing a new Community Documentation page now available in the wiki here:

Remote BLF’s using PJSIP

Created by Sangoma Support Engineer, Jack Campbell (@jackcampbell), it details how to share hint states between multiple systems to allow BLF LEDs to reflect status of the remote extension. It’s been used with success on a few systems now, but there are likely to be some edge cases to shake out, please share your experiences here in the forum.

8 Likes

It seem not to work by means of publishing the state of chan_sip extension. However this might only be a problem of ports. The connect between the 2 PBXs runs over pjsip trunks which manage the publish and receive status information based on local created hints. No additional IAX-connection is necessary. So the real extension publishes to the local (shadow extension =) hint. But it does no seem that a chan_sip extension is also able to publish its state since the "publish-"function is only a pjsip functionality. Anyway, on a local machine the blf-functionality is working with chan_sip. I wonder why, respectively where the difference can be found between local-local and local-remote?

The wiki is only for pjsip and only for current versions of Asterisk 16+. If you’re attempting to marry it with chan_sip or IAX2 you’re wasting your time.

The weird part about the guide is that the endpoint created in the document above doesn’t seem to be linked to the PJSIP trunk between the two servers. The guide doesn’t show the name of the trunk created in the first step so maybe that is where I am missing it. Does that seem to matter for those that have this working?

I also cannot tell if the servers are even trying to push something out even after turning on the psjip logger in CLI. Does anyone have any ideas?

@lgaetz I was able to get this working between 2 freepbx servers. Thanks!

Is it possible to make this work with 1 HQ server connecting to multiple remote servers? I tried the same script by copying the settings for additional servers but it deregistered all my PJSIP extensions.

NVM it appears I got it working. You have to keep unique names on each server on the config files.
This link gave me the hint. https://wiki.asterisk.org/wiki/display/AST/Exchanging+Device+and+Mailbox+State+Using+PJSIP

[instance2]

type=endpoint

[instance2-devicestate]

type=outbound-publish

server_uri=sip:instance1 @172 .16. 10.2

event=asterisk-devicestate

[instance2-mwi]

type=outbound-publish

server_uri=sip:instance1 @172 .16. 10.2

event=asterisk-mwi

[instance2]

type=inbound-publication

event_asterisk-devicestate=instance2

event_asterisk-mwi=instance2

[instance2]

type=asterisk-publication

devicestate_publish=instance2-devicestate

mailboxstate_publish=instance2-mwi

device_state=yes

mailbox_state=yes

@Jonathan1, do both of your severs reside on the same subnet? I just realized that when I was testing this on two virtual machines this seemed to work (both were in the same subnet). With my production servers, when they are in completely different locations it does not seem to work.

I found this https://issues.asterisk.org/jira/browse/ASTERISK-26741 but doesn’t look like it was ever resolved.

Has anyone tried on different subnets?

My endpoints (yealink T46S phones) are still on chan_sip. After current freepbx-updates the old php-poll-script is crashing the whole system totally. After some hours, mysql-database has more the 100 open connections (99,9% are with status ‘sleep’) initiated by asterisk crontab running the php-BLF-poll-script. On the 2 systems, which are not updated yet, the old script still works perfectly (crontab every 10 seconds, sleep 10, every minute). I have no idea, what changed, to let the script never disconnect from the database. A
Any idea by anyone? Old script: BLF hints over IAX2 trunk to remote system
Finally time will come, when I have to switch to pjsip. Can anyone tell, whether or not extension can be switched to PJSIP 5060 where trunks must stay on chan_sip 5160 since I have no other idea how to connect to phone provider Deutsche Telekom (Germany) by using PJSIP-trunks.

@guenni as far as I know, the extensions can be PJSIP and still use a SIP trunk.

With respect to my comments above, it appears that the event publishing only works on the same subnet. Not sure if that is by design but that is what I am seeing in the real world.
My solution was to use one of the FreePBX servers as an OpenVPN server to the other remote system (becomes a client with a fixed IP). This way the can exchange all the BLFs with no problem using the guide mentioned in this post.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.