Monthly Archives: March 2009

Problem with network manager in Jaunty

I don’t know if it’s a real bug or it’s just me

wired network keeps going up and down from time to time

since I don’t use wireless so I don’t know if it’s the same for wireless network

anyways, problem solved by replacing network manager with wicd

one good thing about jaunty is that they finally include wicd in the universe repository

同步 twitter 到 飯否

google 看到 raptium同學的 post Twitter和饭否同步


不過又不想把 twitter 上的回復也 sync 到飯否

so 加了一個 statement 把 @blah 都過濾了


elif snode.nodeName == 'text':


elif (snode.nodeName == 'text') and (snode.childNodes[0].nodeValue[0] != '@'):

就可以了 😀

Slightly modified the theme

Just modified the php files a little bit, to make the theme compatible with XHTML 1.0 Transitional. There are still some errors though, but they are caused by some of the widgets, for example wp-syntax and recent tracks. I’m not gonna modify the widgets also, simply because I’m too lazy to do it again every time the widgets get updated.

How to distinguish incoming trunks in asterisk-java

Suppose you have asterisk 1.6 with freepbx and you are developing with the latest asterisk-java library. Somehow you wanna perform different tasks based on calls coming through different SIP trunks.

When there’s a new incoming call, asterisk-java will trigger a newChannelEvent, but there’s no information in this event that can be used for distinguish from which trunk this call is coming in.

By default the accountcode in this NewChannelEvent is null, which makes sense because the accountcode is used for billing, and no one, at least not many people, wants to record the charge of SIP trunk because that’s usually done by the SIP provider to which the trunk is registered to. But since the accountcode is null and useless here, maybe we can use it as an identifier to distinguish the incoming trunk, it may be not the smartest solution, but at least it’s a working one 😀 Continue reading