Juan,
Here is the output of sipp -m 1 -sn uac 127.0.0.1
As you can see, sipp runs perfectly in the foreground.
Warning: open file limit > FD_SETSIZE; limiting max. # of open files to
FD_SETSIZE = 1024
Media: no
------------------------------ Scenario Screen -------- [1-4]: Change Screen
--
Call-rate(length) Port Total-time Total-calls Remote-host
10.0(0 ms)/1.000s 5061 0.22 s 1 127.0.0.1:5060(UDP)
Call limit reached (-m 1), 0.226 s period 9 ms scheduler resolution
0 concurrent calls (limit 30) Peak was 1 calls, after 0 s
0 out-of-call msg (discarded)
1 open sockets
Messages Retrans Timeout
Unexpected-Msg
INVITE ----------> 1 0 0
100 <---------- 1 0 0
180 <---------- 0 0 0
183 <---------- 0 0 0
200 <---------- E-RTD 1 0 0
ACK ----------> 1 0
Var Pause [ 0ms] 1 0
BYE ----------> 1 0 0
200 <---------- 1 0 0
------------------------------ Test Terminated
--------------------------------
----------------------------- Statistics Screen ------- [1-4]: Change Screen
--
Start Time | 2007-02-02 19:36:59
Last Reset Time | 2007-02-02 19:36:59
Current Time | 2007-02-02 19:36:59
-------------------------+---------------------------+----------------------
----
Counter Name | Periodic value | Cumulative value
-------------------------+---------------------------+----------------------
----
Elapsed Time | 00:00:00:228 | 00:00:00:228
Call Rate | 4.386 cps | 4.386 cps
-------------------------+---------------------------+----------------------
----
Incoming call created | 0 | 0
OutGoing call created | 1 | 1
Total Call created | | 1
Current Call | 0 |
-------------------------+---------------------------+----------------------
----
Successful call | 1 | 1
Failed call | 0 | 0
-------------------------+---------------------------+----------------------
----
Response Time | 00:00:00:112 | 00:00:00:112
Call Length | 00:00:00:112 | 00:00:00:112
------------------------------ Test Terminated
--------------------------------
Here is the output of
sipp -m 1 -sn uac 127.0.0.1 &
[EMAIL PROTECTED] sipp -m 1 -sn uac 127.0.0.1 &
[1] 6851
[EMAIL PROTECTED] jobs
[1]+ Stopped sipp -m 1 -sn uac 127.0.0.1
Here is the description of the problem:
I don't want to run sipp in the background, but I do want to run it from an
automated script (the script of necessity needs to run in the background).
Below I've outlined the exact scenario which I am attempting to run. As you
can see, I want to test that the sip server is up (in an automated fashion)
and if it isn't, restart it. The below scenario does not work, because sipp
does nothing if the script is run in crontab or if the script is run in the
background. Sipp runs fine if I execute the script from the console.
Here is the exact script I want to run:
File /usr/src/sip_test.sh
--------------
#!/bin/sh
>/var/log/asterisk/sip_test.log
sipp -m 1 -sn uac 127.0.0.1 >& /dev/null
if test $? -ne 0
then
/etc/init.d/asterisk restart
echo Asterisk is down, restart >>/var/log/asterisk/sip_test.log
else
echo Asterisk is up >>/var/log/asterisk/sip_test.log
fi
exit 0
----------------
I want to run this script from cron:
crontab -e
* * * * * /usr/src/sip_test.sh
Specifically, sipp does nothing, and the result of the test of the outcome
is always success, regardless of if the sip server (asterisk) is running or
not. Hopefully this explains the scenario fully and my goals of the
scenario.
-Lukas
Lukas Oberhuber
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Juan Antonio
Alvarez
Sent: 02 February 2007 15:07
To: [email protected]
Subject: Re: [Sipp-users] Cron using Sipp
On 1/30/07, Lukas Oberhuber <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Charles,
>
>
>
> I'm taking from this discussion that I will need to parse the output of
sipp
> in my script, and use the pid I glean from this to apply to the 'wait'
> command.
>
>
>
> I wish it weren't such a convoluted task as what I'm trying to do seems
> exactly what this tool could help with (i.e. test if a service is running
or
> not, and take action based on the outcome)!
>
>
>
> Thank you for the help,
>
>
>
>
> -Lukas
>
Hi Lukas,
It should be much simpler, if I understand well what you are trying to
do. The script you sent, should be enough. Have you tried just running
the cli for sipp. i.e. sipp -m 1 -sn uac 127.0.0.1
My guess, you need to configure asterisk to answer to this call.
Probably, asterisk does not know how to react to the request you are
sending, and so the call is failing. And as you know (from sipp -h
output):
Exit code:
Upon exit (on fatal error or when the number of asked calls (-m
option) is reached, sipp exits with one of the following exit
code:
0: All calls were successful
1: At least one call failed
97: exit on internal command. Calls may have been processed
99: Normal exit without calls processed
-1: Fatal error
So please, give us the output of just running
sipp -m 1 -sn uac 127.0.0.1
You could also check with a
echo $?
In order to see the error code.
Finally, take a look at
http://sipp.sourceforge.net/wiki/index.php/Howto_test_an_Asterisk_server_usi
ng_SIPp
It could give you a hint...
Good luck,
Juan
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users