Tech

Phone calls anywhere

no comments
squircle old phone Title: squircle old phone
Author: zen Sutherland
Taken: 14 Jul 2005 - 10:42pm

Since I started traveling about a year and a half ago staying in contact with people has been one of the most difficult things for me (the bizarre local calling systems don't help either :)). This is especially true with people who can't get online, like my Grandma. Figuring out a decent phone system has been really tough and I even recently had to change my "permanent" number which I've already written about here and here.

I think I've finally got a great system worked out. Something that will work for anyone who travels internationally a lot. It will get a lot simpler and cheaper when Google Voice goes international or Skype gets SkypeIn numbers in Canada.

The problems:

  1. Over the past 1.5 years I've "lived" in 6 countries and had a local cellphone number in 4 of them.
  2. Roaming for me to call out is prohibitively expensive.
  3. My family never has any idea of how to get a hold of me. All of my friends that I maintain decent relationships with are online so that's not so much of a problem.
  4. In emergencies I need to be contactable.
  5. I don't want my family and friends to pay a fortune just to call me.

The solution:

  1. A local (Vancouver) VoIP number that never changes (ideally)
  2. A US SkypeIn number and SkypeOut subscription
  3. A local cellphone number

I switched to Voice Network in September for my VoIP service and so far have been happy with them. I pay $4.50/month for my Vancouver phone number and 1c/min to anywhere in Canada, 1.5c/min for US.

Skype is really a lifesaver. Without it I don't believe my life would be nearly as comfortable. I have a subscription to Skype "Unlimited US & Canada" which gives me virtually unlimited North American calling for $2.80/month. I recently picked up a US SkypeIn that costs me $4.46/month.

I also make a habit of getting a local phone number for my cellphone in any country I'm in for a decent amount of time just to make my life easier. (A SIM card in South Africa cost me 14c CAD compared to $40CAD in Vancouver :-/ so really most places the local number is virtually free to get and then just pay per use).

My setup:
1. For people who want to contact me... either call me on Skype or call my Vancouver VoIP number listed on the left hand side of my blog. I forward my VoIP number to my SkypeIn number and then either answer the Skype call on my computer, go to voicemail or forward it to my local cellphone number (in SA it's ~30c/min, so I don't do that unless I'm expecting a call).

2. For me to call out has never been a problem, and I just use Skype for that.

The total cost to me is about $12/month which is well worth it for a permanent local phone number wherever I am in the world. (In addition to these services, I also use a Logitech ClearChat Wireless Headset which I use for all my phone calls).

I'm only a bit embarrassed that it took me this long to get going with the SkypeIn number... it really does simplify everything and makes things run so much smoother.

New Phone Number

2 comments

Due to the unfortunate incident with my last VoIP company I've had to switch providers. Because the number I had been assigned on that network was a Richmond number very few VoIP providers were able to transfer it to their service, for this reason I've needed to just drop my 604 number and get a whole new phone number.

A review of my Netfone VoIP service

2 comments

This is actually more of a rant than a review. But hopefully it will serve the purpose of other people avoiding Netfone in the future.

To start with, I've never received worse service at a company than this, not even with Telus if you can believe that. The service is so bad, that I even have trouble believing it... until I try to contact them again. I've used them for about a year now and never really needed to contact them. My VoIP phone is basically only used for forwarding to my cell or receiving voicemail. I almost never use it as an actual phone.

Quick DrupalCon DC Wrapup AND a mystery!

6 comments
_MG_4205 Title: _MG_4205
Author: jason chinn
Taken: 4 Mar 2009 - 1:47pm
"drupalcon dc" drupal drupalcondc2009 "drupalcon dc" drupal drupalcondc2009

Last week was DrupalCon DC. This was my 4th DrupalCon in a row... Barcelona, Boston, Szeged, and now Washington, DC. The NowPublic development team is distributed throughout North America and Europe, so the bi-annual DrupalCon is the only time we all (or most of us at least) are able to get together. Though the whole team couldn't make it this time around it was still good to see the guys that were able to.

We ended up staying in 4 bedroom house with 8 "beds" and 11 people. All in all a great time, and I managed to avoid the conference flu that tends to spread through conferences at this time of year (which is the first time I've done so in 3 years :) ).

Drupalcon DC 2009 Group Photo! Title: Drupalcon DC 2009 Group Photo!
Author: chrys
Taken: 7 Mar 2009 - 1:19am
1,400 Drupal Fanatics pack the staircase in the Washington Convention Center. Drupalcon DC 2009 - March 4-7 UPDATE: Justin posted a vid...

The conference was very well organized, my only complaint would have been the internet... you should make sure it's working /before/ bragging to everyone about it.

I actually went to more sessions this time around than normal, but still have very little to write about. Did a bit of sight seeing while I was there, but the US DrupalCon's seem to just be a bit less of a party and more of a conference than their European counterparts... go figure.

Now for the mystery! Can you guess what this is?

A common sight at DrupalCon, DC.. but do you know what it is? Title: A common sight at DrupalCon, DC.. but do you know what it is?
Author: Scott Hadfield
Taken: 3 Mar 2009 - 5:01pm
In a survey of 3 people, 33% of them were able to identify this mystery substance instantly and with 100% confidence... can YOU do the same?

Creating Custom Triggers in Drupal

18 comments

So after playing around for several hours tonight trying to build my own custom trigger I think I've finally figured it out. I thought I'd post it here for reference.

Though triggers are included in core in Drupal 6 it seems they're very poorly documented. The extent of the documentation I could find was on this trigger page in the handbook. Pro Drupal Development also has a chapter on it but unfortunately isn't really explicit enough for me with some parts.

Disclaimer: I don't really know what I'm doing, so please let me know if I've done anything wrong.

Prereqs:

  • Drupal 6
  • The triggers module should be enabled.
  • A commenter also pointed out that the triggerunlock module is also necessary. If you have your own custom actions this isn't needed though.
  • If you're following this example, you'll also need to CCK type called 'script'.

What I want to do is create a custom trigger in my module. Let's say I want to execute a custom action on my server whenever a node of a type script (as defined in the 'script' module) is created. The first step is to define hook_hook_info.

/**
 * Implementation of hook_menu_alter().
 */
function script_hook_info() {
  return array(
    'script' => array(
      'script' => array(
        'insert' => array(
          'runs when' => t('After script is created'),
        ),
      ),
    ),
  );
}

This will create a new tab in my triggers page that will be named after the name of my module as set in my .info file.

Two things I still need to do to make sure this trigger actually does anything... define hook_script and call it from a module_invoke or module_invoke_all whenever the triggering event happens and call the actions using actions_do(). Since these hooks should be executed on node insert I'll need to use hook_nodeapi().

/**
 * Implementation of hook_nodeapi().
 */
function script_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'insert':
      module_invoke_all('script', 'insert', $node);
      break;
  }
}

The second aspect (calling the associated actions) requires an implementation of hook_script() (the alternative being to just replace the module_invoke line with this functions body.

/**
 * Implementation of hook_script().
 */
function script_script($op, $node) {
  $aids = _trigger_get_hook_aids('script', $op);
  $context = array(
    'hook' => 'script',
    'op' => $op,
    'node' => $node,
  );
  actions_do(array_keys($aids), $node, $context);
}

The first line in the function is a call to _trigger_get_hook_aids which returns the list of action ID's that have been assigned to this trigger. This is a private function, but seems to be the only way to get the list of actions. The last line in the function calls actions_do(), which processes all the actions assigned to this trigger.

In this particular example you'll need a custom content type called 'script'.

And that's all there is to creating your own custom triggers.

Alternatively, I don't need to create a hook for the trigger, instead I could just piggyback off of the nodeapi hook, since this is a node operation.

The hook_hook_info looks a little different with:

function script_hook_info() {
  $info['script'] = array(
    'nodeapi' => array(
      'script' => array(
        'runs when' => t('After script is created'),
      ),
    ),
  );
  return $info;
}

And then just a slight change to hook_script() to change the hook from 'script' to 'nodeapi'.

/**
 * Implementation of hook_script().
 */
function script_script($op, $node) {
  $aids = _trigger_get_hook_aids('nodeapi', $op);
  $context = array(
    'hook' => 'nodeapi',
    'op' => $op,
    'node' => $node,
  );
  actions_do(array_keys($aids), $node, $context);
}

One other thing that was bugging me with triggers was the inability to only use them on specific cck types. There's no way to setup a trigger to only get called when an event happens to a single content type (without using the workflow module, which I found has some problems using variables in actions). Put an "if ($node->type == 'script')" somewhere appropriate, in my code I'd wrap that around the call to module_invoke_all(), for example:

function script_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'insert':
      if ($node->type == 'script') {
        module_invoke_all('script', 'insert', $node);
      }
      break;
  }
}

----

After writing this I found this blog post which also looks quite useful.

I've made some updates to this example, so hopefully it will work for everyone now.

You can download the example module here.

Syndicate content