Tuesday, August 14, 2012

This application is not correctly embedded (wrong wmode value)

Problem: 
While doing some development in Flash Builder using Starling (for mobile), I got the error:
This application is not correctly embedded (wrong wmode value)

Solution (Flash Builder 4.5+):
Change the renderMode in the XML app config file to either 'direct' or 'gpu'.

Solution (Flash CS5.5):
Under publish settings, click the Wrench icon on the left of the Player drop down near the top. Here you can choose to set Render Mode to GPU. At this point, you can't set it to "direct".

Side Note: 
CS5.5 users may be able to set render mode to "direct" with this solution: http://blog.michaeljbowen.com/?p=127


Tuesday, August 7, 2012

Reject calls in Twilio OpenVBX (Code Modification)

Problem:
Every week I get an automated call from some number to my Twilio number. It is very annoying and I don't want to pay (even a penny) every time this caller tries to dial my number.

Solution (Kind of):
When talking to Twilio support and suggesting that they allow you the control to deny numbers from ever reaching your numbers (block list) and therefore reducing harassment and saving precious pennies, they said such a system is not in place. One support rep noticed I was using the OpenVBX and shot me some PHP to reject this number.

I think this will only prevent the number from getting routed through your system, but you will still have to pay for each time these people call. (I'm fairly certain here, but I will verify and correct myself if found otherwise).

In order to block a number in OpenVBX you would need to modify this OpenVBX source file:
plugins/standard/applets/start/twiml.php
// block calls
$caller = normalize_phone_to_E164(isset($_REQUEST['From'])? $ci->input->get_post('From') : '');

$response = new TwimlResponse;

// Update this list of numbers
$block_list = array('+16146526398');
if (in_array($caller, $block_list)){
        $response->reject(array('reason' => 'rejected'));
}else{
        $next = AppletInstance::getDropZoneUrl('next');
        if (!empty($next)) {
                $response->redirect($next);
        }
}

$response->respond();