WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

[screen-users] automatically sending key to window

View: New views
3 Messages — Rating Filter:   Alert me  

[screen-users] automatically sending key to window

by 蔡文博 :: Rate this Message:

| View Threaded | Show Only this Message

Hello,

I am using screen to run sipp (a SIP testing tool).
Pressing "+" when sipp is running can increase call rate.
I want to increase the call rate every 10 minutes.
So I wonder if I can let screen to send a key to a window (which runs
sipp) automatically after each interval.

Appreciate if you can help, other solution is also welcome.

Regards,
Wenbo

_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users

Re: [screen-users] automatically sending key to window

by Gerald Young :: Rate this Message:

| View Threaded | Show Only this Message

On Monday 26 December 2011 1:30:10 am 蔡文博 wrote:

> Hello,
>
> I am using screen to run sipp (a SIP testing tool).
> Pressing "+" when sipp is running can increase call rate.
> I want to increase the call rate every 10 minutes.
> So I wonder if I can let screen to send a key to a window (which runs
> sipp) automatically after each interval.
>
> Appreciate if you can help, other solution is also welcome.
>
> Regards,
> Wenbo

Hello,

This is quite easy to do with Expect. Take for example the following script:
#!/usr/bin/expect -f

set sending 0
set CTRLA \001
set CTRLZ \032

spawn sipp -sn uac 127.0.0.1
interact {
        timeout 1 { if {$sending} { send "+" } }
        $CTRLA { set sending 1 }
        $CTRLZ { set sending 0 }
}

When executed, Expect will internally spawn SIPp using the embedded UAC
scenario. When Control+A is pressed, it will start sending a "+" to SIPp (ie.
increasing call rate) every second. Pressing Control+Z stops the sending
of "+" to SIPp. All other SIPp interactive commands work as usual.

You will probably want to edit the timeout value to 600 seconds (ie. 10
minutes) and edit the sipp command line with your own parameters.

Regards,
Gerald Young

_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users

Re: [screen-users] automatically sending key to window

by 蔡文博 :: Rate this Message:

| View Threaded | Show Only this Message

Hello,

I got the answer from google:
Use the -X option of screen to send command ("stuff" here), and use
the -p option to specify the window.

Hope this is helpful.

Regards,
Wenbo

On Mon, Dec 26, 2011 at 2:30 PM, 蔡文博 <bocaiwen@...> wrote:

> Hello,
>
> I am using screen to run sipp (a SIP testing tool).
> Pressing "+" when sipp is running can increase call rate.
> I want to increase the call rate every 10 minutes.
> So I wonder if I can let screen to send a key to a window (which runs
> sipp) automatically after each interval.
>
> Appreciate if you can help, other solution is also welcome.
>
> Regards,
> Wenbo

_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users