[asterisk-users] Callback through extensions.conf?

Sherwood McGowan sherwood.mcgowan at gmail.com
Mon Feb 7 02:59:09 CST 2011


On Mon, Feb 7, 2011 at 2:22 AM, Gilles <codecomplete at free.fr> wrote:

> Lowering it to 5 seconds makes no difference. I also tried adding a
> Hangup before Wait but then the script ends before Wait.
>
>
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...


> Could it be that it's just not possible to reuse a channel to dial out
> after it's been used to receive a call, even though it was just for a
> ring?
>
>
Well, first of all, the channel (in the example dialplan and logs you posted
earlier) wouldn't even be dialing a call, it would just be responsible for
the generation of the callfile that would then cause Asterisk to spawn a
call via whatever Channel you specified....

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....

Basically, try this modified version of the dialplan code:

[from_fxo]
exten => s,1,Wait(2)

exten => s,n,Set(SOURCE_CIDNUMBER=${
CALLERID(num)})
exten => s,n,Set(SOURCE_CIDNAME=${CALLERID(name)})
exten => s,n,NoOp(Call from ${SOURCE_CIDNAME} - ${SOURCE_CIDNUMBER})

exten => s,n,GotoIf($["${SOURCE_CIDNUMBER}" = ${GSM}]?goodcid:badcid)

exten => s,n(goodcid),NoOp(CID OK)
;how to reliably detect that line is now quiet?
exten => s,n,Wait(10)

; 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)

; Good Luck!

exten => h,1,NoOp(Before cp)
exten => h,n,system(cp /var/spool/asterisk/skelett.call
/var/tmp/skelett.call)
exten => h,n,NoOp(Before echo)
exten => h,n,system(echo "Channel: ZAP/1/${IPPI}" >> /var/tmp/skelett.call)
exten => h,n,NoOp(Before mv)
exten => h,n,system(mv /var/tmp/skelett.call /var/spool/asterisk/outgoing/)


Cheers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110207/8fffafc0/attachment.htm>


More information about the asterisk-users mailing list