Asterisk Call File

FreePBX/Asterisk 14

http://the-asterisk-book.com/1.6/call-file.html

I have a test call file I am using for callbacks. The desired result is to call the (external, random phone numbers) caller back and send them to an FreePBX IVR. The file is not working and the CLI is showing the following error:

purely numeric hostname and not a peer rejecting asterisk call file

I think this is because I am not defining the trunk in the channel field (Channel: SIP/${CALLERID(num)}) of the call file.

My question is, do I have to define a trunk? I would prefer not to as if the defined trunk failed, the app would fail instead of using the next available trunk.

Any ideas how to accomplish this in a FreePBX-Asterisk enviroment?

Thanks in advance!

I suggest you show us your callfile , it is obviously broken

Thanks Dicko,

Trunk and CID scrubbed

[cc-scba-alt-callback-id]
exten => s,1,GotoIf($["${CHANNEL(state)}" = "Up"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(TRYAGAIN),Playback(custom/SCBA_Request_Number,noanswer)
exten => s,n,Playback(custom/SCBA_Confirm_Number,noanswer)
exten => s,n,Read(CIDCONFIRM,,1,,3,20)
exten => s,n,GotoIf($["${CIDCONFIRM}" = "1"]?CONFIRMED:TRYAGAIN)
exten => s,n(CONFIRMED),System(echo -e "Channel: SIP/${CALLERID(num)}\\nContext: ivr-5\\\nExtension: s" > /tmp/${UNIQUEID}.call)
exten => s,n,System(mv /tmp/${UNIQUEID}.call /var/spool/asterisk/outgoing/)
exten => s,n,Hangup()

The CLI Returns:
- Executing [s@cc-scba-alt-callback-id:8] System("SIP/Trunk-000000f7", "echo -e "Channel: SIP/PHONENUMBER\\nContext: ivr-5\\nExtension: s" > /tmp/1510271162.313.call") in new stack
Executing [s@cc-scba-alt-callback-id:9] System("SIP/Trunk-000000f7", "mv /tmp/1510271162.313.call /var/spool/asterisk/outgoing/") in new stack
-- Attempting call on SIP/PHONENUMBER for s@ivr-5:1 (Retry 1)
-- Executing [s@cc-scba-alt-callback-id:10] Hangup("SIP/Trunk-000000f7", "") in new stack

== Spawn extension (cc-scba-alt-callback-id, s, 10) exited non-zero on 'SIP/Trunk-000000f7'
-- SIP/Trunk-000000f7 Internal Gosub(crm-hangup,s,1) start
-- Executing [s@crm-hangup:1] NoOp("SIP/Trunk-000000f7", "Sending Hangup to CRM") in new stack
[2017-11-09 15:46:25] WARNING[15438]: chan_sip.c:6288 create_addr: Purely numeric hostname (PHONENUMBER), and not a peer--rejecting!
[2017-11-09 15:46:25] NOTICE[15438]: pbx_spool.c:447 attempt_thread: Call failed to go through, reason (0) Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)
[2017-11-09 15:46:25] NOTICE[15438]: pbx_spool.c:450 attempt_thread: Queued call to SIP/PHONENUMBER expired without completion after 0 attempts
-- Executing [s@crm-hangup:2] NoOp("SIP/Trunk-000000f7", "HANGUP CAUSE: 16") in new stack

When I pause the mv command and look at the call file in tmp:
Channel: SIP/PHONENUMBER
Context: ivr-5
Extension: s

Any ideas?

Points for creativity but not for efficiency. Pleeeeease look up dialplan application Originate. Then Originate a call to:

local/${CALLERID(num)}@from-internal
1 Like