FreePBX and a Cisco 7940 Phone

So, it has been months since I posted something technical on my website. For the most part it has been music stuff as well as general updates on the overall infrastructure of the site. However, for the past month or so I’ve been working on getting a Cisco SIP phone working with FreePBX. However, the problem was that I was not able to receive inbound calls.

This was the not so descriptive error:

    -- Called 2000 
; my sip extension
    -- Got SIP response 400 "Bad Request" back from 
; sip reply
    -- SIP/2000-7b88 is circuit-busy 
; this cause the call to go straight to VM

Looking at the logs and googling for weeks on the problem, it was possible that the problem was the following:

    -- Executing NoOp("Zap/1-1", "Using CallerID 
""LastName FirstName   "" <11234567890>") in new stack

Please note the double quotes around my name.Now, after talking to X-Rob on the #freepbx channel, he pointed me to the extensions.conf file where the CallerID seems to be handled or generated.

I looked at the last commit X-Rob made and compared it to the previous one:

Revision 1891:

exten => s,n,GotoIf($["${AMPUSERCIDNAME:1:2}" = ""]?report)
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSER}>)

Revision 1900:

exten => s,n,GotoIf($["x${AMPUSERCIDNAME:1:2}" = "x"]?report)
exten => s,n,Set(CALLERID(all)=${AMPUSERCIDNAME} <${AMPUSER}>)

However, this latest change still did not eliminate the double quotes from the CallerID.

So, I removed the quotes around the variable x and inbound calls finally worked! Looking at the logs however I do get an unknown name for the CallerID field, but at this point I don’t really care. I will try to work on the code and see if I can figure out the “correct” way to fix this issue, but for now I’m just happy I’m able to receive inbound calls.

Here is what the logs show with the “” removed from around the x:

    -- Called 2000 
; my sip ext againg
    -- SIP/2000-0e25 is ringing 
; my phone ringing
    -- SIP/2000-0e25 answered Zap/1-1 
; me answering the phone


Leave a Reply