[asterisk-users] Callback through extensions.conf?

Gilles codecomplete at free.fr
Mon Feb 14 03:35:52 CST 2011


On Sat, 05 Feb 2011 12:07:28 +0100, Gilles <codecomplete at free.fr>
wrote:
>I've seen articles about Call files. Is this the easiest way to solve
>this problem?

I'm reading the 3rd edition of the "Asterisk: The Definitive Guide",
but since it's pretty big and there's no guarantee that the answer to
this issue is even in the book, I'd rather ask for feedback.

At this point, Asterisk is finally able to...
1. Detect a RING from my cellphone
2. Wait long enough to the line to stop ringing
3. Copy/modify/move a call file in the asterisk/outgoing directory
4. Make a callback to my cellphone

The problem is that Asterisk triggers an error when trying to make the
callback:
===================
-- Attempting call on Zap/1/123456 for s at callback:1 (Retry 1)
[Jan  1 01:54:34] NOTICE[317]: channel.c:2863 __ast_request_and_dial:
Unable to request channel Zap/1/123456
[Jan  1 01:54:34] NOTICE[317]: pbx_spool.c:341 attempt_thread: Call
failed to go through, reason (0) Call Failure (not BUSY, and not
NO_ANSWER, maybe Circuit busy or down?)
===================

Here's the callfile template:
===================
/var/tmp> cat ZAP.call.orig
Context: callback
Extension: s
===================

... and here's extensions.conf:
===================
[from_fxo]
;how to reliably detect that line is now quiet?
exten => s,1,Wait(15)
exten => s,n,Hangup

exten => h,1,system(cp /var/tmp/ZAP.call.orig /var/tmp/ZAP.call)
exten => h,n,System(echo 'Channel: Zap/1/${CELLPHONE}' >>
/var/tmp/ZAP.call)
exten => h,n,system(mv /var/tmp/ZAP.call /var/tmp/asterisk/outgoing)

[callback]
exten => s,1,Verbose(In callback)
exten => s,n,Wait(10)
exten => s,n,Hangup
===================

FWIW, I wondered if using a GoTo in "h" to jump to another context
would help, but it made no difference.

If someone's already built a callback like the above using an FXO
module, I would appreciate any feedback to try and solve this issue.

Thank you.




More information about the asterisk-users mailing list