Outgoing Calls Fail through PBX (asterisk 13)

I have two PBXs on is Asterisk that is local to me and one is Panasonic remote (in another country).

I want to be able to place a call from the Panasonic through the Asterisk to make calls to US numbers. Right now if I call an extension NXXX on the Asterisk box with the Panasonic it works perfect as long as the extension exsists. If I dial a number using the Panasonic to the asterisk server either NXXX or call NXXNXXXXXX the Asterisk server treats it like a DID and says the number is invalid.

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [5558675309@from-trunk-sip-10:1] Set("SIP/10-00001fe2", "GROUP()=OUT_2") in new stack
    -- Executing [5558675309@from-trunk-sip-10:2] Goto("SIP/10-00001fe2", "from-trunk,5558675309,1") in new stack
    -- Goto (from-trunk,5558675309,1)
    -- Executing [5558675309@from-trunk:1] Set("SIP/10-00001fe2", "__FROM_DID=5558675309") in new stack
    -- Executing [5558675309@from-trunk:2] NoOp("SIP/10-00001fe2", "Received an unknown call with DID set to 5558675309") in new stack
    -- Executing [5558675309@from-trunk:3] Goto("SIP/10-00001fe2", "s,a2") in new stack
    -- Goto (from-trunk,s,2)
    -- Executing [s@from-trunk:2] Answer("SIP/10-00001fe2", "") in new stack
    -- Executing [s@from-trunk:3] Log("SIP/10-00001fe2", "WARNING,Friendly Scanner from 192.168.10.161") in new stack
[2016-07-19 12:58:47] WARNING[18624][C-00001385]: Ext. s:3 @ from-trunk: Friendly Scanner from 192.168.10.161
    -- Executing [s@from-trunk:4] Wait("SIP/10-00001fe2", "2") in new stack
    -- Executing [s@from-trunk:5] Playback("SIP/10-00001fe2", "ss-noservice") in new stack
    -- <SIP/10-00001fe2> Playing 'ss-noservice.ulaw' (language 'en')
  == Spawn extension (from-trunk, s, 5) exited non-zero on 'SIP/10-00001fe2'
    -- Executing [h@from-trunk:1] Macro("SIP/10-00001fe2", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] ExecIf("SIP/10-00001fe2", "0?Set(CDR(recordingfile)=.)") in new stack
    -- Executing [s@macro-hangupcall:2] GotoIf("SIP/10-00001fe2", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,4)
    -- Executing [s@macro-hangupcall:4] ExecIf("SIP/10-00001fe2", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:5] Hangup("SIP/10-00001fe2", "") in new stack
  == Spawn extension (macro-hangupcall, s, 5) exited non-zero on 'SIP/10-00001fe2' in macro 'hangupcall'
  == Spawn extension (from-trunk, h, 1) exited non-zero on 'SIP/10-00001fe2'

`
If anymore information is needed let me know. I think it’s a context issue but, I’m not sure how to fix it.

Thanks for your help.

Complete dialplan, and sip.conf. (Transitive closure of any inclusions.)

However, this looks like its probably third party provided, so you should contact third party. The third party is likely to be a GUI provider, and this sort of thing tends to be within the capabilities of the GUI, even though the dialplan is too complex to analyze from first principles.

Basically this is not the result of Asterisk, but how it has been configured.

Change in the sip trunk settings the context, from-trunk-sip-10 to from-internal and try again.