SOLVED Asteridex Calls - No recording info in CDR

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
Had this come up again today. Hoping someone knows a fix before I dig around.

It is not possible to pull recordings of Asteridex dialed calls (speedial, call by name & web) from the CDR reports page. The recording download/playback icons are missing.

The calls DO record, but the recording file name is not written to the cdr db.

Does anyone know the magic to get this to update?
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
13.12.4 Pi
Code:
;# // BEGIN AsteriDex SpeedDial
exten => _000.,1,Answer
exten => _000.,n,EAGI(asteridex.agi,${EXTEN})
exten => _000.,n,GotoIf($["${DIAL:0:3}" = "000"]?96)
exten => _000.,n,NoOp(Number to Dial: ${DIAL})
exten => _000.,n,NoOp(Person to Dial: ${DUDE})
exten => _000.,n,agi(picotts.agi, "${DUDE}!", en-US)
exten => _000.,n,Dial(local/${DIAL}@from-internal)
exten => _000.,n,Goto(outbound-allroutes,${DIAL},1)
exten => _000.,n,Hangup()
exten => _000.,96,SayDigits(${EXTEN:3}) ; extensions dialed with 000 prefix get looked up in AsteriDex
exten => _000.,97,Playback(num-not-in-db)
exten => _000.,98,Playback(goodbye)
exten => _000.,99,Hangup()
;# // END AsteriDex SpeedDial

;;# // BEGIN Call by Name
;exten => 411,1,Answer
;exten => 411,2,Wait(1)
;exten => 411,3,Set(TIMEOUT(digit)=7)
;exten => 411,4,Set(TIMEOUT(response)=10)
;exten => 411,5,GotoIf($[${STAT(e,/usr/bin/swift)}]?8)
;exten => 411,6,picotts("Say the name, then press pound.")
;exten => 411,7,Goto(411,9)
;exten => 411,8,Swift("Say the name to call.")
;exten => 411,9(record),agi(speech-recog.agi,en-US)
;exten => 411,10,Noop(= Script returned: ${status} , ${id} , ${confidence} , ${utterance} =)
;exten => 411,11,AGI(nv-callwho.php,${utterance})
;exten => 411,12,NoOp(Number to call: ${NUM2CALL})
;exten => 411,13,GotoIf($["foo${NUM2CALL}" = "foo0"]?15)
;exten => 411,14,Goto(outbound-allroutes,${NUM2CALL},1)
;exten => 411,15,Wait(1)
;exten => 411,16,Hangup
;;# // END Call by Name

I shortened the prompt text and use picotts, but I don't think those changes have anything to do with it. I will test on a vanilla ISO build today.
 
Last edited:

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
Looking closer, the recording is added to the cdr, but is not displayed.

The item for the speed dial entry "00020" has no recording - fine, I don't care about recording the picotts response.

The next entry for the actual call does have the recording file info, but the report page is not offering up the option to download.
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
Solvcd it...

They had entered the phone number in asteridex formatted as "800-555-1212." Asterisk ignores the dashes and places the call, but the dashes are preserved as part of the dial string and recording file name. This evidently confuses the CDR page parsing code.

It's amazing how you can stare at something and not see what should be obvious (the dashes).

Folks ought to be able to enter numbers in a reasonable format, so the proper fix would be for Asteridex to strip the punctuation before returning the number to the dial plan, either in the AGI or as part of the plan itself.

I'll work it up and post, but it may be next week. About ot go out of town.
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
This fixes it for me, your mileage may vary. This strips all non-numeric characters from the number returned to asterisk from the asteridex modules.

Use at your own risk:
Code:
--- /var/www/html/asteridex4/callboth.php.stock 2016-03-03 00:32:24.246246953 -0500
+++ /var/www/html/asteridex4/callboth.php  2016-09-13 20:43:03.701142144 -0400
@@ -78,7 +78,7 @@
  fputs ($fp, "Action: Originate\r\n");
  fputs ($fp, "Channel: $IN\r\n");
  fputs ($fp, "Context: custom-callboth\r\n");
- fputs ($fp, "Exten: $OUT\r\n");
+ fputs ($fp, "Exten: " . preg_replace("/[^0-9]/", "", $OUT) . "\r\n");
  fputs ($fp, "Priority: 1\r\n\r\n");
  fputs ($fp, "Callerid: $CallerID\r\n\r\n");
  fputs ($fp, "Timeout: 30\r\n\r\n");


--- /var/lib/asterisk/agi-bin/nv-callwho2.php.stock  2016-02-27 17:13:58.732810391 -0500
+++ /var/lib/asterisk/agi-bin/nv-callwho2.php  2016-09-13 20:50:04.069982955 -0400
@@ -183,7 +183,7 @@
  $msg=chr(34)."Calling $person2call. One moment please." . chr(34) ;
  execute_agi("exec $tts $msg") ;
  mysql_close($dbconnection);
- execute_agi("SET VARIABLE NUM2CALL $num2call");
+ execute_agi("SET VARIABLE NUM2CALL " . preg_replace("/[^0-9]/", "", $num2call));

if ($emaildebuglog) :
  system("mime-construct --to $email --subject " . chr(34) . "Nerd Vittles CallWho for Asteridex ver. 1.0 Session Log" . chr(34) . " --attachment $log --type text/plain --file $log") ;
@@ -227,7 +227,7 @@
  $msg=chr(34)."No matching entry was found. Goodbye" . chr(34) ;
endif;
execute_agi("exec $tts $msg") ;
-execute_agi("SET VARIABLE NUM2CALL $num2call");
+execute_agi("SET VARIABLE NUM2CALL " . preg_replace("/[^0-9]/", "", $num2call));


--- /var/lib/asterisk/agi-bin/nv-callwho.php.stock  2016-02-27 17:13:58.752810388 -0500
+++ /var/lib/asterisk/agi-bin/nv-callwho.php  2016-09-13 21:06:44.037549015 -0400
@@ -183,7 +183,7 @@
  $msg=chr(34)."Calling $person2call. One moment please." . chr(34) ;
  execute_agi("exec $tts $msg") ;
  mysql_close($dbconnection);
- execute_agi("SET VARIABLE NUM2CALL $num2call");
+ execute_agi("SET VARIABLE NUM2CALL " . preg_replace("/[^0-9]/", "", $num2call));

if ($emaildebuglog) :
  system("mime-construct --to $email --subject " . chr(34) . "Nerd Vittles CallWho for Asteridex ver. 1.0 Session Log" . chr(34) . " --attachment $log --type text/plain --file $log") ;
@@ -227,7 +227,7 @@
  $msg=chr(34)."No matching entry was found. Goodbye" . chr(34) ;
endif;
execute_agi("exec $tts $msg") ;
-execute_agi("SET VARIABLE NUM2CALL $num2call");
+execute_agi("SET VARIABLE NUM2CALL " . preg_replace("/[^0-9]/", "", $num2call));


if ($emaildebuglog) :


--- /var/lib/asterisk/agi-bin/asteridex.agi.stock  2015-09-26 11:50:35.000000000 -0400
+++ /var/lib/asterisk/agi-bin/asteridex.agi  2016-09-13 19:51:39.790579798 -0400
@@ -26,6 +26,7 @@
  $AGI->verbose("AsteriDex match. Number to Dial = $realexten\n");
  $AGI->verbose("AsteriDex match. Person to Dial = $realname\n");
  $realname =~ s/[\,\"\'\(\)\_\ ]+/-/g;
+ $realexten =~ s/[^0-9]//g;
  $AGI->set_variable('DIAL', $realexten);
  $AGI->set_variable('DUDE', $realname);
}
 

Members online

Forum statistics

Threads
25,821
Messages
167,814
Members
19,247
Latest member
mdauck
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top