SOLVED: Custom extension not routing properly

Hi,

I am using a new install of Freepbx running:
CentOS 5.4
Asterisk 1.6.2.2
Freepbx 2.7

I have a working inbound SIP trunk but would like to route some inbound calls to remote extensions over the same trunk.

I have setup a custom extension 100 with the following dial command:

However, no call is made when trying to reach that extension. In fact, the trunk is not even hit. I turn on AGI debug and set verbose to 3 and get:

pbx*CLI> core set verbose 3
Verbosity was 0 and is now 3
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [8775551234@from-sip-external:1] NoOp("SIP/209.247.17.5-0000003d", "Received incoming SIP connection from unknown peer to 8775551234") in new stack
    -- Executing [8775551234@from-sip-external:2] Set("SIP/209.247.17.5-0000003d", "DID=8775551234") in new stack
    -- Executing [8775551234@from-sip-external:3] Goto("SIP/209.247.17.5-0000003d", "s,1") in new stack
    -- Goto (from-sip-external,s,1)
    -- Executing [s@from-sip-external:1] GotoIf("SIP/209.247.17.5-0000003d", "1?checklang:noanonymous") in new stack
    -- Goto (from-sip-external,s,2)
    -- Executing [s@from-sip-external:2] GotoIf("SIP/209.247.17.5-0000003d", "0?setlanguage:from-trunk,8775551234,1") in new stack
    -- Goto (from-trunk,8775551234,1)
    -- Executing [8775551234@from-trunk:1] Set("SIP/209.247.17.5-0000003d", "__FROM_DID=8775551234") in new stack
    -- Executing [8775551234@from-trunk:2] ExecIf("SIP/209.247.17.5-0000003d", "0 ?Set(CALLERID(name)=+15559876543)") in new stack
    -- Executing [8775551234@from-trunk:3] Set("SIP/209.247.17.5-0000003d", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [8775551234@from-trunk:4] Set("SIP/209.247.17.5-0000003d", "CALLERPRES()=allowed_not_screened") in new stack
    -- Executing [8775551234@from-trunk:5] Goto("SIP/209.247.17.5-0000003d", "from-did-direct,100,1") in new stack
    -- Goto (from-did-direct,100,1)
    -- Executing [100@from-did-direct:1] Macro("SIP/209.247.17.5-0000003d", "exten-vm,novm,100") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/209.247.17.5-0000003d", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/209.247.17.5-0000003d", "AMPUSER=+15559876543") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/209.247.17.5-0000003d", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/209.247.17.5-0000003d", "1?Set(REALCALLERIDNUM=+15559876543)") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/209.247.17.5-0000003d", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/209.247.17.5-0000003d", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/209.247.17.5-0000003d", "1?report") in new stack
    -- Goto (macro-user-callerid,s,9)
    -- Executing [s@macro-user-callerid:9] GotoIf("SIP/209.247.17.5-0000003d", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/209.247.17.5-0000003d", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/209.247.17.5-0000003d", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,18)
    -- Executing [s@macro-user-callerid:18] NoOp("SIP/209.247.17.5-0000003d", "Using CallerID "COMPANY" <+15559876543>") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/209.247.17.5-0000003d", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/209.247.17.5-0000003d", "VMBOX=novm") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/209.247.17.5-0000003d", "EXTTOCALL=100") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/209.247.17.5-0000003d", "CFUEXT=") in new stack
    -- Executing [s@macro-exten-vm:6] Set("SIP/209.247.17.5-0000003d", "CFBEXT=") in new stack
    -- Executing [s@macro-exten-vm:7] Set("SIP/209.247.17.5-0000003d", "RT=""") in new stack
    -- Executing [s@macro-exten-vm:8] Macro("SIP/209.247.17.5-0000003d", "record-enable,100,IN") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/209.247.17.5-0000003d", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] ExecIf("SIP/209.247.17.5-0000003d", "0?MacroExit()") in new stack
    -- Executing [s@macro-record-enable:5] GotoIf("SIP/209.247.17.5-0000003d", "0?Group:OUT") in new stack
    -- Goto (macro-record-enable,s,16)
    -- Executing [s@macro-record-enable:16] GotoIf("SIP/209.247.17.5-0000003d", "1?IN") in new stack
    -- Goto (macro-record-enable,s,21)
    -- Executing [s@macro-record-enable:21] ExecIf("SIP/209.247.17.5-0000003d", "1?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:9] Macro("SIP/209.247.17.5-0000003d", "dial,"",tr,100") in new stack
    -- Executing [s@macro-dial:1] GotoIf("SIP/209.247.17.5-0000003d", "1?dial") in new stack
    -- Goto (macro-dial,s,3)
    -- Executing [s@macro-dial:3] AGI("SIP/209.247.17.5-0000003d", "dialparties.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_request: dialparties.agi
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_channel: SIP/209.247.17.5-0000003d
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_language: en
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_type: SIP
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_uniqueid: 1267719205.87
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_version: 1.6.2.2
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_callerid: +15559876543
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_calleridname: COMPANY
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_callingpres: 0
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_callingani2: 0
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_callington: 0
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_callingtns: 0
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_dnid: 8775551234
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_rdnis: unknown
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_context: macro-dial
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_extension: s
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_priority: 3
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_enhanced: 0.0
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_accountcode:
<SIP/209.247.17.5-0000003d>AGI Tx >> agi_threadid: -1238369392
<SIP/209.247.17.5-0000003d>AGI Tx >>
    -- <SIP/209.247.17.5-0000003d>AGI Script dialparties.agi completed, returning -1

Are custom extensions working out of the box with 2.7 and asterisk 1.6? Anyone else have this up and running? I have tried to get some debug output from the dialparties.agi itself with no luck.

Thank you,
Aaron

Come to find out, this works fine out of the box. My SIP provider gave me a peer name that was not resovable via DNS, so of course out bound calls wouldn’t when you cannot contact the peer.

Once I put in the ip address of the peer instead of the DNS name, it worked fine.

Frustrating but glad I figured it out.

Aaron