]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add template for voipuser.org
authorBrian West <brian@freeswitch.org>
Tue, 11 Dec 2007 19:56:40 +0000 (19:56 +0000)
committerBrian West <brian@freeswitch.org>
Tue, 11 Dec 2007 19:56:40 +0000 (19:56 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6664 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/directory/default/voipuser.org.noload [new file with mode: 0644]
scripts/sipsetup

diff --git a/conf/directory/default/voipuser.org.noload b/conf/directory/default/voipuser.org.noload
new file mode 100644 (file)
index 0000000..c616384
--- /dev/null
@@ -0,0 +1,21 @@
+<!-- Working FWD dialup in and outbound -->
+
+<include>
+  <user id="%VUUSERNAME%">
+    <gateways>
+      <gateway name="sip.voipuser.org">
+       <param name="username" value="%VUUSERNAME%"/>
+       <param name="password" value="%VUPASSWORD%"/>
+       <param name="expire-seconds" value="600"/>
+       <param name="register" value="true"/>
+       <param name="retry_seconds" value="30"/>
+       <param name="extension" value="%VUEXTENSION%"/>
+       <param name="context" value="public"/>
+      </gateway>
+    </gateways>
+    <params>
+      <param name="password" value="%VUPASSWORD%"/>
+    </params>
+  </user>
+</include>
+
index 3e7c64a9d6d8a53688207411f6736180d017a9f5..cf3eb586f426f89c0d41fed0ec57e57c1c75ab7d 100755 (executable)
@@ -12,159 +12,169 @@ use File::Copy;
 my $PREFIX = "/usr/local/freeswitch";
 
 my $providers = {
-                "1" => "FWD",
-                "2" => "SP",
-                "3" => "IS",
-                "4" => "AL",
-                "5" => "SB"
-               };
+    "1" => "FWD",
+    "2" => "SP",
+    "3" => "IS",
+    "4" => "AL",
+    "5" => "SB",
+    "6" => "VU"
+    };
 
 
 my $FWD = {
-          "type" => "network",
-          "register" => "true",
-          "fields" => [number, password, extension],
-          "domain" => "pulver.com",
-          "dialprefix" => "1-393"
-         };
-
-my $SP = {
-         "type" => "network",
-         "register" => "true",
-         "fields" => [username, password, extension],
-         "domain" => "sipphone.com",
-         "dialprefix" => "1-747, 1-222"
-        };
-
-my $IS = {
-         "type" => "network",
-         "register" => "true",
-         "fields" => [username, password, extension],
-         "domain" => "ideasip.com",
-         "dialprefix" => "1-101"
-        };
-
-my $AL = {
-         "type" => "pstn",
-         "register" => "true",
-         "fields" => [username, password, extension],
-         "domain" => "asterlink.com",
-        };
-
-my $SB = {
-         "type" => "peer",
-         "domain" => "sipbroker.com",
-         "dialprefix" => "*XXX"
-        };
+    "type" => "network",
+    "register" => "true",
+    "fields" => [number, password, extension],
+    "domain" => "pulver.com",
+    "dialprefix" => "1-393"
+    };
+
+my $SIPHONE = {
+    "type" => "network",
+    "register" => "true",
+    "fields" => [username, password, extension],
+    "domain" => "sipphone.com",
+    "dialprefix" => "1-747, 1-222"
+    };
+
+my $IDEASIP = {
+    "type" => "network",
+    "register" => "true",
+    "fields" => [username, password, extension],
+    "domain" => "ideasip.com",
+    "dialprefix" => "1-101"
+    };
+
+my $VOIPUSER = {
+    "type" => "network",
+    "register" => "true",
+    "fields" => [username, password, extension],
+    "domain" => "voipuser.org"
+    };
+
+my $ASTERLINK = {
+    "type" => "pstn",
+    "register" => "true",
+    "fields" => [username, password, extension],
+    "domain" => "asterlink.com",
+};
+
+my $SIPBROKER = {
+    "type" => "peer",
+    "domain" => "sipbroker.com",
+    "dialprefix" => "*XXX"
+    };
 
 my $TEMPLATES = {
-                "FWD" => $FWD,
-                "SP" => $SP,
-                "IS" => $IS,
-                "AL" => $AL,
-                "SB" => $SB
-               };
+    "FWD" => $FWD,
+    "SP" => $SIPPHONE,
+    "IS" => $IDEASIP,
+    "AL" => $ASTERLINK,
+    "SB" => $SIPBROKER,
+    "VU" => $VOIPUSER
+    };
 
 print "\n" x 60;
 &welcome;
 
 sub welcome {
-  print <<WELCOME
+    print <<WELCOME
 
-  Welcome to the FreeSWITCH setup assistant.
+       Welcome to the FreeSWITCH setup assistant.
 
-  1. Configure Free World Dialup
-  2. Configure SIPPhone.com
-  3. Configure ideaSIP.com
-  4. Configure Asterlink.com
-  5. Configure SIPBroker.com
+       1. Configure Free World Dialup
+       2. Configure SIPPhone.com
+       3. Configure ideaSIP.com
+       4. Configure Asterlink.com
+       5. Configure SIPBroker.com
+       6. Configure voipuser.org
 
-  X. Exit
+       X. Exit
 
 WELCOME
-    ;
-  print "Which provider do you wish to setup? ";
-  my $i = <STDIN>;
-  chomp($i);
-  if ($i =~ m/X|x/) {
-    print "Thanks you!\n"; exit;
-  } elsif ($i > 5) {
-    print "Invalid Choice\n"; &welcome;
-  } else {
-    if (exists($providers->{$i})) {
-      configure_sip_provider($providers->{$i});
-    }
-  };
-  &welcome;
+;
+    print "Which provider do you wish to setup? ";
+    my $i = <STDIN>;
+    chomp($i);
+    if ($i =~ m/X|x/) {
+       print "Thanks you!\n"; exit;
+    } elsif ($i > 6) {
+       print "Invalid Choice\n"; &welcome;
+    } else {
+       if (exists($providers->{$i})) {
+           configure_sip_provider($providers->{$i});
+       }
+    };
+    &welcome;
 }
 
 sub configure_sip_provider($) {
-  my $provider = shift;
-  my $template = $TEMPLATES->{$provider};
-  my $config;
-  my $check = 1;
-  foreach $field (@{$template->{fields}}) {
-    print "\nPlease your $template->{domain} $field: ";
-    $tmp = "$provider" . uc($field);
-    $i = <STDIN>;
-    chomp($i);
-    $config->{$tmp} = $i;
-  }
-
-  while($check) {
-    $check = &are_you_sure;
-  };
-
-  if ($template->{type} eq "network" || $template->{type} eq "pstn") {
-    do_config($provider, $config);
-  }
-  if ($template->{dialprefix}) {
-    enable_extension($provider, $config);
-  }
-  print "\n\n\nConfiguration Complete!!!\n\n\n\n\n";
-  sleep(2);
-  &welcome;
+    my $provider = shift;
+    my $template = $TEMPLATES->{$provider};
+    my $config;
+    my $check = 1;
+    foreach $field (@{$template->{fields}}) {
+       print "\nPlease your $template->{domain} $field: ";
+       $tmp = "$provider" . uc($field);
+       $i = <STDIN>;
+       chomp($i);
+       $config->{$tmp} = $i;
+    }
+
+    while($check) {
+       $check = &are_you_sure;
+    };
+
+    if ($template->{type} eq "network" || $template->{type} eq "pstn") {
+       do_config($provider, $config);
+    }
+    if ($template->{dialprefix}) {
+       enable_extension($provider, $config);
+    }
+    print "\n\n\nConfiguration Complete!!!\n\n\n\n\n";
+    sleep(2);
+    &welcome;
 }
 
 sub enable_extension($$) {
-  my $provider = shift;
-  my $config = shift;
+    my $provider = shift;
+    my $config = shift;
 
-  my $todo = $TEMPLATES->{$provider};
+    my $todo = $TEMPLATES->{$provider};
 
-  copy("$PREFIX/conf/dialplan/extensions/$todo->{domain}.noload", "$PREFIX/conf/dialplan/extensions/$todo->{domain}.xml");
-  print "\nExtension prefix $todo->{dialprefix} enabled for dialing $todo->{domain}...\n";
+    copy("$PREFIX/conf/dialplan/extensions/$todo->{domain}.noload", "$PREFIX/conf/dialplan/extensions/$todo->{domain}.xml");
+    print "\nExtension prefix $todo->{dialprefix} enabled for dialing $todo->{domain}...\n";
 }
 
 sub do_config($$) {
-  my $provider = shift;
-  my $config = shift;
-  my $todo = $TEMPLATES->{$provider};
-
-  open(TEMPLATE, "<$PREFIX/conf/directory/default/$todo->{domain}.noload");
-  @lines = <TEMPLATE>;
-  close(TEMPLATE);
-  open(CONFIG, ">$PREFIX/conf/directory/default/$todo->{domain}.xml");
-  foreach $line (@lines) {
-    foreach $key (sort keys %{$config}) {
-      $line =~ s/%$key%/$config->{$key}/g;
+    my $provider = shift;
+    my $config = shift;
+    my $todo = $TEMPLATES->{$provider};
+
+    open(TEMPLATE, "<$PREFIX/conf/directory/default/$todo->{domain}.noload");
+    @lines = <TEMPLATE>;
+    close(TEMPLATE);
+    open(CONFIG, ">$PREFIX/conf/directory/default/$todo->{domain}.xml");
+    foreach $line (@lines) {
+       foreach $key (sort keys %{$config}) {
+           $line =~ s/%$key%/$config->{$key}/g;
+       }
+       print CONFIG $line;
     }
-    print CONFIG $line;
-  }
-  close(CONFIG);
-  print "Config Created...\n";
+    close(CONFIG);
+    print "Config Created...\n";
 }
 
 sub are_you_sure {
-  my $sure = 1;
-  while($sure) {
-    print "Are you sure? (yes/no)";
-    $i = <STDIN>;
-    chomp($i);
-    if($i =~ m/No|no|NO|n/) {
-      &welcome;
-    } elsif ($i =~ m/Yes|yes|YES|y/) {
-      return 0;
+    my $sure = 1;
+    while($sure) {
+       print "Are you sure? (yes/no)";
+       $i = <STDIN>;
+       chomp($i);
+       if($i =~ m/No|no|NO|n/) {
+           &welcome;
+       } elsif ($i =~ m/Yes|yes|YES|y/) {
+           return 0;
+       }
     }
-  }
 }