0

I'm new to Asterisk so any help will be greatly appreciated.

I'm trying to save remote party ID (CONNECTEDLINE) in CDR logs table in transferred calls. In blind transfers there's no problem because I'm getting Remote Party ID as Caller ID in src field.

In attended transfers I'm loosing the original caller ID.

This is how transfer goes:

  1. A calls B (A talking with B)
  2. B holds A, and calls C (B talking with C)
  3. B transfers A to C (A talking with C)

Now, in CDRs table I'm getting two records. One for the first call (A<->B), and another for the two second calls (B<->C and A<->C). The point is in second CDR I have lost any reference to A.

I want to save Remote Party ID (A) in second CDR. I've already added a custom field to CDR table (connectedID).

I'm reading about editing some configuration files, adding this kind of sentences:

"exten => s,1,set(CDR(connectedID)=${CONNECTEDLINE})"

However, I'm quite lost. I don't know which file I need to edit, even in what part of file I should put these lines of code.

Could somebody point me in the right direction?

Jawa
  • 2,336
  • 6
  • 34
  • 39
ejuanillo
  • 1
  • 4

2 Answers2

0

You can use Func_SHARED,save cid in shared variables and do lookup by bridged channel name

However that all require debugging and your own effort.

http://www.voip-info.org/wiki/view/Asterisk+func+shared

Other option is collect events and remmember all transfers

arheops
  • 15,544
  • 1
  • 21
  • 27
  • In attended transfers I don't have any crossreference value that I can use to trace two parts of the call (I have 4 different channels, 2 for each call segment). Maybe is how my phonesets work. However i think Func_SHARED is the right aproach to reach what I asked (in a proper environment). – ejuanillo Jan 19 '15 at 09:08
  • You can read events via AMI, will be link/unlink events(more then 1 for attendend transfer) which can be used to determine result. – arheops Jan 19 '15 at 10:11
  • Thanks @arheops, I will try AMI events aproach. – ejuanillo Jan 19 '15 at 13:36
0

Reading call events via AMI (thanks to @arheops) I manage how to save Remote Party ID in CDR.

In hangup event we can see Remote Party ID in ConnectedLineNum field.

For a transferred call like this one:

  • 401 calls 208
  • 208 calls 308 (401 on hold)
  • 208 transfers original call to 308 (401 talking with 308)

this is a hangup event sample for the final segment of the call.

Event Hangup Privilege: call,all Channel: SIP/308-00000665 Uniqueid: 1421757614.1658 CallerIDNum: 208 CallerIDName: Juan Ruiz ConnectedLineNum: 401 ConnectedLineName: Test1 Cause: 16 Cause-txt: Normal Clearing

Original caller is stored in ConnectedLineNum variable.

So I add this line to the hangup section:

exten => s,1,Set(CDR(connectedid)=${CONNECTEDLINE(number)})

I'm using Elastix 2.4.0, so I've added this line at the beggining of the [macro-hangupcall] macro in extensions_override_elastix.conf file.

In other Asterisk based distros it should be in another file.

ejuanillo
  • 1
  • 4