Saturday, August 15, 2009

How to reinstall DirectX 9.0

One day my media player stopped playing back video and GraphEdit kept complaining DirectShow Core Components Failed To Initialize. I tried reinstall/updrade the Windows Media Player 11 but that didn't help.

Later I found out that I had to reinstall DirectX to fix it. I tried downloading the DirectX 9.0c Redistributable for Software Developers and ran dxsetup.exe but it completed in a second since it thought my windows already had updated DirectX version. I also tried deleting some registry entries about DirectX, but that didn't help either. Therefore I went to folder where the installation files were and extracted the file dxnt.cab, which gave me a subfolder dxnt. Next I created a system resotre point in case I would need it later.

I then browsed into the newly created dxnt folder and selected all the inf files (sort by type: setup information) in it then right click and click Install on the context menu. It then copied all the driver files from the dxnt folder to %systemroot%\system32 folder and imported necessary changes to the registry. Afterwards, my media player worked again and GraphEdit didn't throw out any more error. However, MediaPortal was still complaining about "VMR9 handler outdated". It seems the above method didn't replace the files being used such as ddraw.dll. Therefore, I did a reinstall of XP service pack 3 to fix it. And MediaPortal was running smoothly afterwards.

Friday, August 7, 2009

VOIP trunks in Asterisk (Gizmo5, GTalk, VoiceStick and Stanaphone)

Add VOIP trunks by AsteriskNow GUI or edit users.conf manually. Type asterisk -r -vvv for more verbose debug information.
  1. Gizmo5/Google Voice:
    [1sipnumber]
    context = DID_1sipnumber
    host = proxy01.sipphone.com
    trunkname = Gizmo5 ; GUI metadata
    username = 1sipnumber
    secret = password
    hasiax = no
    registeriax = no
    hassip = yes
    registersip = yes
    trunkstyle = voip
    hasexten = no
    canreinvite = yes
    disallow = all
    qualify = yes
    allow = ulaw,alaw
    insecure = port,invite

    The context can be found in the file extensions.conf as below
    [DID_1sipnumber]
    exten = s,1,GotoIf($[${LEN(${CALLERID(num)})} > 10]?1-setcid,1)
    exten = s,n,Goto(1-dial,1)
    exten = 1-setcid,1,Set(CALLERID(num)=${CALLERID(num):2})
    exten = 1-setcid,n,Goto(1-dial,1)
    exten = 1-dial,1,Goto(default,6000,1)
    exten = 1-dial,n,Hangup()

    The above context strips the leading "+1" from the incoming caller ID the provider(sipphone) sends to Asterisk and rings extension 6000 for the incoming calls.

    Ref: How to change incoming CallerID

  2. VoiceStick (avoid it if possible): it uses outbound proxy 72.5.80.116:5060 or 72.5.80.117:80. But I couldn't make it work with my Asterisk or Linksys PAP2T under their Next2Nothing or Asterisk Two plan.
    Add the following to /etc/hosts
    72.5.80.116 i2telecom.com
    and the trunk in users.conf
    [1phonenumber]
    context=DID_1phonenumber
    host=i2telecom.com
    trunkname=i2telecom.com
    username=1phonenumber
    secret=password
    hasiax=no
    registeriax=no
    hassip=yes
    registersip=yes
    trunkstyle=voip
    hasexten=no
    disallow=all
    allow=all
    qualify = yes
    canreinvite = no
    insecure = port,invite

  3. GTalk:
    I have the following in the file extensions.conf to set the correct incoming caller ID for the google account that's calling in. The name of the caller will be shown as Gtalk/google_account_name
    [gtalk-in]
    exten = _.,1,NoOp(${CHANNEL})
    exten = _.,2,Set(CALLERID(name)=${CUT(CHANNEL,,1)})
    exten = _.,3,Set(CALLERID(num)=${CUT(CHANNEL,,2)})
    exten = _.,4,Goto(default,6000,1)
    exten = _.,5,Hangup()

  4. Stanaphone: It's important to have the right insecure setting. Otherwise it will try Digest-MD5 authentication for incoming calls and fail instantly.
    [username]
    context = DID_username
    host = sip.stanaphone.com
    trunkname = Stanaphone ; GUI metadata
    username = username
    secret = password
    hasiax = no
    registeriax = no
    hassip = yes
    registersip = yes
    trunkstyle = voip
    hasexten = no
    disallow = all
    allow = all
    qualify = yes
    canreinvite = yes
    insecure = port,invite

Saturday, August 1, 2009

Wake up from S3 by USB in XP

I did a search in the internet and came across this article first. Then I found the MS KB article titled Description of how to enable the S3 system power state for standby when USB devices are armed for wake. I had to create a new key named "usb" under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and then add a new DWORD value as shown below:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usb
"USBBIOSx"=DWORD:00000000

I needed to reboot after I made the change to the registry. Afterwards the power management tabs appeared for both the HID keyboard and mouse. I was able to enable either the keyboard or mouse or both to wake up the system from S3 standby.