[asterisk-users] Callback through extensions.conf?

Gilles codecomplete at free.fr
Mon Feb 7 03:48:05 CST 2011


On Mon, 7 Feb 2011 02:59:09 -0600, Sherwood McGowan
<sherwood.mcgowan at gmail.com> wrote:
>That's just CRAZY mate! I'm thinking it has EVERYTHING to do with your
>DAHDI/Zap setup... Barring something in your configuration that I don't know
>about, there's no reason that the system should just hang up the call during
>the Wait() command...

The /etc/zaptel.conf and /etc/asterisk/zapata.conf are pretty basic:
=======================
> cat /etc/zaptel.conf
loadzone = fr
defaultzone = fr
fxsks=1
=======================
> cat /etc/asterisk/zapata.conf
[trunkgroups]

[channels]
context=from_fxo
switchtype=national
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=no
threewaycalling=yes
transfer=yes
canpark=yes
busydetect=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no

signalling = fxs_ks
channel => 1
=======================

>I just had a thought though....Are you, perhaps, hanging your mobile (or
>whatever) phone up after dialing into the system to trigger that context?
>The reason I ask is that would make this suddenly seem more clear....

Yes, that's exactly the idea: From my cellphone, I ring Asterisk just
to notify that I want to be called back. Asterisk waits until the line
stops ringing (or 10s, if there's no better way), then it dials back.

>; Note From Sherwood McGowan
>; By Changing the exten => s to exten => h in the section below, we
>guarantee that Asterisk will execute the code IF THE CALL IS ENDED (like in
>the examples given on the mailing list)

By moving the call file part in the "h" extension, the code is
executed. That's better :-)

Problem is... Asterisk doesn't ring the phone, nothing happens:
=======================
-- Starting simple switch on 'Zap/1-1'
-- Executing [s at from_fxo:1] Wait("Zap/1-1", "1") in new stack
-- Executing [s at from_fxo:2] Set("Zap/1-1", "SOURCE_CIDNUMBER=5551234")
in new stack
-- Executing [s at from_fxo:3] Set("Zap/1-1", "SOURCE_CIDNAME=") in new
stack
-- Executing [s at from_fxo:4] NoOp("Zap/1-1", "Call from  - 5551234") in
new stack
-- Executing [s at from_fxo:5] NoOp("Zap/1-1", "CID OK") in new stack
-- Executing [s at from_fxo:6] Wait("Zap/1-1", "10") in new stack
== Spawn extension (from_fxo, s, 6) exited non-zero on 'Zap/1-1'
-- Executing [h at from_fxo:1] NoOp("Zap/1-1", "Before cp") in new stack
-- Executing [h at from_fxo:2] System("Zap/1-1", "cp
/var/spool/asterisk/skelett.call /var/tmp/skelett.call") in new stack
-- Executing [h at from_fxo:3] NoOp("Zap/1-1", "Before echo") in new
stack
-- Executing [h at from_fxo:4] System("Zap/1-1", "echo "Channel:
ZAP/1/5551234" >> /var/tmp/skelett.call") in new stack
-- Executing [h at from_fxo:5] NoOp("Zap/1-1", "Before mv") in new stack
-- Executing [h at from_fxo:6] System("Zap/1-1", "mv
/var/tmp/skelett.call /var/spool/asterisk/outgoing/") in new stack
-- Hungup 'Zap/1-1'
=======================

To simplify further, I tried building a callfile.call manually and
moving it to /var/spool/asterisk/outgoing/ ...
======================
Channel: ZAP/1/5551234
Context: callback-dialtone-auth
Extension: s
Priority: 1
MaxRetries: 2
RetryTime: 60
WaitTime: 30
======================

... but Asterisk does nothing, altough "show modules" says that
pbx_spool.so is loaded. Weird :-/

FWIW, Asterisk runs as root, and root owns callfile.call.

Maybe it's the uClinux or the Asterisk I'm using that's configured in
such a way that callfiles don't work as planned.

Apparently, there's no other way than callfiles to have Asterisk dial
out from the dialplan?

Thank you.




More information about the asterisk-users mailing list