twilio / OpenVBX

OpenVBX is a web-based open source phone system for business.
http://openvbx.org
Other
699 stars 342 forks source link

Can't change maxLength for <Record> #338

Open afilina opened 9 years ago

afilina commented 9 years ago

Some automated system is costing me a fortune in voicemails. I need to be able to set a limit on the duration of a voicemail. Twilio has a maxLength option, but I couldn't find anything in the settings that would allow me to change it.

chadsmith commented 9 years ago

If it's always the same number causing you trouble, you can use my subscriptions and reject plugins to block calls from certain numbers.

Gipetto commented 9 years ago

You are correct, there's no way to effect the recording max-length through the UI.

As Chad just noted you've got his plugins as an option if the caller uses the same number or set of numbers each time.

Alternately, if you must, you can alter the max length by changing the OpenVBX code. This will unfortunately change the max recording length or the entire system, so hopefully Chad's plugins work for you.

If you look in plugins/standard/applets/voicemail/twiml.php you can add to the $record_params to change the recording length. Change the recording params to include a max_length param that has a numeric value, in seconds, that you'd like to limit the recording to:

    $record_params = array(
        'transcribe' => 'false',
        'max_length' => 3600 // 1 hour (default)
    );

Again, though, I hope that Chad's plugins work as they're a more elegant solution. Changing the code should be a last ditch fallback.

afilina commented 9 years ago

Ah that's wonderful. I'll look into both of these. Nobody legit ever left a message longer than 5 minutes.

kenna commented 9 years ago

It should be maxLength instead of max_length:

$record_params = array(
        'transcribe' => 'false',
        'maxLength' => 60,  // this would be for 1 minute in length
    );
afilina commented 9 years ago

@kenna Thanks. I hope I didn't miss any important messages by inputting max_length earlier. I changed it on 2 systems.

kenna commented 9 years ago

@afilina no problem. You weren't the only one getting really long phone robo calls. Yesterday I got one that was 1 hour long, and that lead me to this thread. I tested it with my code fix and it worked. Also, if you are getting charged a lot for voicemail storage, check to make sure Twilio isn't storing your voicemails. I have never been able to get OpenVBX to actually delete my voicemails (they delete from view, but not from Twilio's servers) so I have to manually delete them by making requests on each one here: https://www.twilio.com/user/account/developer-tools/api-explorer/recording-delete

afilina commented 9 years ago

@kenna Yeah, I got plenty of those 1h robocalls eating up all my money. I'll ask my associate to check the Twilio account. Thanks for the link.

Gipetto commented 9 years ago

Whoops, sorry about the max_length vs. maxLength thing. I couldn't remember if the PHP library adhered to convention or changed the parameter from snake_case...

benferris commented 9 years ago

@Gipetto I've been getting those 1 hour robocalls too and I changed the OpenVBX code as you described above, using the code provided by kenna:

$record_params = array(
        'transcribe' => 'false',
        'maxLength' => 60,  // this would be for 1 minute in length
    );

However, it still doesn't seem to have any effect on the maximum length of voicemails on my system. It is still maxing out at 60 minutes. Any idea what I might be doing wrong?

Gipetto commented 9 years ago

Ben, if you're running php-fpm with apc or some other opcache system then you may have to restart the FPM process for it to notice that the file has changed. If you're running Apache with the php module you might have the same issue, but would need to do a graceful restart of the Apache process.

If you open up your flow and click on the show twiml link in the record applet does it show the maxLength attribute in the record element?

Beyond that I'm not really sure, unfortunately.

benferris commented 9 years ago

@Gipetto Thanks a lot for the response. I finally got it working. It seemed to persist with the old settings even after a reboot, and I can't explain how I got it working but at least it is resolved.

nelsenweb commented 8 years ago

this has been a great thread. I was able to get this all working using: $record_params = array( 'transcribe' => 'false', 'maxLength' => 60 // this would be for 1 minute in length );

please note the maxLength change as suggested and I did not put a comma after the number and it works flawlessly for me