Extension to extension call handling

I have FreePBX 2.2.1 with * 1.2.17. I followed the directions faithfully for adding extensions in the Free PBX web interface. I added extensions 105 and 107 and have two separate workstations with xlite softphones. Then, I have 105 call 107 and it goes straight to voicemail. It only calls 107 when I add the following in the extensions_custom.conf:

[code:1]
[from-internal-custom]
exten => _1XX,1,Dial(${EXTEN},20)
exten => _1XX,n,Hangup()
[/code:1]

Shouldn’t FreePBX or * handle this?

In case it is of any use, nat=no, allow anonymous sip calls is yes.

It has to do with the dialparties.agi script. The first line wasn’t pointing to the correct path of the php executable. I have /usr/bin/env php when it should be /usr/bin/php5