Open Source Training Seminar


Not Logged in - No Account?

Logging in allows you to post to forums, track new posts, subscribe to threads, pm (private message) other members, and receive periodic news letters. Once logged in this message disappears. No account? Create one by registering here. Lost your password, request a new password. We respect your privacy and collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for details.


Hack to disable intercom beep

perholmes's picture

Hi,

I'd really like to disable the beep that is played on a recipient's phone when an intercom session is started. Our phones already beep, and the beep that is played AFTER the phone has already been auto-answered is frankly frustrating, because you have to sit and wait for the phone to be finally ready for you to talk.

I understand that you can edit functions.inc.php in modules/paging, and I have located the two places where the beep code is generated. But, I have no idea what to replace it with. I tried changing the 'beep' soundfile name to 'beep123', hoping that it would just generate an error and skip the command -- instead the intercom fails. I can't remove the line, because it also contains the dial command.

What is the procedure for getting rid of this obnoxious beep, or in case of many phones, double-beep? Is there an empty soundfile I can use instead that plays 0.001 seconds of silence? Or, I guess I could make one and upload it, but isn't there a way to just comment out the beep code?

I would also encourage the developers to make this a setting instead of a hard-code. Many of us do not need the beep, and it's just in the way. In a household, for example, there are a hundred reasons why you *wouldn't* want the beep, especially when there are babies around. In a business, obviously you want the beep. But this proves that it has to be a setting.

In the meanwhile, I do not mind hacking code that will eventually be overwritten. But we would just love to get rid of the extra beep.

Thanks,

Per


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

use the sound file silence/1

lazytt's picture

use the sound file silence/1


__________________

Moshe Brevda, FreePBX Development Team
New to asterisk? Download the Asterisk book FREE!


Hi,Thanks, but doesn't that

perholmes's picture

Hi,

Thanks, but doesn't that still block the channel from conversation for 1 second? The purpose is not just to stop the beep, the point is to make the point where you can effectively have a conversation come as soon as possible. We find ourselves saying "Hello?", wait a few seconds, and then saying "Hello?" again, this time successfully. It's frustrating that the first sentence of a conversation is cut off.

Does the system allow two way conversation while playing this sound file? Or do I need to make a sound file that is 0.0000000001 seconds long?

Thanks much!

Per


ur right, THis only silences

lazytt's picture

ur right, THis only silences the pause, doesnt remove it. Your gona have to tinker with the php to change that


__________________

Moshe Brevda, FreePBX Development Team
New to asterisk? Download the Asterisk book FREE!


Note to self

perholmes's picture

OK, this is just a note to myself for how to modify FreePBX to get rid of the intercom beep. Developers, I think this truly ought to be configurable. Sometimes, discretion is the stated goal, i.e. barging into a meeting or monitoring a baby. Since our phones already make a small beep, loud enough to easily hear, the FreePBX beep results in "beep" and then "BEEP", and you can't even talk for that period of time, so we always say "Hello?" twice... pretty annoying.

OK, so I've created a .wav file that's something like 0.00001 seconds long, I believe it's 8kHz, 16-bit, but whatever is the standard. I've put it into

/var/lib/asterisk/sounds/custom/nothing.wav

Then I edit the PHP file that generates the asterisk code:

/var/www/html/admin/modules/paging/functions.inc.php

(type "nano functions.inc.php")

Then I replace the two instances of the word "beep" with the word "custom/nothing". So, within Nano, type Ctrl-W, type "beep". Do this twice, then Ctrl-O to write it.

Finally, force FreePBX to rebuild the dialplan by making any kind of change and Applying it.

Now the beep should be gone.

Per


And also, if you choose to

perholmes's picture

And also, if you choose to make the beep/intercom thing a permission that the recipient grants rather than the originator, then it would also make sense that each individual phone decides whether it wants a beep or not. This wouldn't have to be a *123 function, it could simply be set once and for all in the extensiopn configuration. But then it's possible on a phone by phone basis to decide if a beep is included. It's certainly valuable to have a beep for some applications. It's incredible obnoxious in other situations, and especially if the phone already beeps as part of its auto-answer. There are too many people trying to do the same job, the phone-makers are also including beeps.

Best,

Per


here's an infrastructure

p_lindheimer's picture

here's an infrastructure suggestion. The dialplan that generates the beep for intercom and extnesions looks like:

intercom:

exten => _*80.,n,Macro(autoanswer,${DEVICES})
exten => _*80.,n(check),ChanIsAvail(${DIAL},sj)
exten => _*80.,n,Dial(${DIAL},5,A(beep))

paging:

exten => _PAGE.,n,Macro(autoanswer,${EXTEN:4})
exten => _PAGE.,n,Dial(${DIAL},5, A(beep))

The key is that the autoanswer macro is called, which is auto generated, can do per phone type things, and can have per device overrides. (It is what sets all the ALERT_INFO type headers and even the ${DIAL} string you see listed. So for starters, we can modify the dialplan to look like the following:

exten => _PAGE.,n,Dial(${DIAL},${DOPTIONS})

and then we can make the time and the options be configurable in the database, and returned in the DOPTIONS variable. Furthermore, we can allow for per sip useragent overrides for specific types of phones (like ones that may provide their own beep. Lastly, you can always override a specific device by calling a macro which is part of the autoanswer macro ability to make per device custom changes. For reference, this is an example of macro-autoanswer on my system:

[macro-autoanswer]
include => macro-autoanswer-custom
exten => s,1,Set(DIAL=${DB(DEVICE/${ARG1}/dial)})
exten => s,n,GotoIf($["${DB(DEVICE/${ARG1}/autoanswer/macro)}" != "" ]?macro)
exten => s,n,Set(phone=${SIPPEER(${CUT(DIAL,/,2)}:useragent)})
exten => s,n,Set(ALERTINFO=Alert-Info: Ring Answer)
exten => s,n,Set(CALLINFO=Call-Info: <uri>\;answer-after=0)
exten => s,n,Set(SIPURI=intercom=true)
exten => s,n,Set(ANSWERMACRO=)
exten => s,n,ExecIf($["${phone:0:5}" = "Mitel"],Set,CALLINFO=Call-Info: <sip:broadworks.net>\;answer-after=0)
exten => s,n,ExecIf($["${phone:0:4}" = "snom"],Set,ANSWERMACRO=snom-autoanswer)
exten => s,n,ExecIf($["${phone:0:9}" = "testphone"],Set,CALLINFO=Call-Info: \;answer-after=0)
exten => s,n,GotoIf($["${ANSWERMACRO}" != ""]?macro2)
exten => s,n,ExecIf($["${ALERTINFO}" != ""],SipAddHeader,${ALERTINFO})
exten => s,n,ExecIf($["${CALLINFO}" != ""],SipAddHeader,${CALLINFO})
exten => s,n,ExecIf($["${SIPURI}" != ""],Set,__SIP_URI_OPTIONS=${SIPURI})
exten => s,n+2(macro),Macro(${DB(DEVICE/${ARG1}/autoanswer/macro)},${ARG1})
exten => s,n+2(macro2),Macro(${ANSWERMACRO},${ARG1})

Note this line:

exten => s,n,GotoIf($["${DB(DEVICE/${ARG1}/autoanswer/macro)}" != "" ]?macro)

allows you to do what ever you want for a specific device. Note that lines such as:

exten => s,n,ExecIf($["${phone:0:9}" = "testphone"],Set,CALLINFO=Call-Info: \;answer-after=0)

are auto-generated out of the database. So we can do something similar, along with the defaults, and set the DOPTIONS variable as needed.

What this would not lend itself well to is an environment where phones, on a case by case basis, wanted to enable/disable their own beeps. If that is what is desired, then it can still be handled but not through the generic macro facility that is already there. We we would want to add some functionality in the autoanswer macro for this purpose, that looked at a device setting similar to what it already does for the macro, but limited to adjusting the beep only.

So .. a bit of rambling / thinking out loud but that should help as a starting point to discuss or if someone wants to have a go at it ...


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Hi Philippe, As always, I

perholmes's picture

Hi Philippe,

As always, I think it's truly unbelievably and admirable how much you're on top of this project. I have never met anyone who is so open to ideas -- project leads usually assume that any idea is bad unless a thesis is written to prove that it is reasonable. I'm not competent enough to participate in open source linux development, but I hope someone grabs the idea.

One thing I would add is that people love preferences, and even very detailed preferences are not too much for the average user. Many of these things could simply become additional extension parameters, so along with every other parameters for an extension, you would have an "Intercom/Paging Beep" On/Off, or even a sound-file selection with the option of "none". If you did that, people would have some crazy fun with intercom beeps, somebody would use a foghorn, someone a D'Oh, someone nothing. Actually, this would be a stupid fun thing to do.

Also worth considering is that is additional extension settings were implemented, so give each setting an option called "Global Setting", which follows the setting for a Global Extension. That way, settings can be set to the Global Setting and only "localized" to the extension if needed.

Best,

Per


Thanks - the project is a

p_lindheimer's picture

Thanks - the project is a great project because of the ideas and experiences of many people. That is one of the powers of the Open Source process and I'm glad you think it is working here:)

the only issue with giving lots of choices is giving a portal to users to set the choices. Right now all we have is ARI since I would never let a user touch FreePBX. You can do featurecodes for enable/disable ability and as long as someone programs a button on the phone for a user to set them, then they will get used. Otherwise, they tend to not get used.

Anyhow - if there is not already a ticket, you may want to add one for the request to provide some level of configuration to the beep and then point the ticket at this thread because otherwise this idea may very likely get lost.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Fixed in 2.5, you can

p_lindheimer's picture

Fixed in 2.5, you can backport the module to 2.4 manually if you want:

r5988, r5989

you'll have to understand how the config database works, this is not exposed in the GUI but is easily configured for an installation


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here