├── .gitattributes
├── .gitignore
├── CONTRIBUTING.md
├── app
├── commands
│ └── .gitkeep
├── config
│ ├── .view.php.swp
│ ├── app.php
│ ├── auth.php
│ ├── cache.php
│ ├── compile.php
│ ├── local
│ │ ├── app.php
│ │ └── database.php
│ ├── mail.php
│ ├── packages
│ │ └── .gitkeep
│ ├── queue.php
│ ├── remote.php
│ ├── services.php
│ ├── session.php
│ ├── testing
│ │ ├── cache.php
│ │ └── session.php
│ ├── view.php
│ └── workbench.php
├── controllers
│ ├── .gitkeep
│ ├── BaseController.php
│ ├── DialerController.php
│ ├── HomeController.php
│ ├── ReportsController.php
│ ├── Settings
│ │ ├── AsteriskController.php
│ │ ├── CallerIDController.php
│ │ └── SettingsController.php
│ └── UsersController.php
├── database
│ ├── migrations
│ │ ├── .gitkeep
│ │ └── create_migrations_rev1.php
│ ├── production.sqlite
│ └── seeds
│ │ ├── .gitkeep
│ │ └── DatabaseSeeder.php
├── filters.php
├── lang
│ └── en
│ │ ├── pagination.php
│ │ ├── reminders.php
│ │ └── validation.php
├── models
│ ├── Asterisk.balde.php
│ ├── CallerIDs.php
│ └── User.php
├── routes.php
├── start
│ ├── artisan.php
│ ├── global.php
│ └── local.php
├── storage
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── debugbar
│ │ └── .gitignore
│ ├── logs
│ │ └── .gitignore
│ ├── meta
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
├── tests
│ ├── ExampleTest.php
│ └── TestCase.php
└── views
│ ├── admin_nav.blade.php
│ ├── dialer
│ ├── index.blade.php
│ └── session.blade.php
│ ├── emails
│ └── auth
│ │ └── reminder.blade.php
│ ├── hello.php
│ ├── home.blade.php
│ ├── index.blade.php
│ ├── layout.blade.php
│ ├── login.blade.php
│ ├── register.blade.php
│ ├── reports
│ └── index.blade.php
│ └── settings
│ ├── asterisk.blade.php
│ ├── asterisk_edit.blade.php
│ ├── caller_id.blade.php
│ ├── caller_id_edit.blade.php
│ ├── system.blade.php
│ └── system_edit.blade.php
├── artisan
├── bootstrap
├── autoload.php
├── paths.php
└── start.php
├── composer.json
├── phpunit.xml
├── public
├── .htaccess
├── favicon.ico
├── img
│ ├── stardust.png
│ └── stardust_@2X.png
├── index.php
├── js
│ └── charts.js
├── packages
│ └── .gitkeep
└── robots.txt
├── readme.md
├── scripts
├── caller.php
└── sleep.php
└── server.php
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea
2 | /bootstrap/compiled.php
3 | /vendor
4 | composer.phar
5 | composer.lock
6 | .env.*.php
7 | *.swp
8 | .env.php
9 | .DS_Store
10 | Thumbs.db
11 | /app/config/database.php
12 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribution Guidelines
2 |
3 | Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository!
4 |
--------------------------------------------------------------------------------
/app/commands/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/commands/.gitkeep
--------------------------------------------------------------------------------
/app/config/.view.php.swp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/config/.view.php.swp
--------------------------------------------------------------------------------
/app/config/app.php:
--------------------------------------------------------------------------------
1 | false,
17 | //'debug' => true,
18 |
19 | /*
20 | |--------------------------------------------------------------------------
21 | | Application URL
22 | |--------------------------------------------------------------------------
23 | |
24 | | This URL is used by the console to properly generate URLs when using
25 | | the Artisan command line tool. You should set this to the root of
26 | | your application so that it is used when running Artisan tasks.
27 | |
28 | */
29 |
30 | 'url' => 'http://localhost',
31 |
32 | /*
33 | |--------------------------------------------------------------------------
34 | | Application Timezone
35 | |--------------------------------------------------------------------------
36 | |
37 | | Here you may specify the default timezone for your application, which
38 | | will be used by the PHP date and date-time functions. We have gone
39 | | ahead and set this to a sensible default for you out of the box.
40 | |
41 | */
42 |
43 | 'timezone' => 'UTC',
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | Application Locale Configuration
48 | |--------------------------------------------------------------------------
49 | |
50 | | The application locale determines the default locale that will be used
51 | | by the translation service provider. You are free to set this value
52 | | to any of the locales which will be supported by the application.
53 | |
54 | */
55 |
56 | 'locale' => 'en',
57 |
58 | /*
59 | |--------------------------------------------------------------------------
60 | | Application Fallback Locale
61 | |--------------------------------------------------------------------------
62 | |
63 | | The fallback locale determines the locale to use when the current one
64 | | is not available. You may change the value to correspond to any of
65 | | the language folders that are provided through your application.
66 | |
67 | */
68 |
69 | 'fallback_locale' => 'en',
70 |
71 | /*
72 | |--------------------------------------------------------------------------
73 | | Encryption Key
74 | |--------------------------------------------------------------------------
75 | |
76 | | This key is used by the Illuminate encrypter service and should be set
77 | | to a random, 32 character string, otherwise these encrypted strings
78 | | will not be safe. Please do this before deploying an application!
79 | |
80 | */
81 |
82 | 'key' => '5Lov7Cvn1S4xlgHSSKi0zbtjBKzbnrko',
83 |
84 | 'cipher' => MCRYPT_RIJNDAEL_128,
85 |
86 | /*
87 | |--------------------------------------------------------------------------
88 | | Autoloaded Service Providers
89 | |--------------------------------------------------------------------------
90 | |
91 | | The service providers listed here will be automatically loaded on the
92 | | request to your application. Feel free to add your own services to
93 | | this array to grant expanded functionality to your applications.
94 | |
95 | */
96 |
97 | 'providers' => array(
98 |
99 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider',
100 | 'Illuminate\Auth\AuthServiceProvider',
101 | 'Illuminate\Cache\CacheServiceProvider',
102 | 'Illuminate\Session\CommandsServiceProvider',
103 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
104 | 'Illuminate\Routing\ControllerServiceProvider',
105 | 'Illuminate\Cookie\CookieServiceProvider',
106 | 'Illuminate\Database\DatabaseServiceProvider',
107 | 'Illuminate\Encryption\EncryptionServiceProvider',
108 | 'Illuminate\Filesystem\FilesystemServiceProvider',
109 | 'Illuminate\Hashing\HashServiceProvider',
110 | 'Illuminate\Html\HtmlServiceProvider',
111 | 'Illuminate\Log\LogServiceProvider',
112 | 'Illuminate\Mail\MailServiceProvider',
113 | 'Illuminate\Database\MigrationServiceProvider',
114 | 'Illuminate\Pagination\PaginationServiceProvider',
115 | 'Illuminate\Queue\QueueServiceProvider',
116 | 'Illuminate\Redis\RedisServiceProvider',
117 | 'Illuminate\Remote\RemoteServiceProvider',
118 | 'Illuminate\Auth\Reminders\ReminderServiceProvider',
119 | 'Illuminate\Database\SeedServiceProvider',
120 | 'Illuminate\Session\SessionServiceProvider',
121 | 'Illuminate\Translation\TranslationServiceProvider',
122 | 'Illuminate\Validation\ValidationServiceProvider',
123 | 'Illuminate\View\ViewServiceProvider',
124 | 'Illuminate\Workbench\WorkbenchServiceProvider',
125 | 'Barryvdh\Debugbar\ServiceProvider',
126 |
127 | ),
128 |
129 | /*
130 | |--------------------------------------------------------------------------
131 | | Service Provider Manifest
132 | |--------------------------------------------------------------------------
133 | |
134 | | The service provider manifest is used by Laravel to lazy load service
135 | | providers which are not needed for each request, as well to keep a
136 | | list of all of the services. Here, you may set its storage spot.
137 | |
138 | */
139 |
140 | 'manifest' => storage_path().'/meta',
141 |
142 | /*
143 | |--------------------------------------------------------------------------
144 | | Class Aliases
145 | |--------------------------------------------------------------------------
146 | |
147 | | This array of class aliases will be registered when this application
148 | | is started. However, feel free to register as many as you wish as
149 | | the aliases are "lazy" loaded so they don't hinder performance.
150 | |
151 | */
152 |
153 | 'aliases' => array(
154 |
155 | 'App' => 'Illuminate\Support\Facades\App',
156 | 'Artisan' => 'Illuminate\Support\Facades\Artisan',
157 | 'Auth' => 'Illuminate\Support\Facades\Auth',
158 | 'Blade' => 'Illuminate\Support\Facades\Blade',
159 | 'Cache' => 'Illuminate\Support\Facades\Cache',
160 | 'ClassLoader' => 'Illuminate\Support\ClassLoader',
161 | 'Config' => 'Illuminate\Support\Facades\Config',
162 | 'Controller' => 'Illuminate\Routing\Controller',
163 | 'Cookie' => 'Illuminate\Support\Facades\Cookie',
164 | 'Crypt' => 'Illuminate\Support\Facades\Crypt',
165 | 'DB' => 'Illuminate\Support\Facades\DB',
166 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model',
167 | 'Event' => 'Illuminate\Support\Facades\Event',
168 | 'File' => 'Illuminate\Support\Facades\File',
169 | 'Form' => 'Illuminate\Support\Facades\Form',
170 | 'Hash' => 'Illuminate\Support\Facades\Hash',
171 | 'HTML' => 'Illuminate\Support\Facades\HTML',
172 | 'Input' => 'Illuminate\Support\Facades\Input',
173 | 'Lang' => 'Illuminate\Support\Facades\Lang',
174 | 'Log' => 'Illuminate\Support\Facades\Log',
175 | 'Mail' => 'Illuminate\Support\Facades\Mail',
176 | 'Paginator' => 'Illuminate\Support\Facades\Paginator',
177 | 'Password' => 'Illuminate\Support\Facades\Password',
178 | 'Queue' => 'Illuminate\Support\Facades\Queue',
179 | 'Redirect' => 'Illuminate\Support\Facades\Redirect',
180 | 'Redis' => 'Illuminate\Support\Facades\Redis',
181 | 'Request' => 'Illuminate\Support\Facades\Request',
182 | 'Response' => 'Illuminate\Support\Facades\Response',
183 | 'Route' => 'Illuminate\Support\Facades\Route',
184 | 'Schema' => 'Illuminate\Support\Facades\Schema',
185 | 'Seeder' => 'Illuminate\Database\Seeder',
186 | 'Session' => 'Illuminate\Support\Facades\Session',
187 | 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait',
188 | 'SSH' => 'Illuminate\Support\Facades\SSH',
189 | 'Str' => 'Illuminate\Support\Str',
190 | 'URL' => 'Illuminate\Support\Facades\URL',
191 | 'Validator' => 'Illuminate\Support\Facades\Validator',
192 | 'View' => 'Illuminate\Support\Facades\View',
193 | 'Debugbar' => 'Barryvdh\Debugbar\Facade',
194 |
195 | ),
196 |
197 | );
198 |
--------------------------------------------------------------------------------
/app/config/auth.php:
--------------------------------------------------------------------------------
1 | 'eloquent',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Authentication Model
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "Eloquent" authentication driver, we need to know which
26 | | Eloquent model should be used to retrieve your users. Of course, it
27 | | is often just the "User" model but you may use whatever you like.
28 | |
29 | */
30 |
31 | 'model' => 'User',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Authentication Table
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "Database" authentication driver, we need to know which
39 | | table should be used to retrieve your users. We have chosen a basic
40 | | default value but you may easily change it to any table you like.
41 | |
42 | */
43 |
44 | 'table' => 'users',
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Password Reminder Settings
49 | |--------------------------------------------------------------------------
50 | |
51 | | Here you may set the settings for password reminders, including a view
52 | | that should be used as your password reminder e-mail. You will also
53 | | be able to set the name of the table that holds the reset tokens.
54 | |
55 | | The "expire" time is the number of minutes that the reminder should be
56 | | considered valid. This security feature keeps tokens short-lived so
57 | | they have less time to be guessed. You may change this as needed.
58 | |
59 | */
60 |
61 | 'reminder' => array(
62 |
63 | 'email' => 'emails.auth.reminder',
64 |
65 | 'table' => 'password_reminders',
66 |
67 | 'expire' => 60,
68 |
69 | ),
70 |
71 | );
72 |
--------------------------------------------------------------------------------
/app/config/cache.php:
--------------------------------------------------------------------------------
1 | 'file',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | File Cache Location
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "file" cache driver, we need a location where the cache
26 | | files may be stored. A sensible default has been specified, but you
27 | | are free to change it to any other place on disk that you desire.
28 | |
29 | */
30 |
31 | 'path' => storage_path().'/cache',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Database Cache Connection
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "database" cache driver you may specify the connection
39 | | that should be used to store the cached items. When this option is
40 | | null the default database connection will be utilized for cache.
41 | |
42 | */
43 |
44 | 'connection' => null,
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Database Cache Table
49 | |--------------------------------------------------------------------------
50 | |
51 | | When using the "database" cache driver we need to know the table that
52 | | should be used to store the cached items. A default table name has
53 | | been provided but you're free to change it however you deem fit.
54 | |
55 | */
56 |
57 | 'table' => 'cache',
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | Memcached Servers
62 | |--------------------------------------------------------------------------
63 | |
64 | | Now you may specify an array of your Memcached servers that should be
65 | | used when utilizing the Memcached cache driver. All of the servers
66 | | should contain a value for "host", "port", and "weight" options.
67 | |
68 | */
69 |
70 | 'memcached' => array(
71 |
72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
73 |
74 | ),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Cache Key Prefix
79 | |--------------------------------------------------------------------------
80 | |
81 | | When utilizing a RAM based store such as APC or Memcached, there might
82 | | be other applications utilizing the same cache. So, we'll specify a
83 | | value to get prefixed to all our keys so we can avoid collisions.
84 | |
85 | */
86 |
87 | 'prefix' => 'laravel',
88 |
89 | );
90 |
--------------------------------------------------------------------------------
/app/config/compile.php:
--------------------------------------------------------------------------------
1 | true,
17 |
18 | );
19 |
--------------------------------------------------------------------------------
/app/config/local/database.php:
--------------------------------------------------------------------------------
1 | array(
22 |
23 | 'mysql' => array(
24 | 'driver' => 'mysql',
25 | 'host' => 'localhost',
26 | 'database' => 'ting',
27 | 'username' => 'homestead',
28 | 'password' => 'secret',
29 | 'charset' => 'utf8',
30 | 'collation' => 'utf8_unicode_ci',
31 | 'prefix' => '',
32 | ),
33 |
34 | 'pgsql' => array(
35 | 'driver' => 'pgsql',
36 | 'host' => 'localhost',
37 | 'database' => 'homestead',
38 | 'username' => 'homestead',
39 | 'password' => 'secret',
40 | 'charset' => 'utf8',
41 | 'prefix' => '',
42 | 'schema' => 'public',
43 | ),
44 |
45 | ),
46 |
47 | );
48 |
--------------------------------------------------------------------------------
/app/config/mail.php:
--------------------------------------------------------------------------------
1 | 'smtp',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | SMTP Host Address
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may provide the host address of the SMTP server used by your
26 | | applications. A default option is provided that is compatible with
27 | | the Mailgun mail service which will provide reliable deliveries.
28 | |
29 | */
30 |
31 | 'host' => 'smtp.mailgun.org',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | SMTP Host Port
36 | |--------------------------------------------------------------------------
37 | |
38 | | This is the SMTP port used by your application to deliver e-mails to
39 | | users of the application. Like the host we have set this value to
40 | | stay compatible with the Mailgun e-mail application by default.
41 | |
42 | */
43 |
44 | 'port' => 587,
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Global "From" Address
49 | |--------------------------------------------------------------------------
50 | |
51 | | You may wish for all e-mails sent by your application to be sent from
52 | | the same address. Here, you may specify a name and address that is
53 | | used globally for all e-mails that are sent by your application.
54 | |
55 | */
56 |
57 | 'from' => array('address' => null, 'name' => null),
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | E-Mail Encryption Protocol
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the encryption protocol that should be used when
65 | | the application send e-mail messages. A sensible default using the
66 | | transport layer security protocol should provide great security.
67 | |
68 | */
69 |
70 | 'encryption' => 'tls',
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | SMTP Server Username
75 | |--------------------------------------------------------------------------
76 | |
77 | | If your SMTP server requires a username for authentication, you should
78 | | set it here. This will get used to authenticate with your server on
79 | | connection. You may also set the "password" value below this one.
80 | |
81 | */
82 |
83 | 'username' => null,
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | SMTP Server Password
88 | |--------------------------------------------------------------------------
89 | |
90 | | Here you may set the password required by your SMTP server to send out
91 | | messages from your application. This will be given to the server on
92 | | connection so that the application will be able to send messages.
93 | |
94 | */
95 |
96 | 'password' => null,
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Sendmail System Path
101 | |--------------------------------------------------------------------------
102 | |
103 | | When using the "sendmail" driver to send e-mails, we will need to know
104 | | the path to where Sendmail lives on this server. A default path has
105 | | been provided here, which will work well on most of your systems.
106 | |
107 | */
108 |
109 | 'sendmail' => '/usr/sbin/sendmail -bs',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Mail "Pretend"
114 | |--------------------------------------------------------------------------
115 | |
116 | | When this option is enabled, e-mail will not actually be sent over the
117 | | web and will instead be written to your application's logs files so
118 | | you may inspect the message. This is great for local development.
119 | |
120 | */
121 |
122 | 'pretend' => false,
123 |
124 | );
125 |
--------------------------------------------------------------------------------
/app/config/packages/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/config/packages/.gitkeep
--------------------------------------------------------------------------------
/app/config/queue.php:
--------------------------------------------------------------------------------
1 | 'sync',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => array(
32 |
33 | 'sync' => array(
34 | 'driver' => 'sync',
35 | ),
36 |
37 | 'beanstalkd' => array(
38 | 'driver' => 'beanstalkd',
39 | 'host' => 'localhost',
40 | 'queue' => 'default',
41 | 'ttr' => 60,
42 | ),
43 |
44 | 'sqs' => array(
45 | 'driver' => 'sqs',
46 | 'key' => 'your-public-key',
47 | 'secret' => 'your-secret-key',
48 | 'queue' => 'your-queue-url',
49 | 'region' => 'us-east-1',
50 | ),
51 |
52 | 'iron' => array(
53 | 'driver' => 'iron',
54 | 'host' => 'mq-aws-us-east-1.iron.io',
55 | 'token' => 'your-token',
56 | 'project' => 'your-project-id',
57 | 'queue' => 'your-queue-name',
58 | 'encrypt' => true,
59 | ),
60 |
61 | 'redis' => array(
62 | 'driver' => 'redis',
63 | 'queue' => 'default',
64 | ),
65 |
66 | ),
67 |
68 | /*
69 | |--------------------------------------------------------------------------
70 | | Failed Queue Jobs
71 | |--------------------------------------------------------------------------
72 | |
73 | | These options configure the behavior of failed queue job logging so you
74 | | can control which database and table are used to store the jobs that
75 | | have failed. You may change them to any database / table you wish.
76 | |
77 | */
78 |
79 | 'failed' => array(
80 |
81 | 'database' => 'mysql', 'table' => 'failed_jobs',
82 |
83 | ),
84 |
85 | );
86 |
--------------------------------------------------------------------------------
/app/config/remote.php:
--------------------------------------------------------------------------------
1 | 'production',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Remote Server Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | These are the servers that will be accessible via the SSH task runner
24 | | facilities of Laravel. This feature radically simplifies executing
25 | | tasks on your servers, such as deploying out these applications.
26 | |
27 | */
28 |
29 | 'connections' => array(
30 |
31 | 'production' => array(
32 | 'host' => '',
33 | 'username' => '',
34 | 'password' => '',
35 | 'key' => '',
36 | 'keyphrase' => '',
37 | 'root' => '/var/www',
38 | ),
39 |
40 | ),
41 |
42 | /*
43 | |--------------------------------------------------------------------------
44 | | Remote Server Groups
45 | |--------------------------------------------------------------------------
46 | |
47 | | Here you may list connections under a single group name, which allows
48 | | you to easily access all of the servers at once using a short name
49 | | that is extremely easy to remember, such as "web" or "database".
50 | |
51 | */
52 |
53 | 'groups' => array(
54 |
55 | 'web' => array('production')
56 |
57 | ),
58 |
59 | );
60 |
--------------------------------------------------------------------------------
/app/config/services.php:
--------------------------------------------------------------------------------
1 | array(
18 | 'domain' => '',
19 | 'secret' => '',
20 | ),
21 |
22 | 'mandrill' => array(
23 | 'secret' => '',
24 | ),
25 |
26 | 'stripe' => array(
27 | 'model' => 'User',
28 | 'secret' => '',
29 | ),
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/app/config/session.php:
--------------------------------------------------------------------------------
1 | 'file',
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Session Lifetime
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify the number of minutes that you wish the session
27 | | to be allowed to remain idle before it expires. If you want them
28 | | to immediately expire on the browser closing, set that option.
29 | |
30 | */
31 |
32 | 'lifetime' => 120,
33 |
34 | 'expire_on_close' => false,
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Session File Location
39 | |--------------------------------------------------------------------------
40 | |
41 | | When using the native session driver, we need a location where session
42 | | files may be stored. A default has been set for you but a different
43 | | location may be specified. This is only needed for file sessions.
44 | |
45 | */
46 |
47 | 'files' => storage_path().'/sessions',
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Session Database Connection
52 | |--------------------------------------------------------------------------
53 | |
54 | | When using the "database" or "redis" session drivers, you may specify a
55 | | connection that should be used to manage these sessions. This should
56 | | correspond to a connection in your database configuration options.
57 | |
58 | */
59 |
60 | 'connection' => null,
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Session Database Table
65 | |--------------------------------------------------------------------------
66 | |
67 | | When using the "database" session driver, you may specify the table we
68 | | should use to manage the sessions. Of course, a sensible default is
69 | | provided for you; however, you are free to change this as needed.
70 | |
71 | */
72 |
73 | 'table' => 'sessions',
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Session Sweeping Lottery
78 | |--------------------------------------------------------------------------
79 | |
80 | | Some session drivers must manually sweep their storage location to get
81 | | rid of old sessions from storage. Here are the chances that it will
82 | | happen on a given request. By default, the odds are 2 out of 100.
83 | |
84 | */
85 |
86 | 'lottery' => array(2, 100),
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Session Cookie Name
91 | |--------------------------------------------------------------------------
92 | |
93 | | Here you may change the name of the cookie used to identify a session
94 | | instance by ID. The name specified here will get used every time a
95 | | new session cookie is created by the framework for every driver.
96 | |
97 | */
98 |
99 | 'cookie' => 'laravel_session',
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Cookie Path
104 | |--------------------------------------------------------------------------
105 | |
106 | | The session cookie path determines the path for which the cookie will
107 | | be regarded as available. Typically, this will be the root path of
108 | | your application but you are free to change this when necessary.
109 | |
110 | */
111 |
112 | 'path' => '/',
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Domain
117 | |--------------------------------------------------------------------------
118 | |
119 | | Here you may change the domain of the cookie used to identify a session
120 | | in your application. This will determine which domains the cookie is
121 | | available to in your application. A sensible default has been set.
122 | |
123 | */
124 |
125 | 'domain' => null,
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | HTTPS Only Cookies
130 | |--------------------------------------------------------------------------
131 | |
132 | | By setting this option to true, session cookies will only be sent back
133 | | to the server if the browser has a HTTPS connection. This will keep
134 | | the cookie from being sent to you if it can not be done securely.
135 | |
136 | */
137 |
138 | 'secure' => false,
139 |
140 | );
141 |
--------------------------------------------------------------------------------
/app/config/testing/cache.php:
--------------------------------------------------------------------------------
1 | 'array',
19 |
20 | );
21 |
--------------------------------------------------------------------------------
/app/config/testing/session.php:
--------------------------------------------------------------------------------
1 | 'array',
20 |
21 | );
22 |
--------------------------------------------------------------------------------
/app/config/view.php:
--------------------------------------------------------------------------------
1 | array(__DIR__.'/../views'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Pagination View
21 | |--------------------------------------------------------------------------
22 | |
23 | | This view will be used to render the pagination link output, and can
24 | | be easily customized here to show any view you like. A clean view
25 | | compatible with Twitter's Bootstrap is given to you by default.
26 | |
27 | */
28 |
29 | 'pagination' => 'pagination::slider-3',
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/app/config/workbench.php:
--------------------------------------------------------------------------------
1 | '',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Workbench Author E-Mail Address
21 | |--------------------------------------------------------------------------
22 | |
23 | | Like the option above, your e-mail address is used when generating new
24 | | workbench packages. The e-mail is placed in your composer.json file
25 | | automatically after the package is created by the workbench tool.
26 | |
27 | */
28 |
29 | 'email' => '',
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/app/controllers/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/controllers/.gitkeep
--------------------------------------------------------------------------------
/app/controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | layout))
13 | {
14 | $this->layout = View::make($this->layout);
15 | }
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/app/controllers/DialerController.php:
--------------------------------------------------------------------------------
1 | orderBy('id','desc')->paginate(50);
13 |
14 | $caller_ids = array('' => 'Select a Caller ID') +
15 | DB::table('caller_ids')->lists('full_number', 'id');
16 |
17 | return View::make('dialer.index')
18 | ->with([
19 | 'dialing_sessions' => $dialing_sessions,
20 | 'caller_ids' => $caller_ids,
21 | ]);
22 | }
23 |
24 |
25 | /**
26 | * Show the form for creating a new resource.
27 | *
28 | * @return Response
29 | */
30 | public function session_create()
31 | {
32 | // validate the info, create rules for the inputs
33 | $rules = array(
34 | 'caller_id_id' => 'required|numeric',
35 | 'area_code' => 'required|numeric|min:3',
36 | 'prefix' => 'required|numeric|min:3',
37 | 'starting' => 'required|numeric|min:4',
38 | 'ending' => 'required|numeric|min:4'
39 | );
40 |
41 | // run the validation rules on the inputs from the form
42 | $validator = Validator::make(Input::all(), $rules);
43 | // if the validator fails, redirect back to the form
44 | if ($validator->fails()) {
45 | return Redirect::to('/dialer')
46 | ->withErrors($validator)
47 | ->withInput(Input::except('password'));
48 | } else {
49 |
50 | // create session in database
51 | $caller_id_id = Input::get('caller_id_id');
52 | $area_code = Input::get('area_code');
53 | $prefix = Input::get('prefix');
54 | $starting = Input::get('starting');
55 | $ending = Input::get('ending');
56 |
57 | if ($starting > $ending) {
58 | Session::flash('message', 'Starting number ('.$starting.') cannot be greater than Ending number ('.$ending .')');
59 | return Redirect::to('/dialer');
60 | }
61 |
62 | $session_id = DB::table('dialing_sessions')->insertGetId(
63 | array(
64 | 'caller_id_id' => $caller_id_id,
65 | 'area_code' => $area_code,
66 | 'prefix' => $prefix,
67 | 'starting' => $starting,
68 | 'ending' => $ending,
69 | 'status' => 'Incomplete',
70 | 'created_by_id' => Auth::user()->id,
71 | 'updated_by_id' => Auth::user()->id
72 | )
73 | );
74 |
75 | // insert each number in database
76 | $phone_numbers = [];
77 | $number = $starting;
78 | $counter = 0;
79 | for ($i = $starting; $i <= $ending; $i++) {
80 |
81 |
82 | $phone_number = array(
83 | 'area_code' => $area_code,
84 | 'prefix' => $prefix,
85 | 'number' => $number,
86 | 'status' => 'Queued',
87 | 'session_id' => $session_id
88 | );
89 |
90 | array_push($phone_numbers, $phone_number);
91 |
92 | //echo $number."
";
93 | $number++;
94 | $counter++;
95 | }
96 |
97 | DB::table('phone_numbers')->insert($phone_numbers);
98 |
99 | DB::table('dialing_sessions')->where('id',$session_id)->update(['total' => $counter]);
100 |
101 | // return to dialers page
102 | Session::flash('message', 'Dialing Session has started. Session ID: '. $session_id);
103 | return Redirect::to('/dialer');
104 |
105 | }
106 |
107 | }
108 |
109 | public function getSession($id)
110 | {
111 | //
112 | $call_session = DB::table('dialing_sessions')->find($id);
113 | $phone_numbers = DB::table('phone_numbers')->where('session_id',$id)->get();
114 |
115 | return View::make('dialer.session')
116 | ->with([
117 | 'call_session' => $call_session,
118 | 'phone_numbers' => $phone_numbers,
119 | ]);
120 |
121 | }
122 |
123 | public function update_status()
124 | {
125 |
126 | $numbers = DB::table('phone_numbers')->where('status','!=','Completed')->get();
127 |
128 | $path = "/var/spool/asterisk/outgoing_done/";
129 | ////echo "path: $path
";
130 |
131 | foreach( $numbers as $key => $value ) {
132 |
133 | $phone_number = $value->area_code.$value->prefix.$value->number;
134 | $file = $path.$phone_number."-SID".$value->session_id.".call";
135 | ////echo "phone_number: $phone_number
";
136 | ////echo "file: $file
";
137 |
138 | //check if exists in outgoing_done
139 | if (file_exists($file)) {
140 |
141 | //open file and search for status line
142 | $lines = file($file);
143 |
144 | foreach ($lines as $line_num => $line) {
145 | $file_lines = explode(": ", $line);
146 |
147 | if (count($file_lines) > 1) {
148 |
149 | if ($file_lines[0] == "Status") {
150 | $phone_number = DB::table('phone_numbers')
151 | ->where('id',$value->id)
152 | ->update(['status' => trim($file_lines[1])])
153 | ;
154 |
155 | $cmd = "sudo rm -Rf $file";
156 | //exec($cmd. " > /dev/null &");
157 |
158 | }
159 |
160 | } else {
161 | //echo " - not empty - ";
162 | }
163 |
164 | }
165 |
166 |
167 | //read actual status and save to database
168 |
169 | } else {
170 |
171 | //echo $file ."- doesnt exists
";
172 |
173 | }
174 | }
175 |
176 | // update sessions status count
177 |
178 | $dialing_sessions = DB::table('dialing_sessions')
179 | ->where('status','!=','Completed')
180 | ->get()
181 | ;
182 |
183 | //echo "updating session status
";
184 | foreach($dialing_sessions as $key => $value) {
185 | $id = $value->id;
186 | //echo "session id: $id
";
187 |
188 | //echo "updating status count
";
189 | $this->update_status_count($value->id,'Completed','completed');
190 | $this->update_status_count($value->id,'Queued','queued');
191 | $this->update_status_count($value->id,'Call File Generated','calling');
192 | $this->update_status_count($value->id,'Expired','expired');
193 | $this->update_status_count($value->id,'Failed','failed');
194 |
195 | //check if all numbers in dial session are completed... then mark session completed.
196 | $phone_numbers_count = DB::table('phone_numbers')
197 | ->where('session_id',$value->id)
198 | ->where(function ($query) {
199 | $query->where('status','=','Call File Created')
200 | ->orWhere('status','=','Queued');
201 | })
202 | ->count()
203 | ;
204 | //echo $phone_numbers_count ."
";
205 |
206 | if ($phone_numbers_count == 0) {
207 | DB::table('dialing_sessions')->where('id',$value->id)->update(['status' => 'Completed']);
208 | } else {
209 | //echo "not completed: ". $phone_numbers_count ."
";
210 | }
211 | }
212 |
213 | return Redirect::to('dialer');
214 |
215 | }
216 |
217 | public function session_update_status1($id)
218 | {
219 | $numbers = DB::table('phone_numbers')->where('session_id',$id)->get();
220 |
221 | $path = "/var/spool/asterisk/outgoing_done/";
222 |
223 | //var_dump($numbers);
224 |
225 | //loop through each number
226 | foreach( $numbers as $key => $value ) {
227 |
228 | $phone_number = $value->area_code.$value->prefix.$value->number;
229 | $file = $path.$phone_number."-SID".$id.".call";
230 |
231 | //check if exists in outgoing_done
232 | if (file_exists($file)) {
233 |
234 | //open file and search for status line
235 | $lines = file($file);
236 |
237 | foreach ($lines as $line_num => $line) {
238 | $file_lines = explode(": ", $line);
239 |
240 | if (count($file_lines) > 1) {
241 |
242 | if ($file_lines[0] == "Status") {
243 | $phone_number = DB::table('phone_numbers')
244 | ->where('id',$value->id)
245 | ->update(['status' => $file_lines[1]])
246 | ;
247 |
248 | $cmd = "sudo rm -Rf $file";
249 | exec($cmd. " > /dev/null &");
250 |
251 | }
252 |
253 | } else {
254 | //echo " - not empty - ";
255 | }
256 |
257 | }
258 |
259 |
260 | //read actual status and save to database
261 |
262 | } else {
263 |
264 | //echo $file ."- doesnt exists
";
265 |
266 | }
267 | }
268 |
269 | //check if all numbers in dial session are completed... then mark session completed.
270 | $phone_numbers_count = DB::table('phone_numbers')
271 | ->where('session_id',$id)
272 | ->where('status','=','Call File Created')
273 | ->count()
274 | ;
275 | //echo $phone_numbers_count ."
";
276 |
277 | if ($phone_numbers_count == 0) {
278 | DB::table('dialing_sessions')->where('id',$id)->update(['status' => 'Completed']);
279 | }
280 |
281 | $call_session = DB::table('dialing_sessions')->find($id);
282 | $phone_numbers = DB::table('phone_numbers')->where('session_id',$id)->get();
283 |
284 | return View::make('dialer.session')
285 | ->with([
286 | 'call_session' => $call_session,
287 | 'phone_numbers' => $phone_numbers,
288 | ]);
289 |
290 | }
291 |
292 |
293 | protected function generate_call_files($session_id,$phone_number,$caller_id)
294 | {
295 | $asterisk = DB::table('asterisk')->where('name','MaxRetries')->first();
296 | $max_retries = $asterisk->value;
297 | $asterisk = DB::table('asterisk')->where('name','RetryTime')->first();
298 | $retry_time = $asterisk->value;
299 | $asterisk = DB::table('asterisk')->where('name','WaitTime')->first();
300 | $wait_time = $asterisk->value;
301 |
302 | $file_path = "/tmp/".$phone_number."-SID".$session_id.".call";
303 | $handle = fopen($file_path,"w");
304 |
305 | $contents = "Channel: SIP/" . $phone_number . "@AlcazarNetDialer\n".
306 | "Callerid: ".$caller_id."\n".
307 | "MaxRetries: $max_retries\n".
308 | "RetryTime: $retry_time\n".
309 | "WaitTime: $wait_time\n".
310 | "Application: hangup\n".
311 | "Archive: Yes\n";
312 |
313 | fwrite($handle,$contents);
314 |
315 | fclose($handle);
316 |
317 | echo $file_path."
";
318 | exec("mv $file_path /var/spool/asterisk/outgoing");
319 | }
320 |
321 | protected function update_status_count($session_id,$phone_status,$session_status)
322 | {
323 |
324 | //echo "updating status count: $session_id - $phone_status
";
325 | $calls = DB::table('phone_numbers')
326 | ->select('session_id',DB::raw('COUNT(*) as count'))
327 | ->where('session_id',$session_id)
328 | ->where('status',$phone_status)
329 | ->get()
330 | ;
331 |
332 | if ($calls) {
333 | foreach ($calls as $key => $value) {
334 | DB::table('dialing_sessions')->where('id',$session_id)->update(
335 | [$session_status => $value->count]
336 | );
337 | }
338 | } else {
339 |
340 | DB::table('dialing_sessions')->where('id',$session_id)->update(
341 | [$session_status => 0]
342 | );
343 |
344 | }
345 |
346 | return;
347 | }
348 |
349 | }
350 |
--------------------------------------------------------------------------------
/app/controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | orderBy('id','asc')->get();
8 |
9 | return View::make('settings.asterisk')
10 | ->with(['asterisk' => $asterisk]);
11 | }
12 |
13 | public function create()
14 | {
15 | // validate the info, create rules for the inputs
16 | $rules = array(
17 | 'name' => 'required',
18 | 'value' => 'required',
19 | );
20 |
21 | // run the validation rules on the inputs from the form
22 | $validator = Validator::make(Input::all(), $rules);
23 | // if the validator fails, redirect back to the form
24 | if ($validator->fails()) {
25 | return Redirect::to('/system/asterisk')
26 | ->withErrors($validator)
27 | ->withInput(Input::except('password'));
28 | } else {
29 |
30 | // create session in database
31 | $name = Input::get('name');
32 | $value = Input::get('value');
33 |
34 | $asterisk = DB::table('asterisk')->insertGetId(
35 | array(
36 | 'name' => $name,
37 | 'value' => $value,
38 | 'created_by_id' => Auth::user()->id
39 | )
40 | );
41 | }
42 |
43 | Session::flash('message', 'Asterisk setting was added.');
44 | return Redirect::to('/settings/asterisk');
45 |
46 | }
47 |
48 | public function edit($id)
49 | {
50 | $asterisk = DB::table('asterisk')->where('id',$id)->first();
51 |
52 | return View::make('settings.asterisk_edit')
53 | ->with(['asterisk' => $asterisk]);
54 | }
55 |
56 | public function update($id)
57 | {
58 | // validate the info, create rules for the inputs
59 | $rules = array(
60 | 'name' => 'required',
61 | 'value' => 'required',
62 | );
63 |
64 | // run the validation rules on the inputs from the form
65 | $validator = Validator::make(Input::all(), $rules);
66 | // if the validator fails, redirect back to the form
67 | if ($validator->fails()) {
68 | return Redirect::to('/system/asterisk/'.$id.'/edit')
69 | ->withErrors($validator)
70 | ->withInput(Input::except('password'));
71 | } else {
72 |
73 | // create session in database
74 | $name = Input::get('name');
75 | $value = Input::get('value');
76 |
77 | $asterisk = DB::table('asterisk')->where('id',$id);
78 | $asterisk->update(
79 | array(
80 | 'name' => $name,
81 | 'value' => $value,
82 | 'updated_by_id' => Auth::user()->id
83 | )
84 | );
85 | }
86 |
87 | Session::flash('message', 'Asterisk Setting was updated.');
88 | return Redirect::to('/settings/asterisk');
89 |
90 | }
91 |
92 | public function delete($id)
93 | {
94 | $asterisk = Asterisk::find($id);
95 | $asterisk->delete();
96 |
97 | Session::flash('message', 'Asterisk Setting was deleted.');
98 | return Redirect::to('/settings/asterisk');
99 | }
100 |
101 |
102 | }
103 |
--------------------------------------------------------------------------------
/app/controllers/Settings/CallerIDController.php:
--------------------------------------------------------------------------------
1 | orderBy('id','desc')->get();
8 |
9 | return View::make('settings.caller_id')
10 | ->with(['caller_ids' => $caller_ids]);
11 | }
12 |
13 | public function postCreate()
14 | {
15 | // validate the info, create rules for the inputs
16 | $rules = array(
17 | 'area_code' => 'required|numeric|min:3',
18 | 'prefix' => 'required|numeric|min:3',
19 | 'number' => 'required|numeric|min:4',
20 | );
21 |
22 | // run the validation rules on the inputs from the form
23 | $validator = Validator::make(Input::all(), $rules);
24 | // if the validator fails, redirect back to the form
25 | if ($validator->fails()) {
26 | return Redirect::to('/system/caller_id')
27 | ->withErrors($validator)
28 | ->withInput(Input::except('password'));
29 | } else {
30 |
31 | // create session in database
32 | $area_code = Input::get('area_code');
33 | $prefix = Input::get('prefix');
34 | $number = Input::get('number');
35 |
36 | $caller_id = DB::table('caller_ids')->insertGetId(
37 | array(
38 | 'area_code' => $area_code,
39 | 'prefix' => $prefix,
40 | 'number' => $number,
41 | 'full_number' => $area_code.$prefix.$number,
42 | 'status' => 'Not Used',
43 | 'created_by_id' => Auth::user()->id
44 | )
45 | );
46 | }
47 |
48 | Session::flash('message', 'Caller ID was added.');
49 | return Redirect::to('/settings/caller_id');
50 |
51 | }
52 |
53 | public function edit($id)
54 | {
55 | $caller_id = CallerID::find($id);
56 |
57 | return View::make('settings.caller_id_edit')
58 | ->with(['caller_id' => $caller_id]);
59 | }
60 |
61 | public function update($id)
62 | {
63 | // validate the info, create rules for the inputs
64 | $rules = array(
65 | 'area_code' => 'required|numeric|min:3',
66 | 'prefix' => 'required|numeric|min:3',
67 | 'number' => 'required|numeric|min:4',
68 | );
69 |
70 | // run the validation rules on the inputs from the form
71 | $validator = Validator::make(Input::all(), $rules);
72 | // if the validator fails, redirect back to the form
73 | if ($validator->fails()) {
74 | return Redirect::to('/system/caller_id/'.$id.'/edit')
75 | ->withErrors($validator)
76 | ->withInput(Input::except('password'));
77 | } else {
78 |
79 | // create session in database
80 | $area_code = Input::get('area_code');
81 | $prefix = Input::get('prefix');
82 | $number = Input::get('number');
83 |
84 | $caller_id = CallerID::find($id);
85 | $caller_id->update(
86 | array(
87 | 'area_code' => $area_code,
88 | 'prefix' => $prefix,
89 | 'number' => $number,
90 | 'full_number' => $area_code . $prefix . $number,
91 | 'status' => 'Not Used',
92 | 'updated_by_id' => Auth::user()->id
93 | )
94 | );
95 | }
96 |
97 | Session::flash('message', 'Caller ID was updated.');
98 | return Redirect::to('/settings/caller_id');
99 |
100 | }
101 |
102 | public function delete($id)
103 | {
104 | $caller_id = CallerID::find($id);
105 | $caller_id->delete();
106 |
107 | Session::flash('message', 'Caller ID was deleted.');
108 | return Redirect::to('/settings/caller_id');
109 | }
110 |
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/app/controllers/Settings/SettingsController.php:
--------------------------------------------------------------------------------
1 | orderBy('id','desc')->get();
13 |
14 | return View::make('dialer.index')
15 | ->with(['dialing_sessions' => $dialing_sessions]);
16 | }
17 |
18 | public function getSystem()
19 | {
20 | $settings = DB::table('settings')->orderBy('id','desc')->get();
21 |
22 | return View::make('settings.system')
23 | ->with(['settings' => $settings]);
24 | }
25 |
26 | public function settings_system_edit($id)
27 | {
28 | $setting = DB::table('settings')->find($id);
29 |
30 | return View::make('settings.system_edit')
31 | ->with(['setting' => $setting]);
32 | }
33 |
34 |
35 |
36 | /**
37 | * Show the form for creating a new resource.
38 | *
39 | * @return Response
40 | */
41 | public function session_create()
42 | {
43 | // validate the info, create rules for the inputs
44 | $rules = array(
45 | 'caller_id' => 'required|numeric|min:3',
46 | 'area_code' => 'required|numeric|min:3',
47 | 'prefix' => 'required|numeric|min:3',
48 | 'starting' => 'required|numeric|min:4',
49 | 'ending' => 'required|numeric|min:4'
50 | );
51 |
52 | // run the validation rules on the inputs from the form
53 | $validator = Validator::make(Input::all(), $rules);
54 | // if the validator fails, redirect back to the form
55 | if ($validator->fails()) {
56 | return Redirect::to('/dialer')
57 | ->withErrors($validator)
58 | ->withInput(Input::except('password'));
59 | } else {
60 |
61 | // create session in database
62 | $caller_id = Input::get('caller_id');
63 | $area_code = Input::get('area_code');
64 | $prefix = Input::get('prefix');
65 | $starting = Input::get('starting');
66 | $ending = Input::get('ending');
67 |
68 | $session_id = DB::table('dialing_sessions')->insertGetId(
69 | array(
70 | 'caller_id' => Input::get('caller_id'),
71 | 'area_code' => Input::get('area_code'),
72 | 'prefix' => Input::get('prefix'),
73 | 'starting' => $starting,
74 | 'ending' => $ending,
75 | 'status' => 'Incomplete',
76 | 'created_by_id' => Auth::user()->id,
77 | 'updated_by_id' => Auth::user()->id
78 | )
79 | );
80 |
81 | // insert each number in database
82 | $phone_numbers = [];
83 | $number = $starting;
84 | for ($i = $starting; $i <= $ending; $i++) {
85 |
86 |
87 | $phone_number = array(
88 | 'area_code' => $area_code,
89 | 'prefix' => $prefix,
90 | 'number' => $number,
91 | 'status' => 'Not Called',
92 | 'session_id' => $session_id
93 | );
94 |
95 | array_push($phone_numbers, $phone_number);
96 |
97 | //echo $number."
";
98 | $number++;
99 | }
100 |
101 | DB::table('phone_numbers')->insert($phone_numbers);
102 |
103 |
104 | $not_called_count = DB::table('phone_numbers')
105 | ->where('session_id',$session_id)
106 | ->where('status','Not Called')
107 | ->count();
108 |
109 |
110 | while ($not_called_count != 0 ) {
111 |
112 | echo $not_called_count."
";
113 |
114 | $phone_number = DB::table('phone_numbers')
115 | ->where('session_id',$session_id)
116 | ->where('status','Not Called')
117 | ->orderBy(DB::raw('RAND()'))
118 | //->take(1)
119 | ->first();
120 | ;
121 | echo $phone_number->number ."
";
122 |
123 | $call_number = $phone_number->area_code.$phone_number->prefix.$phone_number->number;
124 |
125 | $this->generate_call_files($call_number);
126 |
127 | DB::table('phone_numbers')
128 | ->where('id',$phone_number->id)
129 | ->update(['Status' => 'Call File Created']);
130 |
131 | $not_called_count = DB::table('phone_numbers')
132 | ->where('session_id',$session_id)
133 | ->where('status','Not Called')
134 | ->count()
135 | ;
136 |
137 | }
138 |
139 |
140 | // return to dialers page
141 | Session::flash('message', 'Dialing Session has started. Session ID: '. $session_id);
142 | //return Redirect::to('/dialer');
143 |
144 | }
145 |
146 | }
147 |
148 |
149 | /**
150 | * Store a newly created resource in storage.
151 | *
152 | * @return Response
153 | */
154 | public function store()
155 | {
156 | //
157 | }
158 |
159 |
160 | /**
161 | * Display the specified resource.
162 | *
163 | * @param int $id
164 | * @return Response
165 | */
166 | public function show($id)
167 | {
168 | //
169 | }
170 |
171 | public function getSession($id)
172 | {
173 | //
174 | $call_session = DB::table('dialing_sessions')->find($id);
175 | $phone_numbers = DB::table('phone_numbers')->where('session_id',$id)->get();
176 |
177 | return View::make('dialer.session')
178 | ->with([
179 | 'call_session' => $call_session,
180 | 'phone_numbers' => $phone_numbers,
181 | ]);
182 |
183 |
184 | }
185 |
186 |
187 |
188 | /**
189 | * Show the form for editing the specified resource.
190 | *
191 | * @param int $id
192 | * @return Response
193 | */
194 | public function edit($id)
195 | {
196 | //
197 | }
198 |
199 |
200 | /**
201 | * Update the specified resource in storage.
202 | *
203 | * @param int $id
204 | * @return Response
205 | */
206 | public function update($id)
207 | {
208 | //
209 | }
210 |
211 |
212 | /**
213 | * Remove the specified resource from storage.
214 | *
215 | * @param int $id
216 | * @return Response
217 | */
218 | public function destroy($id)
219 | {
220 | //
221 | }
222 |
223 | protected function generate_call_files($phone_number)
224 | {
225 | $file_path = "/tmp/".$phone_number.".call";
226 | $handle = fopen($file_path,"w");
227 |
228 | $contents = "Channel: SIP/" . $phone_number . "@vitel-outbound
229 | Callerid: 7861234567
230 | MaxRetries: 5
231 | RetryTime: 600
232 | WaitTime: 15
233 | Application: hangup
234 | Archive: yes
235 | ";
236 |
237 | fwrite($handle,$contents);
238 |
239 | fclose($handle);
240 |
241 | echo $file_path."
";
242 | exec("mv $file_path /var/spool/asterisk/outgoing2");
243 | }
244 |
245 | }
246 |
--------------------------------------------------------------------------------
/app/controllers/UsersController.php:
--------------------------------------------------------------------------------
1 | 'required',
34 | 'email' => 'required|email',
35 | 'username' => 'required',
36 | 'password' => 'required|confirmed'
37 | ];
38 |
39 | $validator = Validator::make(Input::all(), $rules);
40 |
41 | if ($validator->fails())
42 | {
43 | return Redirect::to('register')->withInput()->withErrors($validator);
44 | }
45 | else
46 | {
47 | DB::table('users')->insert(
48 | array(
49 | 'first_name' => Input::get('first_name'),
50 | 'last_name' => Input::get('last_name'),
51 | 'email' => Input::get('email'),
52 | 'username' => Input::get('username'),
53 | 'password' => Hash::make(Input::get('password')),
54 | )
55 | );
56 | }
57 |
58 | return Redirect::to('/login');
59 | }
60 |
61 |
62 | /**
63 | * Store a newly created resource in storage.
64 | *
65 | * @return Response
66 | */
67 | public function store()
68 | {
69 | //
70 | }
71 |
72 |
73 | /**
74 | * Display the specified resource.
75 | *
76 | * @param int $id
77 | * @return Response
78 | */
79 | public function show($id)
80 | {
81 | //
82 | }
83 |
84 |
85 | /**
86 | * Show the form for editing the specified resource.
87 | *
88 | * @param int $id
89 | * @return Response
90 | */
91 | public function edit($id)
92 | {
93 | //
94 | }
95 |
96 |
97 | /**
98 | * Update the specified resource in storage.
99 | *
100 | * @param int $id
101 | * @return Response
102 | */
103 | public function update($id)
104 | {
105 | //
106 | }
107 |
108 |
109 | /**
110 | * Remove the specified resource from storage.
111 | *
112 | * @param int $id
113 | * @return Response
114 | */
115 | public function destroy($id)
116 | {
117 | //
118 | }
119 |
120 | public function getLogin() {
121 | return View::make('login');
122 | }
123 |
124 | public function postLogin()
125 | {
126 | // validate the info, create rules for the inputs
127 | $rules = array(
128 | 'username' => 'required',
129 | 'password' => 'required|alphaNum|min:3'
130 | );
131 | // run the validation rules on the inputs from the form
132 | $validator = Validator::make(Input::all(), $rules);
133 | // if the validator fails, redirect back to the form
134 | if ($validator->fails()) {
135 | return Redirect::to('login')
136 | ->withErrors($validator)
137 | ->withInput(Input::except('password'));
138 | } else {
139 | // create our user data for the authentication
140 | $userdata = array(
141 | 'username' => Input::get('username'),
142 | 'password' => Input::get('password')
143 | );
144 | // attempt to do the login
145 | if (Auth::attempt($userdata)) {
146 | // validation successful!
147 | return Redirect::intended('/home');
148 | } else {
149 | // validation not successful, send back to form
150 | return Redirect::to('login');
151 | }
152 | }
153 | }
154 | public function doLogout()
155 | {
156 | Auth::logout(); // log the user out of our application
157 | return Redirect::to('login'); // redirect the user to the login screen
158 | }
159 |
160 |
161 | }
162 |
--------------------------------------------------------------------------------
/app/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/database/migrations/.gitkeep
--------------------------------------------------------------------------------
/app/database/migrations/create_migrations_rev1.php:
--------------------------------------------------------------------------------
1 | increments("id");
18 | $table->string('name');
19 | $table->string("username");
20 | $table->string("password");
21 | $table->string("email");
22 | $table->string('address_1')->nullable();
23 | $table->string('address_2')->nullable();
24 | $table->string('city')->nullable();
25 | $table->string('state')->nullable();
26 | $table->string('zip')->nullable();
27 | $table->string('phone')->nullable();
28 | $table->string('fax')->nullable();
29 | $table->string("remember_token")->nullable();
30 | $table->boolean('active')->default('1');
31 | $table->timestamps();
32 | });
33 |
34 | Schema::create('token', function(Blueprint $table)
35 | {
36 | $table->string('email')->index();
37 | $table->string('token')->index();
38 | $table->timestamp('created_at');
39 | });
40 | }
41 |
42 | /**
43 | * Reverse the migrations.
44 | *
45 | * @return void
46 | */
47 | public function down()
48 | {
49 | Schema::table('users', function(Blueprint $table)
50 | {
51 | //
52 | });
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/app/database/production.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/database/production.sqlite
--------------------------------------------------------------------------------
/app/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mazpe/tingaso/02d070449cbc71f6d39a756f4cfc48d30106cf0c/app/database/seeds/.gitkeep
--------------------------------------------------------------------------------
/app/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call('UserTableSeeder');
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/filters.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 |
18 | 'next' => 'Next »',
19 |
20 | );
21 |
--------------------------------------------------------------------------------
/app/lang/en/reminders.php:
--------------------------------------------------------------------------------
1 | "Passwords must be at least six characters and match the confirmation.",
17 |
18 | "user" => "We can't find a user with that e-mail address.",
19 |
20 | "token" => "This password reset token is invalid.",
21 |
22 | "sent" => "Password reminder sent!",
23 |
24 | );
25 |
--------------------------------------------------------------------------------
/app/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | "The :attribute must be accepted.",
17 | "active_url" => "The :attribute is not a valid URL.",
18 | "after" => "The :attribute must be a date after :date.",
19 | "alpha" => "The :attribute may only contain letters.",
20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
21 | "alpha_num" => "The :attribute may only contain letters and numbers.",
22 | "array" => "The :attribute must be an array.",
23 | "before" => "The :attribute must be a date before :date.",
24 | "between" => array(
25 | "numeric" => "The :attribute must be between :min and :max.",
26 | "file" => "The :attribute must be between :min and :max kilobytes.",
27 | "string" => "The :attribute must be between :min and :max characters.",
28 | "array" => "The :attribute must have between :min and :max items.",
29 | ),
30 | "confirmed" => "The :attribute confirmation does not match.",
31 | "date" => "The :attribute is not a valid date.",
32 | "date_format" => "The :attribute does not match the format :format.",
33 | "different" => "The :attribute and :other must be different.",
34 | "digits" => "The :attribute must be :digits digits.",
35 | "digits_between" => "The :attribute must be between :min and :max digits.",
36 | "email" => "The :attribute must be a valid email address.",
37 | "exists" => "The selected :attribute is invalid.",
38 | "image" => "The :attribute must be an image.",
39 | "in" => "The selected :attribute is invalid.",
40 | "integer" => "The :attribute must be an integer.",
41 | "ip" => "The :attribute must be a valid IP address.",
42 | "max" => array(
43 | "numeric" => "The :attribute may not be greater than :max.",
44 | "file" => "The :attribute may not be greater than :max kilobytes.",
45 | "string" => "The :attribute may not be greater than :max characters.",
46 | "array" => "The :attribute may not have more than :max items.",
47 | ),
48 | "mimes" => "The :attribute must be a file of type: :values.",
49 | "min" => array(
50 | "numeric" => "The :attribute must be at least :min.",
51 | "file" => "The :attribute must be at least :min kilobytes.",
52 | "string" => "The :attribute must be at least :min characters.",
53 | "array" => "The :attribute must have at least :min items.",
54 | ),
55 | "not_in" => "The selected :attribute is invalid.",
56 | "numeric" => "The :attribute must be a number.",
57 | "regex" => "The :attribute format is invalid.",
58 | "required" => "The :attribute field is required.",
59 | "required_if" => "The :attribute field is required when :other is :value.",
60 | "required_with" => "The :attribute field is required when :values is present.",
61 | "required_with_all" => "The :attribute field is required when :values is present.",
62 | "required_without" => "The :attribute field is required when :values is not present.",
63 | "required_without_all" => "The :attribute field is required when none of :values are present.",
64 | "same" => "The :attribute and :other must match.",
65 | "size" => array(
66 | "numeric" => "The :attribute must be :size.",
67 | "file" => "The :attribute must be :size kilobytes.",
68 | "string" => "The :attribute must be :size characters.",
69 | "array" => "The :attribute must contain :size items.",
70 | ),
71 | "unique" => "The :attribute has already been taken.",
72 | "url" => "The :attribute format is invalid.",
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Custom Validation Language Lines
77 | |--------------------------------------------------------------------------
78 | |
79 | | Here you may specify custom validation messages for attributes using the
80 | | convention "attribute.rule" to name the lines. This makes it quick to
81 | | specify a specific custom language line for a given attribute rule.
82 | |
83 | */
84 |
85 | 'custom' => array(
86 | 'attribute-name' => array(
87 | 'rule-name' => 'custom-message',
88 | ),
89 | ),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Custom Validation Attributes
94 | |--------------------------------------------------------------------------
95 | |
96 | | The following language lines are used to swap attribute place-holders
97 | | with something more reader friendly such as E-Mail Address instead
98 | | of "email". This simply helps us make messages a little cleaner.
99 | |
100 | */
101 |
102 | 'attributes' => array(),
103 |
104 | );
105 |
--------------------------------------------------------------------------------
/app/models/Asterisk.balde.php:
--------------------------------------------------------------------------------
1 | 'required'
6 | ];
7 | // Don't forget to fill this array
8 | //protected $fillable = [];
9 | protected $fillable = array('name', 'value', 'updated_by_id');
10 |
11 | }
--------------------------------------------------------------------------------
/app/models/CallerIDs.php:
--------------------------------------------------------------------------------
1 | 'required'
6 | ];
7 | // Don't forget to fill this array
8 | //protected $fillable = [];
9 | protected $fillable = array('area_code', 'prefix', 'number','status','full_number','updated_by_id');
10 |
11 | }
--------------------------------------------------------------------------------
/app/models/User.php:
--------------------------------------------------------------------------------
1 | 'auth' ], function() {
15 | //Route::get('/',function() {
16 | // return "Hello World";
17 | //});
18 |
19 | Route::get('/', 'HomeController@getHome');
20 | Route::get('/home', 'HomeController@getHome');
21 |
22 | Route::get('/reports', 'ReportsController@getReport');
23 |
24 | Route::get('/dialer/update_status','DialerController@update_status');
25 | Route::get('/dialer/session/{id}/update_status','DialerController@session_update_status');
26 | Route::post('/dialer/session/create','DialerController@session_create');
27 | Route::controller('dialer','DialerController');
28 |
29 |
30 | });
31 |
32 | Route::group(['prefix' => 'settings','before'=>'auth'], function(){
33 | Route::get('/caller_id', 'CallerIDController@getIndex');
34 | Route::post('/caller_id/create', 'CallerIDController@postCreate');
35 | Route::get('/caller_id/{id}/edit', 'CallerIDController@edit');
36 | Route::put('/caller_id/{id}/update',
37 | array('as' => 'caller_id.update',
38 | 'uses' => 'CallerIDController@update'));
39 | Route::get('/caller_id/{id}/delete', 'CallerIDController@delete');
40 |
41 | Route::get('/asterisk', 'AsteriskController@index');
42 | Route::post('/asterisk/create', 'AsteriskController@create');
43 | Route::get('/asterisk/{id}/edit', 'AsteriskController@edit');
44 | Route::put('/asterisk/{id}/update',
45 | array('as' => 'asterisk.update',
46 | 'uses' => 'AsteriskController@update'));
47 | Route::get('/asterisk/{id}/delete', 'AsteriskController@delete');
48 |
49 | Route::get('/settings/system/{id}/edit', 'SettingsController@settings_system_edit');
50 | //Route::controller('settings','SettingsController');
51 | });
52 |
53 |
54 | Route::get('/register','UsersController@getRegister');
55 | Route::post('/register','UsersController@create');
56 | Route::get('/login','UsersController@getLogin');
57 | Route::post('/login','UsersController@postLogin');
58 | Route::get('/logout',function() {
59 | Auth::logout();
60 | return Redirect::to('login');
61 | });
62 |
63 |
--------------------------------------------------------------------------------
/app/start/artisan.php:
--------------------------------------------------------------------------------
1 | client->request('GET', '/');
13 |
14 | $this->assertTrue($this->client->getResponse()->isOk());
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/tests/TestCase.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
41 | @show
42 |
--------------------------------------------------------------------------------
/app/views/dialer/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layout')
2 |
3 | @section('content')
4 |
5 |
6 |
Enter the area code, prefix, starting and ending range to create a dialing session
11 | 12 | {{ Form::open(array('url'=>'/dialer/session/create','class'=>'form-inline')) }} 13 | 14 |ID | 63 |Area/Prefix | 64 |Starting | 65 |Ending | 66 |Status | 67 |Total | 68 |Called | 69 |Completed | 70 |Queued | 71 |Calling | 72 |Expired | 73 |Failed | 74 |Created By | 75 |Created At | 76 |Action | 77 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ $c->id }} | 83 |{{ $c->area_code }}-{{ $c->prefix }} | 84 |{{ $c->starting }} | 85 |{{ $c->ending }} | 86 |{{ $c->status }} | 87 |{{ $c->total }} | 88 |{{ $c->completed + $c->expired + $c->failed }} | 89 |{{ $c->completed }} | 90 |{{ $c->queued }} | 91 |{{ $c->calling }} | 92 |{{ $c->expired }} | 93 |{{ $c->failed }} | 94 |{{ $c->created_by_id }} | 95 |{{ $c->created_at }} | 96 |97 | 98 | 99 | | 100 |
ID | 16 |Phone | 17 |Status | 18 |Created At | 19 |Updated At | 20 |Action | 21 |
---|---|---|---|---|---|
{{ $c->id }} | 27 |{{ $c->area_code }}-{{ $c->prefix }}-{{ $c->number }} | 28 |{{ $c->status }} | 29 |{{ $c->created_at }} | 30 |{{ $c->updated_at }} | 31 |32 | 33 | 34 | | 35 |
Dialers
9 |Trunks
17 |{{ Session::get('message') }}
49 | @endif 50 |Library of reports.
9 |Enter numbers to be added as caller ids and manage them.
10 | 11 | {{ Form::open(array('url'=>'/settings/asterisk/create','class'=>'form-inline')) }} 12 |ID | 39 |Name | 40 |Value | 41 |Created By | 42 |Updated By | 43 |Created At | 44 |Updated At | 45 |Action | 46 |
---|---|---|---|---|---|---|---|
{{ $c->id }} | 52 |{{ $c->name }} | 53 |{{ $c->value }} | 54 |{{ $c->created_by_id }} | 55 |{{ $c->updated_by_id }} | 56 |{{ $c->created_at }} | 57 |{{ $c->updated_at }} | 58 |59 | 60 | 61 | 62 | 63 | 64 | 65 | | 66 |
Enter numbers to be added as caller ids and manage them.
10 | 11 | {{ Form::open(array('url'=>'/settings/caller_id/create','class'=>'form-inline')) }} 12 |ID | 42 |Area | 43 |Prefix | 44 |Number | 45 |Status | 46 |Created By | 47 |Updated By | 48 |Created At | 49 |Updated At | 50 |Action | 51 |
---|---|---|---|---|---|---|---|---|---|
{{ $c->id }} | 57 |{{ $c->area_code }} | 58 |{{ $c->prefix }} | 59 |{{ $c->number }} | 60 |{{ $c->status }} | 61 |{{ $c->created_by_id }} | 62 |{{ $c->updated_by_id }} | 63 |{{ $c->created_at }} | 64 |{{ $c->updated_at }} | 65 |66 | 67 | 68 | 69 | 70 | 71 | 72 | | 73 |
Enter the area code, prefix, starting and ending range to create a dialing session
11 | 12 | {{ Form::open(array('url'=>'/dialer/session/create','class'=>'form-inline')) }} 13 | 14 |ID | 20 |Name | 21 |Value | 22 |Action | 23 |
---|---|---|---|
{{ $c->id }} | 29 |{{ $c->name }} | 30 |{{ $c->value }} | 31 |32 | 33 | 34 | 35 | 36 | | 37 |