Outgoing number in Monitor call recording

Hello everyone . I need to know if its possible to put outgoing number ( dialled by user) in call recording instead of unique id .

I checked that recording-check agi files sets monitor call file name … its

$agi->verbose(“CALLFILENAME=OUT{$exten[‘data’]}-{$timestamp}-{$uniqueid}”);
$agi->set_variable(“CALLFILENAME”,“OUT{$exten[‘data’]}-{$timestamp}-{$uniqueid}”);

is there any variable i can use instead of $uniqueid which gives me outgoing number in recorded file ?

Thx .

[quote=“hamlet”]So is this the solution?

$num123 = $agi->get_variable(DIAL_NUMBER);
$agi->verbose(“PRINT -{$num123[“data”]}”);

file recordingcheck.agi

I would like to see the phone number on the recording also.

I notice that some recordings do not show ARI module is this some how related.[/quote]

Yes this works . now just scroll few lines below in case OUT and change callfilename to contain {$num123[“data”]} and you will get dialled number in callfilename :slight_smile:

So is this the solution?

$num123 = $agi->get_variable(DIAL_NUMBER);
$agi->verbose(“PRINT -{$num123[“data”]}”);

file recordingcheck.agi

I would like to see the phone number on the recording also.

I notice that some recordings do not show ARI module is this some how related.

hamlet said:

not - not related. There are other issues in ari, some of them are fixed in svn trunk. Not much goes on with ari as it is slated to be replaced with a proper user portal.

keep in mind, you will break current and future tools that depend on that uniqueid to cross reference all the info against the cdr. However - the number is there but off the top of my head I don’t remember exactly where that is in the dialplan. The number may be ${OUTNUM} it may be ${EXTEN} or otherwise - just poke around in the dialplan and you should find what variable it is using.

I intend ti add outgoing number in call file name without removng uniqueid . You were right that $OUTNUM contains dialled number but i cna see in cli that this variable is set after calling recordingcheck script but variable DIAL_NUMBER is set to dialled number before calling recording check . So for testing i did this in recordingcheck.agi

$num123 = $agi->get_variable(DIAL_NUMBER);
$agi->verbose(“CHECk 123 CHECK -{$num123}”);

but then on cli i get [code:1]recordingcheck|20070519-105801|1179552481.49770: CHEC CHECK -Array
recordingcheck|20070519-105801|1179552481.49770: Outbound recording enabled.[/code:1]

I CANt use $num123 in call file name unless i get dialled number properly :frowning: . I think agi get_variable only takes asterisk channel variables … any hint on which channel variable contains dialled number :frowning:

recordingcheck occurs before the number is fully formed since fixlocalprefix doesn’t get called until after so it may not be correct as you found.

No its working fine … just didnt notice that get_variable was returning an array and not variable name alone . This works

$num123 = $agi->get_variable(DIAL_NUMBER);
$agi->verbose(“PRINT -{$num123[“data”]}”);

this prints number properly since dial_number is set before calling recordinglog so {$num123[“data”]} can be used in outbound file name .

this no longer works in new FreePBX as its now a macro and not an AGI script, is there anyone who can help me with getting the dialed outside number?