Store the result of AMD in MagnusBilling

Now MagnusBilling has a feature that makes you able to store the result of the AMD detection from Asterisk, when used for massive calling.

In order for it to work, you'll need to execute the function AMD() in your Asterisk context, the main one being "billing" located at extensions_magnus.conf to make the system analyze.

Keep in mind that the AMD must only be executed in the context if its a massive call, to do so, you'll need to check if the call has the variable ${CAMPAIGN_ID}, if it does, execute AMD();

The function will generate two variables, ${AMDSTATUS} and ${AMDCAUSE} as stated by Asterisk's documentation. Once the function is done executing, MagnusBilling will check if AMDSTATUS is MACHINE, and if it is, will change the status of the number to AMD and update the description with the value of the variable AMDCAUSE.

Example of the billing context including AMD():

 

 [billing]

exten => _[*0-9].,1,GotoIf($[${CAMPAIGN_ID}]?amd)

same => n(amd),AMD()

same => n,AGI("/var/www/html/mbilling/resources/asterisk/mbilling.php")

same => n,Hangup()

 

 

Commit link: https://github.com/magnussolution/magnusbilling7/commit/bdcbf990ec3fc31f17e526b132044c3c809a338a

 Please star the project in GitHub, it helps the project grow!