Inbound calls get cancelled - 'Subscriber Absent' warning

Hi,

I am having difficulty in configuring an inbound route for asterisk-java:
callcentric sip did -> freepbx distro/asterisk -> asterisk-java (this fails)
callcentric sip did -> freepbx distro/asterisk -> X-Lite (works smoothly)

My configuration is FreePBX Distro 2.210 w/ Asterisk 1.8.20 on CentOS. I successfully configured my callcentric sip trunk, an extension, and an inbound route. I can receive calls on X-lite. Now, I am trying to work my way through the Asterisk-java FastAGI tutorial to be able to handle inbound calls in my subclass of BaseAgiScript. But before my java code gets invoked, asterisk aborts the call. Following is the relevant information (please ask for anything else if required):

Asterisk-java Log: (no activity here)

prompt$ java -jar asterisk-java.jar
Mar 24, 2013 9:05:58 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Listening on *:4573.


Asterisk Log:
– Executing [[email protected]:33] ExecIf(“SIP/callcentric-00000007”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [[email protected]:34] GosubIf(“SIP/callcentric-00000007”, “0?qwait,1()”) in new stack
– Executing [[email protected]:35] Set(“SIP/callcentric-00000007”, “__CWIGNORE=”) in new stack
– Executing [[email protected]:36] Set(“SIP/callcentric-00000007”, “__KEEPCID=TRUE”) in new stack
– Executing [[email protected]:37] GotoIf(“SIP/callcentric-00000007”, “0?usegoto,1”) in new stack
– Executing [[email protected]:38] GotoIf(“SIP/callcentric-00000007”, “1?godial”) in new stack
– Goto (macro-dial-one,s,42)
– Executing [[email protected]:42] Dial(“SIP/callcentric-00000007”, “SIP/1001,tr”) in new stack
[2013-03-24 21:06:19] WARNING[3195]: app_dial.c:2345 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:43] ExecIf(“SIP/callcentric-00000007”, “0?Set(DIALSTATUS=)”) in new stack
– Executing [[email protected]:44] GosubIf(“SIP/callcentric-00000007”, “0?s-CHANUNAVAIL,1()”) in new stack
– Executing [[email protected]:45] MacroExit(“SIP/callcentric-00000007”, “”) in new stack
– Executing [[email protected]:15] Set(“SIP/callcentric-00000007”, “SV_DIALSTATUS=CHANUNAVAIL”) in new stack
– Executing [[email protected]:16] GosubIf(“SIP/callcentric-00000007”, “0?docfu,1()”) in new stack
– Executing [[email protected]:17] GosubIf(“SIP/callcentric-00000007”, “0?docfb,1()”) in new stack
– Executing [[email protected]:18] Set(“SIP/callcentric-00000007”, “DIALSTATUS=CHANUNAVAIL”) in new stack
– Executing [[email protected]:19] ExecIf(“SIP/callcentric-00000007”, “0?MacroExit()”) in new stack
– Executing [[email protected]:20] GotoIf(“SIP/callcentric-00000007”, “1?s-CHANUNAVAIL,1”) in new stack
– Goto (macro-exten-vm,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] GotoIf(“SIP/callcentric-00000007”, “0?exit,1”) in new stack
– Executing [[email protected]:2] PlayTones(“SIP/callcentric-00000007”, “congestion”) in new stack
– Executing [[email protected]:3] Congestion(“SIP/callcentric-00000007”, “10”) in new stack
== Spawn extension (macro-exten-vm, s-CHANUNAVAIL, 3) exited non-zero on ‘SIP/callcentric-00000007’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 1001, 2) exited non-zero on ‘SIP/callcentric-00000007’
– Executing [[email protected]:1] Macro(“SIP/callcentric-00000007”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/callcentric-00000007”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/callcentric-00000007”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] Hangup(“SIP/callcentric-00000007”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/callcentric-00000007’ in macro ‘hangupcall’
== Spawn extension (from-did-direct, h, 1) exited non-zero on 'SIP/callcentric-00000007’

extensions_custom.conf (contexts tried: default, from-pstn, from-trunk … none worked)

[from-pstn-custom]
exten => 1001,1,AGI(agi://192.168.1.106:4573/hello.agi)

SIP trunk peer details (From Callcentric’s configuration instructions for FreePBX)
context=from-pstn
fromdomain=callcentric.com
fromuser=177723XXXXX
host=callcentric.com
insecure=port,invite
secret=password
type=peer
defaultuser=177723XXXXX
disallowed_methods=UPDATE
directmedia=no
videosupport=no
disallow=all
allow=ulaw

sip_general_custom.conf (From Callcentric’s configuration instructions for FreePBX)

context=from-pstn
srvlookup=yes
session-timers=refuse
session-expires=180
session-minse=90
session-refresher=uas

SIP detailed logs

localhost*CLI> sip set debug on SIP Debugging enabled Really destroying SIP dialog '[email protected][::1]' Method: REGISTER

<— SIP read from UDP:204.11.192.161:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
v: SIP/2.0/UDP 204.11.192.161:5060;branch=z9hG4bK-065a4117c11d04df12a8cf3dafa2af77
f: sip:[email protected];tag=3573164592-373269
t: sip:[email protected]
i: [email protected]
CSeq: 1 INVITE
Max-Forwards: 8
m: sip:[email protected]:5060;transport=udp
Supported: timer
c: application/sdp
l: 350

v=0
o=NexTone-MSW 2147483647 2147483647 IN IP4 204.11.192.161
s=sip call
c=IN IP4 204.11.192.161
t=0 0
m=audio 54366 RTP/AVP 18 0 8 101
a=fmtp:18 annexb=no
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=ptime:20
a=sendrecv
a=silenceSupp:off - - - -
a=setup:actpass
<------------->
— (11 headers 16 lines) —
Sending to 204.11.192.161:5060 (NAT)
Using INVITE request as basis request - [email protected]
No matching peer for ‘16617480240’ from ‘204.11.192.161:5060’
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format telephone-event for ID 101
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format G729 for ID 18
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0x10c (ulaw|alaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 204.11.192.161:54366
Looking for 17772380367 in from-pstn (domain 71.62.43.250)
list_route: hop: sip:[email protected]:5060;transport=udp

<— Transmitting (NAT) to 204.11.192.161:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 204.11.192.161:5060;branch=z9hG4bK-065a4117c11d04df12a8cf3dafa2af77;received=204.11.192.161;rport=5060
From: sip:[email protected];tag=3573164592-373269
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 1 INVITE
Server: FPBX-2.10.1(1.8.20.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces
Contact: sip:[email protected]:5060
Content-Length: 0

<— Reliably Transmitting (NAT) to 204.11.192.161:5060 —>
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 204.11.192.161:5060;branch=z9hG4bK-065a4117c11d04df12a8cf3dafa2af77;received=204.11.192.161;rport=5060
From: sip:[email protected];tag=3573164592-373269
To: sip:[email protected];tag=as5f64e106
Call-ID: 23802012-3573164592-373239[at]msw1.telengy.net
CSeq: 1 INVITE
Server: FPBX-2.10.1(1.8.20.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces
X-Asterisk-HangupCause: Subscriber absent
X-Asterisk-HangupCauseCode: 20
Content-Length: 0
<------------>

Just want to share what worked for me:

In extensions_custom.conf:
[from-internal-custom]
include => invoke-fastagi

[invoke-fastagi]
exten => 1001,1,AGI(agi://192.168.1.106/hello.agi)

In FreePBX UI, created a Custom Destination:
invoke-fastagi,1001,1

Reconfigured my Inbound Route to point to the created custom destination instead of 1001 Extension. Called from my phone, and my Java program executed smoothly!

-thanks