command line tools

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

command line tools

Postby mcargile » Thu Jul 12, 2007 9:44 am

I want to make a command line tool for vicidial that you would allow an admin to do things remotely without needing a path to port 80 on the web server. Basically I want to be able to perform things like an emergency stop through ssh.

Something like:
Code: Select all
#> vicidial deactivate campaign 1001
Campaign 1001 has been deactivated.
#> vicidial activate campaign 1002
Campaign 1002 has been activated.
#> vicidial deactivate list 135
List 135 has been deactivated.
#> vicidial deactivate campaign all
All Campaigns have been deactivated!


In order to do so I was wondering if
Code: Select all
UPDATE vicidial_campaigns set active='N' where campaign_id='1001';
UPDATE vicidial_lists set active='N' where list_id='135';

would suffice.

Also was wondering if people had any other useful queries.
Last edited by mcargile on Mon Aug 20, 2007 11:26 am, edited 1 time in total.
Michael Cargile | Director of Engineering | ViciDialGroup | http://www.vicidial.com

The official source for VICIDIAL services and support. 1-888-894-VICI (8424)
mcargile
Site Admin
 
Posts: 617
Joined: Tue Jan 16, 2007 9:38 am

Postby mflorell » Mon Jul 16, 2007 8:18 am

Not sure about scripts to do that stuff, usually I just do it through mysql.

I've never had SSH access without port 80 access so I guess I'm not sure what I would need to do admin. Making sure you have a valid admin user/pass would be essential in an admin CLI script that you could do things like that though.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby aster1 » Mon Jul 16, 2007 2:30 pm

Why not use SSH tunnel instead? or just mysql command line ..
aster1
 
Posts: 281
Joined: Sun Dec 24, 2006 6:48 am
Location: India

Postby mcargile » Mon Aug 20, 2007 11:36 am

When speed is of the essence I think that sshing into a box and issue one or two commands in quick succession to get the desired effect is far faster than having to create an ssh tunnel, log into a web gui, click to a bunch of web links, change a few fields, click submit, etc.

As far as mysql is concerned I do not feel like typing a number of long queries to get the effect either.
Michael Cargile | Director of Engineering | ViciDialGroup | http://www.vicidial.com

The official source for VICIDIAL services and support. 1-888-894-VICI (8424)
mcargile
Site Admin
 
Posts: 617
Joined: Tue Jan 16, 2007 9:38 am

Postby mflorell » Wed Aug 22, 2007 9:13 am

Sounds fine to me, please post them to the tracker when they are done.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby mcargile » Wed Aug 22, 2007 11:12 am

At the rate things are going here might be a while.
Michael Cargile | Director of Engineering | ViciDialGroup | http://www.vicidial.com

The official source for VICIDIAL services and support. 1-888-894-VICI (8424)
mcargile
Site Admin
 
Posts: 617
Joined: Tue Jan 16, 2007 9:38 am

Postby artimus » Wed Nov 07, 2007 10:46 am

I was thinking of something similar to this but then scratched the thought as it seemed like to much to maintain.

If vici was rewritten so that everything could be controlled by an API, then it would be simple to do this. The web page, cli, and anything else would be simple to make and maintain. However, without an api it will probably just add to the code duplication.

I would very much like a cli however :)
Slackware 12 - Linux 2.6.21.5 SMP
Asterisk 1.2.19
Zaptel 1.2.19 (ztdummy) - libpri 1.2.5 - spandsp 0.0.3
IAX2 trunk to trixbox on the same LAN.
VICI / astguiclient 2.0.3
artimus
 
Posts: 38
Joined: Wed Sep 19, 2007 9:54 am

Postby mflorell » Wed Nov 07, 2007 11:04 am

The API is really just using MySQL to manipulate the database since everything is stored in the database.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby mcargile » Wed Nov 07, 2007 1:08 pm

The big thing is to create a database description so that it becomes easier to do thing like this in the future.

Some how I get the feeling this will be falling on my plate sometime in the new year.
Michael Cargile | Director of Engineering | ViciDialGroup | http://www.vicidial.com

The official source for VICIDIAL services and support. 1-888-894-VICI (8424)
mcargile
Site Admin
 
Posts: 617
Joined: Tue Jan 16, 2007 9:38 am

Postby mflorell » Wed Nov 07, 2007 1:19 pm

Thank you for volunteering Mike! :)
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Development

Who is online

Users browsing this forum: No registered users and 31 guests