CDR report does not show destination number (adhearsion - asterisk)

classic Classic list List threaded Threaded
7 messages Options
dev
Reply | Threaded
Open this post in threaded view
|

CDR report does not show destination number (adhearsion - asterisk)

dev
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? 
 
 
 
 

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CDR report does not show destination number (adhearsion - asterisk)

Ben Klang-2
On Jul 3, 2015, at 4:12 AM, dev <[hidden email]> 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 ? 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/

 
 
 
 

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (858 bytes) Download Attachment
lcx
Reply | Threaded
Open this post in threaded view
|

Re: CDR report does not show destination number (adhearsion - asterisk)

lcx

On 3 Jul 2015, at 16:04, Ben Klang wrote:

On Jul 3, 2015, at 4:12 AM, dev [hidden email] 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

  • 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

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
dev
Reply | Threaded
Open this post in threaded view
|

Re: CDR report does not show destination number (adhearsion - asterisk)

dev
In reply to this post by dev
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

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CDR report does not show destination number (adhearsion - asterisk)

Ben Langfeld-2
On 14 July 2015 at 01:45, dev <[hidden email]> wrote:
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? 

No it does not.
 
I think controller only executes when call success and, then, router forward call to controller.

You are correct.
 
What if i need reason of call fails like user is busy or congested channel or no answer by user. 

You should set an on_end callback on the call, something like this:

call = Adhearsion::OutboundCall.new
call.execute_controller_or_router_on_answer SomeController, {some: 'metadata'}
call.on_end do |end_event|
  puts "Call ended because of reason #{end_event.reason} / #{end_event.platform_code}"
end
call.dial '[hidden email]', {some: 'opts'}
 
 

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

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
dev
Reply | Threaded
Open this post in threaded view
|

Re: CDR report does not show destination number (adhearsion - asterisk)

dev
In reply to this post by dev
call = Adhearsion::OutboundCall.new
call.execute_controller_or_router_on_answer SomeController, {some: 'metadata'}
call.on_end do |end_event|
  puts "Call ended because of reason #{end_event.reason} / #{end_event.platform_code}"
end
call.dial '[hidden email]', {some: 'opts'}

Thank you Ben Langfeld. 
It is really helpful  in my project , especially to maintain call status logs.
I am using it as follow:

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


--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CDR report does not show destination number (adhearsion - asterisk)

Ben Langfeld
Note to all, if someone wants to submit a pull request to include this in the Adhearsion::OutboundCall.originate API, I would appreciate it.

Enviado do meu iPhone

Em 21 Jul 2015, às 05:11, dev <[hidden email]> escreveu:

call = Adhearsion::OutboundCall.new
call.execute_controller_or_router_on_answer SomeController, {some: 'metadata'}
call.on_end do |end_event|
  puts "Call ended because of reason #{end_event.reason} / #{end_event.platform_code}"
end
call.dial '[hidden email]', {some: 'opts'}

Thank you Ben Langfeld. 
It is really helpful  in my project , especially to maintain call status logs.
I am using it as follow:

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


--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.