Option to Insert Campaign ID as Account Code

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Option to Insert Campaign ID as Account Code

Postby Rudolfmdlt » Fri Feb 14, 2014 2:21 am

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
Rudolfmdlt
 
Posts: 92
Joined: Thu Jul 25, 2013 2:07 am

Re: Option to Insert Campaign ID as Account Code

Postby mflorell » Fri Feb 14, 2014 6:59 am

A SIP header and an Asterisk accountcode variable are two different things, which are you looking to do?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Option to Insert Campaign ID as Account Code

Postby Rudolfmdlt » Fri Feb 14, 2014 10:08 am

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
Rudolfmdlt
 
Posts: 92
Joined: Thu Jul 25, 2013 2:07 am

Re: Option to Insert Campaign ID as Account Code

Postby Rudolfmdlt » Sat Feb 15, 2014 6:00 am

Just to clarify, what I am trying to achieve is i) CDR for billing and ii) CDR billing for each campaign.

Regards,

Rudolf
Rudolfmdlt
 
Posts: 92
Joined: Thu Jul 25, 2013 2:07 am

Re: Option to Insert Campaign ID as Account Code

Postby mflorell » Sat Feb 15, 2014 7:10 am

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.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Features

Who is online

Users browsing this forum: No registered users and 30 guests