[asterisk-users] Running a script after Dial() ?

Danny Nicholas danny at debsinc.com
Thu Feb 4 09:05:36 CST 2010


Set the emailaddr into a channel variable.  Since I'm there, just make your
h exten do the system if ${WAV} and ${emailaddr} are longer than 1.  Like
this.

- exten = h,1,noop(hangup logic)
- exten = h,n,Gotoif($["${LEN(${WAV})}" < "4"]?just_hangup)
- exten = h,n,Gotoif($["${LEN(${emailaddr})}" < "4"]?just_hangup)
- exten = h,n,System(send-recorded-conversation ${WAV}.wav ${EXTEN:1}
${emailaddr})
- exten = h,n(just_hangup),Hangup
--
Danny Nicholas
--

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Per Jessen
Sent: Thursday, February 04, 2010 8:55 AM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] Running a script after Dial() ?

Steve Edwards wrote:

> On Thu, 4 Feb 2010, Per Jessen wrote:
> 
>> ; calls prefix by '8' are recorded
>> exten = _8[01]./_251,1,Set(something=shortened)
>> exten = _8[01]./_251,n,Set(WAV=filename)
>> exten = _8[01]./_251,n,Monitor(wav,${WAV},mb)
>> exten = _8[01]./_251,n,Dial(mISDN/2/${EXTEN:1},,g)
>> exten = _8[01]./_251,n,System(send-recorded-conversation ${WAV}.wav
>> ${EXTEN:1} emailaddr)
>> exten = _8[01]./_251,n,Hangup()
>>
>> The idea is that the caller may opt to record a conversation by
>> prefixing the dialled number with '8'. The wav file would then be
>> emailed to him when the call finishes. The recording works fine, but
>> the emailing doesn't - only when the called party hangs up first, but
>> if the caller hangs up, the System(script) isn't called.  What am I
>> missing  here?
> 
> Check out the "h" exten.

Yes, I did look at that.  The issue is that the above has a hardcoded
extension-to-emailaddr relation (251->emailaddr). I don't see how I can
use the h extension when the email-address will depend on the callers
extension.  Well, I guess I could handle it in the script, but I'd
rather keep that information out of it.


/Per Jessen, Zürich


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list