record calls in asterisk withing dial() application - asterisk

I am trying to call 5 sip phones simultaneously and also i want to record call when it is connected to any of the sip phone.
my dialplan is :
exten => s,1,Dial(SIP/user1&SIP/user2&SIP/user3&SIP/user4&SIP/user5,55,options)
I m able to receive call but I tried many options and I am not able to record call .
I need to record call like callerid-reciverid-date.wav

You can use MixMonitor to record calls
exten=> s,1,Set(Date=${STRFTIME(,EST4EDT,%Y-%m-%d_%H%M%S)})
exten=> s,n,MixMonitor(${CALLERID(NUM)}-${EXTEN}_${Date}.WAV,W(1));
exten=> s,n,Dial(SIP/user1&SIP/user2&SIP/user3&SIP/user4&SIP/user5,55,options)
your recorded files usually are in /var/spool/asterisk/monitor

Related

Asterisk ringback tone recording

I made an outbound-call service application using Asterisk AMI interface.
Following is how my application works.
I generate an Originate request to internal channel using TCP/IP socket.
my dialplan accepts the request and run dial command. extension.conf file is
[from-internal]
exten => _X.,1,NoOP()
same => n,MixMonitor(${DialMonitorFile}.wav)
same => n,Dial(PJSIP/${EXTEN}#TRUNK_100-1234-5678,30)
What I want to do is record whole call process (from ringback tone sound until user hangup).
But, when dial started, only 44 byte size file is generated (maybe wav file header?) before user accepts the call. And, file increased after user accepts call.
Can someone help me how can I record ringback tone sound as well ?
Regards,
Brian
You should do Answer before MixMonitor if you want that
Please note, CDRs will be affected

Get return value of the Dial application in Asterisk

I call to a voice browser with the Dial application on SIP channel in Asterisk. The VXI returns a number. How can I get that number as a return value of the Dial application? ${DIALSTATUS} doesn't get the return value. It has last result of Dial application like ANSWER,NOANSWER,... .
exten => _.,n,Set(VXMLFILE=/var/spool/asterisk/tmp/${EXTEN}.vxml)
exten => _.,n,SipAddHeader(voicexml: ${VXMLFILE})
exten => _.,n,Dial(sip/[some parameters])
Voicexml processing is not part of asterisk, it done by your UA.
So you have consult our UA for result.
Can suggest it allow save log on remote syslog server, so you can parse result from log.
Asterisk cannot directly parse the vxml or xml files.
Create an Asterisk AGI script and parse the vxml file and assign the value to the variable "VXMLFILE".
Go through this URL to understand how Asterisk AGI works.
voip-info.org

channel originate, how to do call from a local channel? (call intercom and send dtmf)

My goal is to :
run a background task activated by dynamic feature while in active call, that will execute dial to another EXT and send DTMF.
It means, when a user is active call with someone, when the user press 5555, the door will be opened.
In order to open the door today, I have to manually call EXT 6(the door) and send DTMF digits: 00*
All of this has to happen automatically when the user press 5555 without interfering the active call.
I tried before to do all of this with dial, but dial blocks the call or bridges with another extension and then I lose the original call.
I figured out that I need to do this with ASYNC, means I can not use dialplan, I need to use CLI, and then originate some how.
Asterisk will need to create a local session / local channel and establish/connect to the door extension, then send DTMF and hangup
All of this – in background.
this is somthing i managed to do so far:
features_applicationmap_custom.conf
openthedoor=> 5555,caller,macro,OpenIntercomCall
then in ->
extensions_custom.conf
[macro-OpenIntercomCall]
exten => s,1,System(asterisk -rx "channel originate SIP/6 extension#yoyo")
i do not understand how do i call to SIP/6 from asterisk(using a local or random channel), and then send DTMF on answer.
the door ext is SIP/6, and 00* is the dtmf to open it.
What i am trying to do is that when a user 5555 in a call, the door will be opened.
means i want asterisk to call the intercom and send dtmf
There are no any sence do exec asterisk from inside asterisk. You can do Originate command.
Originate(tech_data,type,arg1[,arg2[,arg3[,timeout]]])
For example you can do something like this
exten => s,1,Originate(SIP/6,app,SendDTMF,ww00*)
Should be enought for your need.

Asterisk 1.8 dial multiple number at the same time for outdound conference

i want to connect to 5 numbers at a time to put them in conference call.
i was trying with this dialplan
exten => 123,1,Dial(Dahdi/g0/no_1&Dahdi/g0/no_2&Dahdi/g0/no_3)
with this code who ever answer the call first it will be connected and remaining will get disconnect.
regards
Vikas
That dialplan have be working if you group0 setuped correctly and have enough free channels
You also can use dial Local/123#context/n - call via dialplan

How Can we execute a Agi script after hangup

How Can we execute a Agi script after hangup ,Actually i am using queue with local channel, I m trying with "h,1,AGI()".but it is executing two times after hangup but i want to execute it one time after hangup of both channels
Correct way - NEVER execute scripts after hangups. Use mysql or other db cdrs, put all info you need into cdrs using custom fields
exten => s,n,Set(CDR(my_db_custom_field)=something)
After call end check cdrs and execute needed action by EXTERNAL threads.
Asterisk h extensions designed for fast non-blocking actions only.
It will be executed only once. If you have twice, very likly you have more then 1 channel (Local/ channels) in your dialplan.
You have add h-extension only into ONE place(in case of queue only in agent call or better use queue_log action for queue)

Resources