Adhearsion::OutboundCall.originate number,
from: call_from,
controller: controller ,
controller_metadata: {id: @id, initiate_from:'outbound'}
`id`, `calldate`, `clid`, `src`, `dst`, `dcontext`, `lastapp`, `lastdata`, `duration`, `billsec`, `disposition`, `channel`, `dstchannel`, `amaflags`, `accountcode`, `uniqueid`, `userfield`, `answer`, `end`
'2015-07-03 11:29:21', '9801243867', '9801243867', '1', 'adhearsion-redirect', 'Dial', 'SIP/ncell-out/playback', 5.12455, 5.89977, ' ANSWER', 'SIP/ncell-out-00000002', NULL, 'DOCUMENTATION', NULL, '1435902231.2', NULL, '0000-00-00 00:00:00', '2015-07-03 11:29:21'
'2015-07-03 11:29:26', '9801243867', '9801243867', '1', 'adhearsion-redirect', 'Dial', 'SIP/ncell-out/9771002', 0.000001, 0, 'NO ANSWER', 'SIP/ncell-out-00000003', NULL, 'DOCUMENTATION', NULL, '1435902236.3', NULL, '0000-00-00 00:00:00', '2015-07-03 11:29:26'
Executing [1@adhearsion-redirect:1] AGI("SIP/ncell-out-00000004", "agi:async")
--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adhearsion+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 3 Jul 2015, at 16:04, Ben Klang wrote:
On Jul 3, 2015, at 4:12 AM, dev achyu...@gmail.com wrote:
I have been using asterisk to connect to adhearsion for my system. System originate call to a sip number by using follow script.
Adhearsion::OutboundCall.originate number,
from: call_from,
controller: controller ,
controller_metadata: {id: @id, initiate_from:'outbound'}and cdr of asterisk is used to maintain call status. The number that i haved called (destination call number) is not shown in cdr report.:
id,calldate,clid,src,dst,dcontext,lastapp,lastdata,duration,billsec,disposition,channel,dstchannel,amaflags,accountcode,uniqueid,userfield,answer,end
CDR report of call originated from adhearsion.
'2015-07-03 11:29:21', '9801243867', '9801243867', '1', 'adhearsion-redirect', 'Dial', 'SIP/ncell-out/playback', 5.12455, 5.89977, ' ANSWER', 'SIP/ncell-out-00000002', NULL, 'DOCUMENTATION', NULL, '1435902231.2', NULL, '0000-00-00 00:00:00', '2015-07-03 11:29:21''2015-07-03 11:29:26', '9801243867', '9801243867', '1', 'adhearsion-redirect', 'Dial', 'SIP/ncell-out/9771002', 0.000001, 0, 'NO ANSWER', 'SIP/ncell-out-00000003', NULL, 'DOCUMENTATION', NULL, '1435902236.3', NULL, '0000-00-00 00:00:00', '2015-07-03 11:29:26'
Adhearsion call 1@adhearsion-redirect , 1 destination number.
Executing [1@adhearsion-redirect:1] AGI("SIP/ncell-out-00000004", "agi:async")how should i get destination number in cdr instead of 1 when originate call from adhearsion?
It sounds like this is a side-effect of the way we are originating calls, essentially a side-effect of the limitations of dialplan with AsyncAGI.
For now, would you go ahead and open an issue for this at https://github.com/adhearsion/adhearsion/issues/new https://github.com/adhearsion/adhearsion/issues/new ? I can’t promise how quickly we can fix it, but at least it will be visible.
Secondarily, I’d suggest making application-specific CDRs. It’s negligible work to capture the same information as Asterisk, and you have the advantage of being able to capture application-specific metrics, such as the amount of time spent in different parts of the application. With a little extra work, they can be a LOT more helpful/meaningful.
/BAK/
Some hints from my experience if you decide to use before_call and after_call
Cris
Thank you Cris. I have little confusion on when call is originated from OutboundCall providing a controller, does it execute before_call script if call is failed from asterisk?
I think controller only executes when call success and, then, router forward call to controller.
What if i need reason of call fails like user is busy or congested channel or no answer by user.
Some hints from my experience if you decide to use before_call and after_call
- keep in mind that before_call will be called for both, inbound AND outbound calls!
- if you want some metrics just on inbound calls, you can check with call.is_a?(Adhearsion::OutboundCall)
- you can't access "call" anymore once the call was hung up. You can increase the after_hangup_lifetime in adhearsion.rb if you want to be able to access "call" after the call is gone, or you can save the data somewhere.
Cris
--
class MakeOutboundCall
attr_accessor :id, :number, :call_id
def initialize(id,number,call_id)
@id=id
@number=number
@call_id=call_id
end
def call_start!
call = Adhearsion::OutboundCall.new
call.execute_controller_or_router_on_answer NoticeBoardCallController, {:id => @id, :initiate_from => 'outbound'}
call.on_end do |end_event|
#maintail call status
CallLogDetail.create(:status=>end_event.reason, ...)
end
puts @number
call.dial "SIP/#{@number}", :from => @call_id
end
end