<X-PRE-PROCESS cmd="set" data="default_provider_username=3435555555"/>
<variable name="outbound_caller_id_name" value="3435555566"/>
auto_login
Value : true
Enabled : true
After changing the values ​​on the current page, click Save , on the Reload settings default page.Attention!
You use the proposed scripts at your own risk and risk; the author is not responsible for their incorrect use or the unexpected side effects of their correct use..
- Set the $ nums variable to match your numbers.
- Before using scripts, you must replace the domain UUID everywhere with the value assigned to the domain during installation (the domain_uuid field).
- It is also necessary to replace the IP address of the domain (172.18.253.1) with yours.
- Do not forget to correct the value of the -SearchBase key, specifying your sample area instead of "OU = Ekaterinburg, DC = dc, DC = domain, DC = local"
- The UUID of the Voicemail application ( app_uuid field) is also replaced with the UUID assigned during installation.
- Values ​​of UUIDs can be viewed, for example, in the v_dialplans table.
- All subscriber numbers will be assigned a password for registration “12345”, a password for voice mail and other services - the same as the subscriber number.
- The script appends files line by line! Therefore, do not forget to delete files before each launch of the script or to clear their contents!
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False $nums=@{"1111"="5555555";"1112"="5555566"} [System.IO.File]::AppendAllText("d:\v_extensions.csv", "extension_uuid;domain_uuid;extension;number_alias;password;accountcode;effective_caller_id_name;effective_caller_id_number;outbound_caller_id_name;outbound_caller_id_number;emergency_caller_id_name;emergency_caller_id_number;directory_full_name;directory_visible;directory_exten_visible;limit_max;limit_destination;missed_call_app;missed_call_data;user_context;toll_allow;call_timeout;call_group;call_screen_enabled;user_record;hold_music;auth_acl;cidr;sip_force_contact;nibble_account;sip_force_expires;mwi_account;sip_bypass_media;unique_id;dial_string;dial_user;dial_domain;do_not_disturb;forward_all_destination;forward_all_enabled;forward_busy_destination;forward_busy_enabled;forward_no_answer_destination;forward_no_answer_enabled;follow_me_uuid;enabled;description;forward_caller_id_uuid;absolute_codec_string;forward_user_not_registered_destination;forward_user_not_registered_enabled;force_ping`r`n", $Utf8NoBomEncoding) [System.IO.File]::AppendAllText("d:\v_voicemails.csv", "domain_uuid;voicemail_uuid;voicemail_id;voicemail_password;greeting_id;voicemail_alternate_greet_id;voicemail_mail_to;voicemail_sms_to;voicemail_attach_file;voicemail_file;voicemail_local_after_email;voicemail_enabled;voicemail_description;voicemail_name_base64`r`n", $Utf8NoBomEncoding) Get-ADUser -Filter * -SearchBase "OU=Ekaterinburg,DC=dc,DC=domain,DC=local" -Properties Telephonenumber,sn,initials,cn|%{ if(-not $_.Telephonenumber -eq ""){ if($nums.Get_Item($_.Telephonenumber) -eq $null) {$outn = "5555555"} else {$outn = $nums.Get_Item($_.Telephonenumber)} $extension_uuid = (New-Guid).Tostring() $domain_uuid = "ffffffff-ffff-ffff-ffff-ffffffffffff" ## !!! $extension = $_.Telephonenumber $number_alias = "" $password = "12345" $accountcode = "172.18.253.1" $effective_caller_id_name = $_.sn + " " + $_.initials $effective_caller_id_number = $extension $outbound_caller_id_name = $outn $outbound_caller_id_number = $outn $emergency_caller_id_name = $effective_caller_id_name $emergency_caller_id_number = $extension $directory_full_name = $_.cn $directory_visible = "true" $directory_exten_visible = "true" $limit_max = "1" $limit_destination = "error/user_busy" $missed_call_app = "" $missed_call_data = "" $user_context = "172.18.253.1" $toll_allow = "domestic,international,local" $call_timeout = "30" $call_group = "" $call_screen_enabled = "false" $user_record = "" $hold_music = "local_stream://default" $auth_acl = "" $cidr = "" $sip_force_contact = "" $nibble_account = "" $sip_force_expires = "3600" $mwi_account = "" $sip_bypass_media = "" $unique_id = "" $dial_string = "" $dial_user = "" $dial_domain = "" $do_not_disturb = "" $forward_all_destination = "" $forward_all_enabled = "" $forward_busy_destination = "" $forward_busy_enabled = "" $forward_no_answer_destination = "" $forward_no_answer_enabled = "" $follow_me_uuid = "" $enabled = "true" $description = $_.sn + " " + $_.initials $forward_caller_id_uuid = "" $absolute_codec_string = "" $forward_user_not_registered_destination = "" $forward_user_not_registered_enabled = "" $force_ping = "" $csv="$extension_uuid;$domain_uuid;$extension;$number_alias;$password;$accountcode;$effective_caller_id_name;$effective_caller_id_number;$outbound_caller_id_name;$outbound_caller_id_number;$emergency_caller_id_name;$emergency_caller_id_number;$directory_full_name;$directory_visible;$directory_exten_visible;$limit_max;$limit_destination;$missed_call_app;$missed_call_data;$user_context;`"$toll_allow`";$call_timeout;$call_group;$call_screen_enabled;$user_record;$hold_music;$auth_acl;$cidr;$sip_force_contact;$nibble_account;$sip_force_expires;$mwi_account;$sip_bypass_media;$unique_id;$dial_string;$dial_user;$dial_domain;$do_not_disturb;$forward_all_destination;$forward_all_enabled;$forward_busy_destination;$forward_busy_enabled;$forward_no_answer_destination;$forward_no_answer_enabled;$follow_me_uuid;$enabled;$description;$forward_caller_id_uuid;$absolute_codec_string;$forward_user_not_registered_destination;$forward_user_not_registered_enabled;`"$force_ping`"`r`n" [System.IO.File]::AppendAllText("d:\v_extensions.csv", $csv, $Utf8NoBomEncoding) $voicemail_uuid = (New-Guid).Tostring() $voicemail_id = $extension $voicemail_password = $extension $greeting_id $voicemail_alternate_greet_id $voicemail_mail_to = "" $voicemail_sms_to $voicemail_attach_file $voicemail_file = "" $voicemail_local_after_email = "true" $voicemail_enabled = "false" $voicemail_description = $description $voicemail_name_base64 [System.IO.File]::AppendAllText("d:\v_voicemails.csv", "$domain_uuid;$voicemail_uuid;$voicemail_id;$voicemail_password;$greeting_id;$voicemail_alternate_greet_id;$voicemail_mail_to;$voicemail_sms_to;$voicemail_attach_file;$voicemail_file;$voicemail_local_after_email;$voicemail_enabled;$voicemail_description;$voicemail_name_base64`r`n", $Utf8NoBomEncoding)}}
; user_context; toll_allow; call_timeout; call_group; call_screen_enabled; user_record; hold_music; auth_acl; cidr; sip_force_contact; nibble_account; sip_force_expires; mwi_account; sip_bypass_media; unique_id; dial_string; dial_user; dial_domain; do_not_disturb; forward_all_destination; forward_all_enabled $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False $nums=@{"1111"="5555555";"1112"="5555566"} [System.IO.File]::AppendAllText("d:\v_extensions.csv", "extension_uuid;domain_uuid;extension;number_alias;password;accountcode;effective_caller_id_name;effective_caller_id_number;outbound_caller_id_name;outbound_caller_id_number;emergency_caller_id_name;emergency_caller_id_number;directory_full_name;directory_visible;directory_exten_visible;limit_max;limit_destination;missed_call_app;missed_call_data;user_context;toll_allow;call_timeout;call_group;call_screen_enabled;user_record;hold_music;auth_acl;cidr;sip_force_contact;nibble_account;sip_force_expires;mwi_account;sip_bypass_media;unique_id;dial_string;dial_user;dial_domain;do_not_disturb;forward_all_destination;forward_all_enabled;forward_busy_destination;forward_busy_enabled;forward_no_answer_destination;forward_no_answer_enabled;follow_me_uuid;enabled;description;forward_caller_id_uuid;absolute_codec_string;forward_user_not_registered_destination;forward_user_not_registered_enabled;force_ping`r`n", $Utf8NoBomEncoding) [System.IO.File]::AppendAllText("d:\v_voicemails.csv", "domain_uuid;voicemail_uuid;voicemail_id;voicemail_password;greeting_id;voicemail_alternate_greet_id;voicemail_mail_to;voicemail_sms_to;voicemail_attach_file;voicemail_file;voicemail_local_after_email;voicemail_enabled;voicemail_description;voicemail_name_base64`r`n", $Utf8NoBomEncoding) Get-ADUser -Filter * -SearchBase "OU=Ekaterinburg,DC=dc,DC=domain,DC=local" -Properties Telephonenumber,sn,initials,cn|%{ if(-not $_.Telephonenumber -eq ""){ if($nums.Get_Item($_.Telephonenumber) -eq $null) {$outn = "5555555"} else {$outn = $nums.Get_Item($_.Telephonenumber)} $extension_uuid = (New-Guid).Tostring() $domain_uuid = "ffffffff-ffff-ffff-ffff-ffffffffffff" ## !!! $extension = $_.Telephonenumber $number_alias = "" $password = "12345" $accountcode = "172.18.253.1" $effective_caller_id_name = $_.sn + " " + $_.initials $effective_caller_id_number = $extension $outbound_caller_id_name = $outn $outbound_caller_id_number = $outn $emergency_caller_id_name = $effective_caller_id_name $emergency_caller_id_number = $extension $directory_full_name = $_.cn $directory_visible = "true" $directory_exten_visible = "true" $limit_max = "1" $limit_destination = "error/user_busy" $missed_call_app = "" $missed_call_data = "" $user_context = "172.18.253.1" $toll_allow = "domestic,international,local" $call_timeout = "30" $call_group = "" $call_screen_enabled = "false" $user_record = "" $hold_music = "local_stream://default" $auth_acl = "" $cidr = "" $sip_force_contact = "" $nibble_account = "" $sip_force_expires = "3600" $mwi_account = "" $sip_bypass_media = "" $unique_id = "" $dial_string = "" $dial_user = "" $dial_domain = "" $do_not_disturb = "" $forward_all_destination = "" $forward_all_enabled = "" $forward_busy_destination = "" $forward_busy_enabled = "" $forward_no_answer_destination = "" $forward_no_answer_enabled = "" $follow_me_uuid = "" $enabled = "true" $description = $_.sn + " " + $_.initials $forward_caller_id_uuid = "" $absolute_codec_string = "" $forward_user_not_registered_destination = "" $forward_user_not_registered_enabled = "" $force_ping = "" $csv="$extension_uuid;$domain_uuid;$extension;$number_alias;$password;$accountcode;$effective_caller_id_name;$effective_caller_id_number;$outbound_caller_id_name;$outbound_caller_id_number;$emergency_caller_id_name;$emergency_caller_id_number;$directory_full_name;$directory_visible;$directory_exten_visible;$limit_max;$limit_destination;$missed_call_app;$missed_call_data;$user_context;`"$toll_allow`";$call_timeout;$call_group;$call_screen_enabled;$user_record;$hold_music;$auth_acl;$cidr;$sip_force_contact;$nibble_account;$sip_force_expires;$mwi_account;$sip_bypass_media;$unique_id;$dial_string;$dial_user;$dial_domain;$do_not_disturb;$forward_all_destination;$forward_all_enabled;$forward_busy_destination;$forward_busy_enabled;$forward_no_answer_destination;$forward_no_answer_enabled;$follow_me_uuid;$enabled;$description;$forward_caller_id_uuid;$absolute_codec_string;$forward_user_not_registered_destination;$forward_user_not_registered_enabled;`"$force_ping`"`r`n" [System.IO.File]::AppendAllText("d:\v_extensions.csv", $csv, $Utf8NoBomEncoding) $voicemail_uuid = (New-Guid).Tostring() $voicemail_id = $extension $voicemail_password = $extension $greeting_id $voicemail_alternate_greet_id $voicemail_mail_to = "" $voicemail_sms_to $voicemail_attach_file $voicemail_file = "" $voicemail_local_after_email = "true" $voicemail_enabled = "false" $voicemail_description = $description $voicemail_name_base64 [System.IO.File]::AppendAllText("d:\v_voicemails.csv", "$domain_uuid;$voicemail_uuid;$voicemail_id;$voicemail_password;$greeting_id;$voicemail_alternate_greet_id;$voicemail_mail_to;$voicemail_sms_to;$voicemail_attach_file;$voicemail_file;$voicemail_local_after_email;$voicemail_enabled;$voicemail_description;$voicemail_name_base64`r`n", $Utf8NoBomEncoding)}}
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [System.IO.File]::AppendAllText("d:\v_destinations.csv", "domain_uuid;destination_uuid;dialplan_uuid;fax_uuid;destination_type;destination_number;destination_number_regex;destination_caller_id_name;destination_caller_id_number;destination_cid_name_prefix;destination_context;destination_app;destination_data;destination_enabled;destination_description;destination_accountcode`r`n", $Utf8NoBomEncoding) [System.IO.File]::AppendAllText("d:\v_dialplans.csv", "domain_uuid;dialplan_uuid;app_uuid;dialplan_context;dialplan_name;dialplan_number;dialplan_continue;dialplan_order;dialplan_enabled;dialplan_description`r`n", $Utf8NoBomEncoding) [System.IO.File]::AppendAllText("d:\v_dialplan_details.csv", "domain_uuid;dialplan_uuid;dialplan_detail_uuid;dialplan_detail_tag;dialplan_detail_type;dialplan_detail_data;dialplan_detail_break;dialplan_detail_inline;dialplan_detail_group;dialplan_detail_order`r`n", $Utf8NoBomEncoding) $nums="1111=5555555;1112=5555566" $nums.Split(";")|%{ $innum = $_.Split("=")[0] $outnum = $_.Split("=")[1] $domain_uuid = "ffffffff-ffff-ffff-ffff-ffffffffffff" ## !!! $destination_uuid = (New-Guid).Tostring() $dialplan_uuid = (New-Guid).Tostring() $fax_uuid $destination_type = "inbound" $destination_number = "343$outnum" $destination_number_regex = "^(343$outnum)$" $destination_caller_id_name $destination_caller_id_number $destination_cid_name_prefix $destination_context = "public" $destination_app $destination_data $destination_enabled = "true" $destination_description = "$outnum-$innum" $destination_accountcode [System.IO.File]::AppendAllText("d:\v_destinations.csv", "$domain_uuid;$destination_uuid;$dialplan_uuid;$fax_uuid;$destination_type;$destination_number;$destination_number_regex;$destination_caller_id_name;$destination_caller_id_number;$destination_cid_name_prefix;$destination_context;$destination_app;$destination_data;$destination_enabled;$destination_description;$destination_accountcode`r`n", $Utf8NoBomEncoding) $app_uuid = "ffffffff-ffff-ffff-ffff-ffffffffffff" ## !!! $dialplan_context = "public" $dialplan_name = $destination_number $dialplan_number = $destination_number $dialplan_continue = "false" $dialplan_order = "100" $dialplan_enabled = "true" $dialplan_description = $destination_description [System.IO.File]::AppendAllText("d:\v_dialplans.csv", "$domain_uuid;$dialplan_uuid;$app_uuid;$dialplan_context;$dialplan_name;$dialplan_number;$dialplan_continue;$dialplan_order;$dialplan_enabled;$dialplan_description`r`n", $Utf8NoBomEncoding) $dialplan_detail_break $dialplan_detail_inline $dialplan_detail_group $dialplan_detail_uuid = (New-Guid).Tostring() $dialplan_detail_tag = "condition" $dialplan_detail_type = "destination_number" $dialplan_detail_data = "^(343$outnum)$" $dialplan_detail_order = 20 [System.IO.File]::AppendAllText("d:\v_dialplan_details.csv", "$domain_uuid;$dialplan_uuid;$dialplan_detail_uuid;$dialplan_detail_tag;$dialplan_detail_type;$dialplan_detail_data;$dialplan_detail_break;$dialplan_detail_inline;$dialplan_detail_group;$dialplan_detail_order`r`n", $Utf8NoBomEncoding) $dialplan_detail_uuid = (New-Guid).Tostring() $dialplan_detail_tag = "action" $dialplan_detail_type = "transfer" $dialplan_detail_data = "$innum XML 172.18.253.1" $dialplan_detail_order = 30 [System.IO.File]::AppendAllText("d:\v_dialplan_details.csv", "$domain_uuid;$dialplan_uuid;$dialplan_detail_uuid;$dialplan_detail_tag;$dialplan_detail_type;$dialplan_detail_data;$dialplan_detail_break;$dialplan_detail_inline;$dialplan_detail_group;$dialplan_detail_order`r`n", $Utf8NoBomEncoding) }
Gateway : 172.16.253.3
Username : 3435555555
Password : not-used
From User : 3435555555
From Domain : 172.16.253.3
Proxy : 172.16.253.3
Register : False
Caller ID In From : True
Note!The FusionPBX documentation explicitly states that when making settings, fields in bold text are required.ACL Setup
However, for some unknown reason, I did not see the fat content of the Proxy field and did not give it any meaning. As a result, I received working incoming external calls, but not working outgoing calls. Thesofia status gateway ffffffff-ffff-ffff-ffff-ffffffffffff
did not show any configuration anomalies and even showed the assigned value of the proxy field corresponding to the value of the Gateway . Exactly the same output of the command with exactly the same settings was demonstrated by the “bare” FreeSWITCH in the previous installation, and at the same time it allowed to make outgoing calls to the outside without any problems.
FusionPBX earned only after explicitly specifying the value of Proxy .
*ffffffff-ffff-ffff-ffff-ffffffffffff
- gateway UUID
Important!
ACLs are for networks and domains of providers only.
Your own networks and domains in them should not be .
The domains list should be deny by default.
The rules themselves must be resolving and the provider’s gateway IP address with the / 32 mask must be entered in them, you do not need to fill in the domain field.
Type : allow
CIDR : 172.16.253.3/32
Domain :
Description : default SIP-trunk
default_areacode : 343
default_language : ru
default_dialect : RU
default_voice : elena
ringback : $${ru-ring}
transfer_ringback : $${ru-ring}
IP Address Sectionexternal_rtp_ip : 172.16.160.154
external_sip_ip : 172.16.160.154
SIP Profile Section : Internalinternal_auth_calls : true
As a matter of fact, it is this variable, in the true value, that is responsible for reading the settings of the subscriber number and transferring the values $ {outbound_caller_id_number} and $ {outbound_caller_id_name} from it . For this variable to be effective, it is necessary that the authorization of internal subscriber numbers via ACL is disabled. By default, out of the box, this is done as follows: ACL authorization is absent, Digest is used instead (by subscriber number and password): internal_auth_calls : true
.Important!Outbound routes
In order to correctly identify direct city numbers assigned to the internal in the settings through the fields Outbound Caller ID Name and Outbound Caller ID Number , three conditions must be met:
- No ACL authorization of internal subscribers
- Included Digest authorization in SIP profile settings:
internal_auth_calls : true
- Presence in the gateway settings:
Caller ID In From : True
^(\d{7})$
(dialing a direct city 7-digit number without any prefixes in the form of zeros, nines, etc.).^(8343\d{7})$
(dialing a 7-digit urban number with the prefix 8343).^(89\d{9})$
(a call to a cell with a prefix of 8, which is the de facto standard)^(8\d{10})$
(long-distance call, also familiar: 8, code of the settlement, subscriber number)^(810\d+)$
(standard prefix 810, then country code, area code, subscriber number).effective_caller_id_name= ${default_areacode} ${outbound_caller_id_name}
effective_caller_id_number= ${default_areacode} ${outbound_caller_id_number}
so that the caller number transmitted to the operator includes the area code.aggressive-nat-detection
.aggressive-nat-detection
Value : true
Enabled : False
Russification of voice responseSource: https://habr.com/ru/post/353156/
All Articles