Add * prefix to voicemail extension 4000. For *97 change the variable used to identify the registered extension. CDR use domain_uuid if it has been supplied.
This commit is contained in:
parent
b061a5e90e
commit
1c5f7d57d6
|
|
@ -1,6 +1,6 @@
|
|||
<!-- voicemail main extension, used when * is pressed from an external number -->
|
||||
<extension name="vmain" app_uuid="d085a1e3-c53a-4480-9ca6-6a362899a681">
|
||||
<condition field="destination_number" expression="^vmain$|^4000$|^\*98$">
|
||||
<condition field="destination_number" expression="^vmain$|^\*4000$|^\*98$">
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="voicemail" data="check default ${domain_name}"/>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
<condition field="destination_number" expression="^\*97$">
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="voicemail" data="check default ${domain_name} ${sip_from_user}"/>
|
||||
<action application="voicemail" data="check default ${domain_name} ${caller_id_number}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
|
@ -133,10 +133,10 @@ function process_xml_cdr($db, $leg, $xml_string) {
|
|||
//store the call leg
|
||||
$database->fields['leg'] = $leg;
|
||||
|
||||
//store the call direction.
|
||||
//store the call direction
|
||||
$database->fields['direction'] = check_str(urldecode($xml->variables->call_direction));
|
||||
|
||||
//store post dial delay, in milliseconds.
|
||||
//store post dial delay, in milliseconds
|
||||
$database->fields['pdd_ms'] = check_str(urldecode($xml->variables->progress_mediamsec) + urldecode($xml->variables->progressmsec));
|
||||
|
||||
//get break down the date to year, month and day
|
||||
|
|
@ -145,23 +145,30 @@ function process_xml_cdr($db, $leg, $xml_string) {
|
|||
$tmp_month = date("M", $tmp_time);
|
||||
$tmp_day = date("d", $tmp_time);
|
||||
|
||||
//find the domain_uuid by using the domain_name
|
||||
//get the domain values from the xml
|
||||
$domain_name = check_str(urldecode($xml->variables->domain_name));
|
||||
$sql = "select domain_uuid from v_domains ";
|
||||
if (strlen($domain_name) == 0 && $context != 'public' && $context != 'default') {
|
||||
$sql .= "where domain_name = '".$context."' ";
|
||||
}
|
||||
else {
|
||||
$sql .= "where domain_name = '".$domain_name."' ";
|
||||
}
|
||||
$row = $db->query($sql)->fetch();
|
||||
$domain_uuid = $row['domain_uuid'];
|
||||
$domain_uuid = check_str(urldecode($xml->variables->domain_uuid));
|
||||
|
||||
//get the domain_uuid with the domain_name
|
||||
if (strlen($domain_uuid) == 0) {
|
||||
$sql = "select domain_name, domain_uuid from v_domains ";
|
||||
$sql = "select domain_uuid from v_domains ";
|
||||
if (strlen($domain_name) == 0 && $context != 'public' && $context != 'default') {
|
||||
$sql .= "where domain_name = '".$context."' ";
|
||||
}
|
||||
else {
|
||||
$sql .= "where domain_name = '".$domain_name."' ";
|
||||
}
|
||||
$row = $db->query($sql)->fetch();
|
||||
$domain_uuid = $row['domain_uuid'];
|
||||
if (strlen($domain_name) == 0) { $domain_name = $row['domain_name']; }
|
||||
if (strlen($domain_uuid) == 0) {
|
||||
$sql = "select domain_name, domain_uuid from v_domains ";
|
||||
$row = $db->query($sql)->fetch();
|
||||
$domain_uuid = $row['domain_uuid'];
|
||||
if (strlen($domain_name) == 0) { $domain_name = $row['domain_name']; }
|
||||
}
|
||||
}
|
||||
|
||||
//set values in the database
|
||||
$database->domain_uuid = $domain_uuid;
|
||||
$database->fields['domain_uuid'] = $domain_uuid;
|
||||
$database->fields['domain_name'] = $domain_name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue