summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2008-06-30 23:56:02 +0000
committerivan <ivan>2008-06-30 23:56:02 +0000
commitbb5907148eb298e2e509fa37e23dcbe63619db9d (patch)
tree4147cc1a52c33c1fb658615cf628ba319b873400 /FS/FS
parentfd9f3d8f951adbe9bf42827df0b326cfdc29b5d6 (diff)
add sip pw field
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Schema.pm9
-rw-r--r--FS/FS/part_export/phone_shellcommands.pm6
-rw-r--r--FS/FS/svc_phone.pm1
3 files changed, 10 insertions, 6 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 807be999e..34e31d82d 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2027,10 +2027,11 @@ sub tables_hashref {
'svc_phone' => {
'columns' => [
- 'svcnum', 'int', '', '', '', '',
- 'countrycode', 'varchar', '', 3, '', '',
- 'phonenum', 'varchar', '', 15, '', '', #12 ?
- 'pin', 'varchar', 'NULL', $char_d, '', '',
+ 'svcnum', 'int', '', '', '', '',
+ 'countrycode', 'varchar', '', 3, '', '',
+ 'phonenum', 'varchar', '', 15, '', '', #12 ?
+ 'pin', 'varchar', 'NULL', $char_d, '', '',
+ 'sip_password', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'svcnum',
'unique' => [],
diff --git a/FS/FS/part_export/phone_shellcommands.pm b/FS/FS/part_export/phone_shellcommands.pm
index e61af3d59..2edd69dc9 100644
--- a/FS/FS/part_export/phone_shellcommands.pm
+++ b/FS/FS/part_export/phone_shellcommands.pm
@@ -33,7 +33,7 @@ Run remote commands via SSH, for phone numbers. You will need to
<LI>
<INPUT TYPE="button" VALUE="FreePBX (build_exten CLI module needed)" onClick='
this.form.user.value = "root";
- this.form.useradd.value = "build_exten.php --create --exten $phonenum --name $cust_name --vm-password $pin && /usr/share/asterisk/bin/module_admin reload";
+ this.form.useradd.value = "build_exten.php --create --exten $phonenum --directdid 1$phonenum --sip-secret $sip_password --name $cust_name --vm-password $pin && /usr/share/asterisk/bin/module_admin reload";
this.form.userdel.value = "build_exten.php --delete --exten $phonenum && /usr/share/asterisk/bin/module_admin reload";
this.form.usermod.value = "";
this.form.suspend.value = "";
@@ -46,8 +46,9 @@ old_ for replace operations):
<UL>
<LI><code>$countrycode</code> - Country code
<LI><code>$phonenum</code> - Phone number
+ <LI><code>$sip_password</code> - SIP secret (quoted for the shell)
<LI><code>$pin</code> - Personal identification number
- <LI><code>$cust_name</code> - Customer name
+ <LI><code>$cust_name</code> - Customer name (quoted for the shell)
</UL>
END
);
@@ -88,6 +89,7 @@ sub _export_command {
my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
my $cust_name = $cust_pkg ? $cust_pkg->cust_main->name : '';
$cust_name = shell_quote $cust_name;
+ my $sip_password = shell_quote $svc_phone->sip_password;
#done setting variables for the command
$self->shellcommands_queue( $svc_phone->svcnum,
diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm
index 7622e9887..bd92ed84b 100644
--- a/FS/FS/svc_phone.pm
+++ b/FS/FS/svc_phone.pm
@@ -170,6 +170,7 @@ sub check {
$self->ut_numbern('svcnum')
|| $self->ut_numbern('countrycode')
|| $self->ut_number('phonenum')
+ || $self->ut_anythingn('sip_password')
|| $self->ut_numbern('pin')
;
return $error if $error;