Page 1 of 1

Option to Insert Campaign ID as Account Code

PostPosted: Fri Feb 14, 2014 2:21 am
by Rudolfmdlt
Hi,

A feature that I think would be beneficial would be to have the Campaign ID inserted into the accountcode of the asterisk CDR module. If Vici could add this to the sip by default then whom ever wants to activate the CDR logging in asterisk, CSV or mysql can use this field by default.

Thoughts? :)

Regards,

Rudolf

Re: Option to Insert Campaign ID as Account Code

PostPosted: Fri Feb 14, 2014 6:59 am
by mflorell
A SIP header and an Asterisk accountcode variable are two different things, which are you looking to do?

Re: Option to Insert Campaign ID as Account Code

PostPosted: Fri Feb 14, 2014 10:08 am
by Rudolfmdlt
Hi mflorell,

I apologize for confusing the issue. :oops: http://www.voip-info.org/wiki/view/Aste ... pAddHeader, Just wasn't sure how it would be done from vici or through the AMI and made an assumption that if it was added to the sip header I would somehow be able to stick it in the CDR.

exten => s,1,Set(CDR(accountcode)=1234) is how I would set the account code normally.

Anyway, I have found a work around. (I Think :lol:)

I did a DumpChan in the dial plan and found a variable that you guys add "CAMPCUST=TEST1". This is the campaign ID right?

Code: Select all
================================================================================
Info:
Name=               Local/8478729009@default-dc56,2
Type=               Local
UniqueID=           1392385969.4304
CallerID=           0000000001
CallerIDName=       V2141552470000000193
DNIDDigits=         (N/A)
RDNIS=              (N/A)
State=              Ring (4)
Rings=              0
NativeFormat=       0x40 (slin)
WriteFormat=        0x40 (slin)
ReadFormat=         0x40 (slin)
1stFileDescriptor=  -1
Framesin=           0
Framesout=          0
TimetoHangup=       0
ElapsedTime=        0h0m0s
Context=            default
Extension=          8478729009
Priority=           2
CallGroup=
PickupGroup=
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:
AGISTATUS=SUCCESS
CAMPCUST=TEST1



So, by adding "exten => _9999X.,3,set(CDR(accountcode)=${CAMPCUST})" to the dial plan, I now have separate CDR's for each of my campaigns. Seems to be working - any reason why I shouldn't do it this way?

Regards,

Rudolf

Re: Option to Insert Campaign ID as Account Code

PostPosted: Sat Feb 15, 2014 6:00 am
by Rudolfmdlt
Just to clarify, what I am trying to achieve is i) CDR for billing and ii) CDR billing for each campaign.

Regards,

Rudolf

Re: Option to Insert Campaign ID as Account Code

PostPosted: Sat Feb 15, 2014 7:10 am
by mflorell
Asterisk CDR records are unreliable compared to gateway SIP proxy records for billing purposes, so we haven't ever really bothered to add features that would work through CDR records.

If you want to grab variables in the dialplan, just take a look at the agi-set_variables.agi script. That might make it a lot easier for you.