[asterisk-users] Recording with MixMonitor and AGI

Henrik Westerberg henrik.westerberg at ain.se
Sat Mar 9 16:13:23 CST 2013


Hi,

Ok but when I use the macro the recording doesn´t start until the call is
answered which is a plus. It´s easy to trim away silence of course though.

But according to the documentation it seems like DeadAgi is obsolete in
Asterisk 1.6 and later, that AGI should be used instead.

Regards,
Henrik




Den 2013-03-08 05:30 skrev Bharat Lalcheta <bharatlalcheta at gmail.com>:

>As far as i understand your requirements, there is no need to use
>macro for recording, You can directly call mixmonitor before Dial
>application in your dialplan with required options. For transfer of
>file, you are using AGI in h priority. However, you have to use
>DeadAgi in h extension.  As your channel already hangup, it can not
>run on AGI.
>
>Hope it will help you.
>
>Regards,
>
>Bharat Lalcheta
>
>On Thu, Mar 7, 2013 at 8:51 PM, Henrik Westerberg
><henrik.westerberg at ain.se> wrote:
>> Hi,
>>
>> I am developing a call recording application on Asterisk 11.2 and have
>>this
>> configuration in my dialplan:
>>
>> [macro-ccdev2-rec]
>> exten => s,1,MixMonitor(${ARG1},b)
>>
>> [outgoing-originate]
>> exten => _X.,1,NoOp(Will send call to ${EXTEN})
>> exten => _X.,n,Dial(SIP/${EXTEN}@x.y.z)
>>
>> [outgoing-originate-rec]
>> exten =>
>> h,1,Agi(agi://localhost/ajpbx.agi?path=uploadrec&callid=${CC_CALLID})
>>
>> exten => _X,1,NoOp(Will send call to ${EXTEN}, CC_CALLID is
>>${CC_CALLID},
>> CC_FILENAME is ${CC_FILENAME})
>> exten => _X,n,Dial(SIP/${EXTEN}@x.y.z,60,M(ccdev2-rec^${CC_FILENAME})e)
>>
>> If I want to make a recorded server callout from 077777777 to
>>0888888888 I
>> then originate a call via AMI to Local/077777777 at outgoing-originate with
>> context set to outgoing-originate-rec and extension to 0888888888.
>> The result will be something like this:
>>
>>     -- Executing [s at macro-ccdev2-rec:1]
>> MixMonitor("SIP/upps-ccm-tq01-0000003f", "cbrec-15605.wav,b") in new
>>stack
>>   == Begin MixMonitor Recording SIP/upps-ccm-tq01-0000003f
>>     -- Executing [h at outgoing-originate-rec:1]
>> AGI("SIP/upps-ccm-tq01-0000003e",
>> "agi://l4574/ajpbxtest.agi?path=uploadrec&callid=15605") in new stack
>>     -- <SIP/upps-ccm-tq01-0000003e>AGI Script
>> agi://localhost/ajpbxtest.agi?path=uploadrec&callid=15605 completed,
>> returning 0
>>     -- Executing [h at outgoing-originate-rec-dev2:1]
>> AGI("SIP/upps-ccm-tq01-0000003f",
>> "agi://4574/ajpbxtest.agi?path=uploadrec&callid=") in new stack
>>     -- <SIP/upps-ccm-tq01-0000003f>AGI Script
>> agi://localhost/ajpbxtest.agi?path=uploadrec&callid= completed,
>>returning 0
>>   == MixMonitor close filestream (mixed)
>>   == End MixMonitor Recording SIP/upps-ccm-tq01-0000003f
>>
>> Unfortunately I get two different calls to the h extension, but this I
>>can
>> cope with. The one without called is not interesting.
>> The uploading will fail since the MixMonitor is still on when I try to
>> upload the file. The file will not have a duration. It works when I
>>schedule
>> the uploading a while after from my agi application but I would rather
>>not
>> rely on a timeout.
>>
>> When I tried to run StopMixMonitor before the Agi call in the h
>>extension,
>> the first call fail and I never get any uploading with callid.
>>
>>     -- Executing [s at macro-ccdev2-rec:1]
>> MixMonitor("SIP/upps-ccm-tq01-00000043", "cbrec-15607.wav,b") in new
>>stack
>>   == Begin MixMonitor Recording SIP/upps-ccm-tq01-00000043
>>     -- Executing [h at outgoing-originate-rec-dev2:1]
>> StopMixMonitor("SIP/upps-ccm-tq01-00000042", "") in new stack
>>   == Spawn extension (outgoing-originate-rec-dev2, h, 1) exited
>>non-zero on
>> 'SIP/upps-ccm-tq01-00000042'
>>     -- Executing [h at outgoing-originate-rec-dev2:1]
>> StopMixMonitor("SIP/upps-ccm-tq01-00000043", "") in new stack
>>   == MixMonitor close filestream (mixed)
>>     -- Executing [h at outgoing-originate-rec-dev2:2]
>> AGI("SIP/upps-ccm-tq01-00000043",
>> "agi://localhost/ajpbxtest.agi?path=uploadrec&callid=") in new stack
>>
>> Am I missing something here? I also looked at the possibility to
>>specify a
>> command to execute when MixMonitor stops but I would rather handle the
>>file
>> uploading in my agi application.
>>
>> I also have another case: I want to dial out a call and record it. It
>>will
>> be a "oneway-call" from the server to a mobile. Do I need to get
>>AGI-control
>> of it and record with an AGI command or how can I hack it directly in
>>the
>> dial plan using MixMonitor?
>>
>> Best Regards,
>> Henrik
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>                http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>-- 
>Bharat Lalcheta
>
>--
>_____________________________________________________________________
>-- Bandwidth and Colocation Provided by http://www.api-digital.com --
>New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
>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