简体   繁体   中英

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

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`
'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?

(if I had enough rep to comment, I'd ask you to post your controller code so I know how the call gets to 1@adhearsion-redirect).

Looks like you could use a helper-context to store some data in the CDR before continuing on to the adhearsion-redirect context. The part I'm missing is how to redirect your existing setup to the helper context.

Here's an example of a helper-context. Since I don't know your controller code, you essentially need to make it Dial(Local/1234567890@helper-context) instead of Dial(Local/1@adheasion-redirect) . Here's the context:

[helper-context]
exten=_X.,1,Set(CDR(userfield)=${EXTEN})
exten=_X.,n,Goto(1,adhearsion-redirect)

Basically what this does is let any extension match inside helper-context, and sets the "userfield" in the CDR to the number. (You could change this to other CDR fields, but this was NULL in your log, so it was ripe for the picking.) Then it forward on to the adhearsion-redirect context. Using the Dial I showed above, this would set CDR's userfield to 1234567890, or whatever number you wanted to dial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM