Public Announcement system using Asterisk

Dear Friends,

I an newbie to Asterisk and seeking your help regarding Asterisk. I want to setup simple Public Announcement System for a hospital. It is required to make an announcement in complete building or part of the buildings (few rooms). There is no outward dialing and restricted to make announcement only. This should be configurable about what offices/rooms to make announcement. SIP enabled IP speakers will be used with Auto Answer mode enabled. Please let me know if that is possible to implement using Asterisk? I would be thankful if some guidance is given about how to implement it.

Use Page application.

1 Like

Here’s the function I use (it’s a little more that you might need, but you can extrapolate):

[intercom]
exten	=> _*[0-5]X,1,Set(CALLERID(num)=${CHANNEL:4:5})
same	=> n,Answer()
same	=> n,Set(TIMEOUT(absolute)=60)

same	=> n,Set(ARRAY(int_data,int_direction)=${ODBC_READSQL(SELECT int_data\, int_direction from extensions left outer join intercom on ext_intercom_group=int_id where int_dialed=\"${EXTEN}\" and ext_dialed='${CALLERID(num)}')})

same	=> n,GotoIf($["${int_data}" = ""]?hangup)
same	=> n,GotoIf($["${int_direction}" = "1"]?unidirectional)
same	=> n,GotoIf($["${int_direction}" = "2"]?bidirectional)
same	=> n(hangup),GoTo(h,1)

same	=> n(unidirectional),SIPAddHeader(Call-Info:\;answer-after=0)
same	=> n,Page(${int_data},i,30)
same	=> n,Hangup()

same	=> n(bidirectional),SIPAddHeader(Call-Info:\;answer-after=0)
same	=> n,Page(${int_data},id,30)
same	=> n,Hangup()

exten	=> i,1,Hangup()
exten	=> t,1,Hangup()
exten	=> h,1,Hangup()

The database record will look something like this:

int_dialed     int_data            int_direction     int_id
*01        SIP/61024&SIP/61025&SIP/61026    1        6

Although you could just hard code it. If a user is in the group (int_id), they can dial *01-*59 if they’re configured. I usually just program a button on their phone.

2 Likes

Thanks mkozusnik for your prompt response. I will test your script and update this thread about it. It would be great if you can let me know which are the best SIP enabled speakers which can be installed throughout the building.

This is for paging to the phones. For Overhead paging, we used Valcom’s Page Pro to interface with the amplifier. The amp and speakers were already in place. Sorry, but I don’t know what kind they are.

I have different code for overhead paging…

[overhead_page]
exten    => s,1,NoOp(Dialed ${ARG1} CLID ${CALLERID(num)} EXTEN ${EXTEN} Channel ${CHANNEL:4:5})
same    => n,Set(canpage=${ODBC_READSQL(select count(*) from paging where page_ext ='${ARG1}' and (page_clid='${CALLERID(num)}' or page_clid='${CHANNEL:4:5}'))})
same    => n,GotoIf($["${canpage}"="0"]?hangup)
same    => n,Dial(SIP/${ARG1},20)

same    => n(hangup),Hangup()

exten    => i,1,Hangup()
exten    => t,1,Hangup()
exten    => h,1,Hangup()

I authorize extensions in the database to be allowed to page.

page_ext page_clid
21990 20001
21990 20002
21990 20003
21990 20004

1 Like

Dear mkozusnik,

I have used your mentioned dialplan with static values bypassing database and getting following on asterisk console. I would be thankful if you can assist me on this error.

– Executing [s@intercom1:11] Page(“SIP/1001-0000000b”, “SIP/7001&SIP/7002&SIP/7003,i,30”) in new stack
[Sep 7 19:27:10] WARNING[27090][C-0000000a]: app_page.c:281 page_exec: There is no ConfBridge application available!

I’m also using MeetMe which is installed when I compile my Asterisk from source. I’m not sure if installing Conference Bridge will fix it. If you plan to install MeetMe, you’ll also need to install DAHDI as MeetMe requires it for timing (mixing). Perhaps you have ConfBridge installed, but the module isn’t loaded. Try loading it (module reload app_confbridge.so). If that works, be sure you’re not disabling it in the modules.conf file.

There was some issues in confbridge.conf which has been fixed and conference call has been successfully tested (Unidirectional and bidirectional). I really appreciate your help in this regard.

Now one more thing that I want to play recorded message in the conference where everybody joins conference as muted participants including moderator/admin. Is that possible? Please guide me with that.

If I’m understanding what you’re trying to do, take a look at the Whisper option on the ChanSpy function.

If the hospital already has an analog overhead PA system then all you have to do to interface it to your SIP based Asterisk system is to use any model Obihai ATA. The Obihai ATAs have a paging mode which allows you to use its analog phone port as the input to the PA amplifier (just add impedence matching transformer). This is the old legacy way that KSUs and PBXs would interface to overhead PA systems. Then, on any SIP phone that you want to have ability for paging, just assign a speed dial or BLF to dial the extension number of the Obihai ATA. No need to add anything special to your Asterisk dial plan. Just treat the Obihai ATA as another extension. You can pick up a used Obihai Obi100 on eBay for less than thirty bucks, and it works great, even supporting TLS.

Dear javauser,

Thanks a lot for your response. Frankly speaking I don’t have any overhead PA system (Hardware i.e speakers). Right now I am testing it with soft phone (EyeBeam). I would really appreciate if you can suggest best and yet cost effective overhead hardware (SIP enabled speakers with Auto Answer Yes).

The best is going to be an analogue sound field system. SIP will result in all the outlets being out of phase.