Диагностика вызовов с помощью sipp

Для начинающих.
Всем начинающим - сюда.

Модераторы: Модераторы, Admins

Ответить
GuonniBox
Сообщения: 9
Зарегистрирован: 27 апр 2017, 05:24

Диагностика вызовов с помощью sipp

Сообщение GuonniBox » 07 сен 2017, 10:27

Использую SIPP.
Простой план набора.

[sipp]
type=friend
context=sipp_inbound
username=sipp
host=127.0.0.1
disallow=all
allow=ulaw,alaw
insecure=port,invite


[sipp_inbound]
exten => 100,1,Answer
exten => 100,n,Playback(/var/lib/asterisk/sounds/en/tt-monkeys)
exten => 100,n,Hangup




Проблемы с мониторингом нагрузки по SIPP. Не могу сделать так, как этот парень.

https://voxlink.ru/kb/asterisk-configur ... test-sipp/

Он использует диагностику по логам с помощью tailf /var/log/asterisk/full | grep "ERROR\|WARNUNG\|NOTICE" С остальным мне все понятно.

нашел статью по логам.
http://linux.mixed-spb.ru/asterisk/logs.php
Проделал тоже самое со своим файлом message

Делаю все на одном хосту с Virtual box.

Выборочный sipp

sipp 192.168.1.17 -s 100 -i 127.0.0.1 -d 10000 -l 500 -aa -mi 127.0.0.1 -rtp_echo -nd -r 5

Генерирую(Фото "Тест 1" ниже, с правильным расположением показаний. Здесь немного все съехало )

------------------------------ Scenario Screen -------- [1-9]: Change Screen --
Call-rate(length) Port Total-time Total-calls Remote-host
5.0(10000 ms)/1.000s 5061 123.02 s 615 192.168.1.17:5060(UDP)

4 new calls during 0.776 s period 1 ms scheduler resolution
50 calls (limit 500) Peak was 51 calls, after 10 s
0 Running, 218 Paused, 13 Woken up
0 dead call msg (discarded) 0 out-of-call msg (discarded)
3 open sockets
279877 Total echo RTP pckts 1st stream 406.564 last period RTP rate (kB/s)
0 Total echo RTP pckts 2nd stream 0.000 last period RTP rate (kB/s)

Messages Retrans Timeout Unexpected-Msg
INVITE ----------> 615 0 0
100 <---------- 615 0 0 0
180 <---------- 0 0 0 0
183 <---------- 0 0 0 0
200 <---------- E-RTD1 615 0 0 0
ACK ----------> 615 0
Pause [ 10.0s] 615 0
BYE ----------> 565 0 0
200 <---------- 565 0 0 0

------------------------------ Test Terminated --------------------------------


----------------------------- Statistics Screen ------- [1-9]: Change Screen --
Start Time | 2017-09-07 19:08:07.321851 1504775287.321851
Last Reset Time | 2017-09-07 19:10:09.575785 1504775409.575785
Current Time | 2017-09-07 19:10:10.353643 1504775410.353643
-------------------------+---------------------------+--------------------------
Counter Name | Periodic value | Cumulative value
-------------------------+---------------------------+--------------------------
Elapsed Time | 00:00:00:777000 | 00:02:03:031000
Call Rate | 5.148 cps | 4.999 cps
-------------------------+---------------------------+--------------------------
Incoming call created | 0 | 0
OutGoing call created | 4 | 615
Total Call created | | 615
Current Call | 50 |
-------------------------+---------------------------+--------------------------
Successful call | 4 | 565
Failed call | 0 | 0
-------------------------+---------------------------+--------------------------
Response Time 1 | 00:00:00:003000 | 00:00:00:004000
Call Length | 00:00:10:007000 | 00:00:10:008000
------------------------------ Test Terminated --------------------------------


Просматриваю логи

[root@local ~]# tailf /var/log/asterisk/messages | grep "NOTICE\|WARNING\|ERROR"
[2017-09-07 19:09:24] WARNING[17904][C-00003f96] file.c: Failed to write frame
[2017-09-07 19:09:33] WARNING[17951][C-00003fc5] file.c: Failed to write frame
[2017-09-07 19:09:55] WARNING[18059][C-00004031] file.c: Failed to write frame
[2017-09-07 19:09:56] WARNING[18064][C-00004036] file.c: Failed to write frame


Почему у меня только предупреждения? Где все остальное?
Почему так много падений, если одновременно активно всего 50 вызов? На виртуальной машине около 2GB/Centos6.6/без графической оболочки.

Даже статистика по задержке вызова подтверждает обратное(Фото "Тест 2" соответствует данной статистике )

---------------------------- Repartition Screen ------- [1-9]: Change Screen --
Average Response Time Repartition 1
0 ms <= n < 10 ms : 269
10 ms <= n < 20 ms : 14
20 ms <= n < 30 ms : 1
30 ms <= n < 40 ms : 0
40 ms <= n < 50 ms : 0
50 ms <= n < 100 ms : 0
100 ms <= n < 150 ms : 0
150 ms <= n < 200 ms : 0
n >= 200 ms : 0
Average Call Length Repartition
0 ms <= n < 10 ms : 0
10 ms <= n < 50 ms : 0
50 ms <= n < 100 ms : 0
100 ms <= n < 500 ms : 0
500 ms <= n < 1000 ms : 0
1000 ms <= n < 5000 ms : 0
5000 ms <= n < 10000 ms : 0
n >= 10000 ms : 234
------------------------------ Test Terminated --------------------------------
У вас нет необходимых прав для просмотра вложений в этом сообщении.

awsswa
Сообщения: 1701
Зарегистрирован: 28 апр 2012, 10:19
Откуда: Russia, Пермь

Сообщение awsswa » 07 сен 2017, 11:08

logger show channels

и прочитать там что прописано в full

core set verbose 3
платный суппорт по мере возможностей

GuonniBox
Сообщения: 9
Зарегистрирован: 27 апр 2017, 05:24

Сообщение GuonniBox » 09 сен 2017, 08:53

[url=http://asteriskforum.ru/viewtopic.php?p=85154#85154][img]http://asteriskforum.ru/images/quotebackarrow.gif[/img][/url] awsswa @ Чт Сен 07, 2017 16:08 писал(а):logger show channels

и прочитать там что прописано в full

core set verbose 3

В фул все, что только можно уместить: от уведомлений до дебагов,факсов и аутентификации.

Запустил следующий sipp
sipp 192.168.1.17 -s 100 -i 127.0.0.1 -d 10000 -l 50 -aa -mi 127.0.0.1 -rtp_echo -nd -r 1

На выходе


[2017-09-09 17:09:49] VERBOSE[1095][C-0000001c] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:09:49] VERBOSE[1177][C-0000001c] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000001c", "") in new stack
[2017-09-09 17:09:49] VERBOSE[1165][C-00000012] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000012'
[2017-09-09 17:09:49] VERBOSE[1177][C-0000001c] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000001c", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:09:49] VERBOSE[1177][C-0000001c] file.c: -- <SIP/sipp-0000001c> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:09:50] VERBOSE[1095][C-0000001d] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:09:50] VERBOSE[1178][C-0000001d] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000001d", "") in new stack
[2017-09-09 17:09:50] VERBOSE[1166][C-00000013] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000013'
[2017-09-09 17:09:50] VERBOSE[1178][C-0000001d] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000001d", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:09:50] VERBOSE[1178][C-0000001d] file.c: -- <SIP/sipp-0000001d> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:09:51] VERBOSE[1095][C-0000001e] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:09:51] VERBOSE[1179][C-0000001e] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000001e", "") in new stack
[2017-09-09 17:09:51] VERBOSE[1167][C-00000014] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000014'
[2017-09-09 17:09:51] VERBOSE[1179][C-0000001e] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000001e", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:09:51] VERBOSE[1179][C-0000001e] file.c: -- <SIP/sipp-0000001e> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:09:52] VERBOSE[1095][C-0000001f] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:09:52] VERBOSE[1180][C-0000001f] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000001f", "") in new stack
[2017-09-09 17:09:52] VERBOSE[1168][C-00000015] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000015'
[2017-09-09 17:09:52] VERBOSE[1180][C-0000001f] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000001f", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:09:52] VERBOSE[1180][C-0000001f] file.c: -- <SIP/sipp-0000001f> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:09:53] VERBOSE[1095][C-00000020] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:09:53] VERBOSE[1171][C-00000016] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000016'
[2017-09-09 17:09:53] VERBOSE[1181][C-00000020] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-00000020", "") in new stack
[2017-09-09 17:09:53] VERBOSE[1181][C-00000020] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-00000020", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:09:53] VERBOSE[1181][C-00000020] file.c: -- <SIP/sipp-00000020> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:09:54] VERBOSE[1095][C-00000021] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:09:54] VERBOSE[1182][C-00000021] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-00000021", "") in new stack
[2017-09-09 17:09:54] VERBOSE[1172][C-00000017] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000017'
[2017-09-09 17:09:54] VERBOSE[1182][C-00000021] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-00000021", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack

Насколько понимаю, происходит создание вызов, затем ответ проигрышем звукового файла собеседнику, и все. Hangup срабатывает в том случае если приостановить поступление новых вызовов.


[2017-09-09 17:10:28] VERBOSE[1199][C-00000032] pbx.c: == Spawn extension (sipp_inbound, 100, 3) exited non-zero on 'SIP/sipp-00000032'
[2017-09-09 17:10:29] VERBOSE[1200][C-00000033] pbx.c: -- Executing [100@sipp_inbound:3] Hangup("SIP/sipp-00000033", "") in new stack
[2017-09-09 17:10:29] VERBOSE[1200][C-00000033] pbx.c: == Spawn extension (sipp_inbound, 100, 3) exited non-zero on 'SIP/sipp-00000033'
[2017-09-09 17:10:30] VERBOSE[1201][C-00000034] pbx.c: -- Executing [100@sipp_inbound:3] Hangup("SIP/sipp-00000034", "") in new stack


В NOTICE у меня пусто.



В SECURITY

[root@local ~]# tailf /var/log/asterisk/full | grep "SECURITY"
[2017-09-09 17:22:30] SECURITY[1065] res_security_log.c: SecurityEvent="SuccessfulAuth",EventTV="1504941750-618457",Severity="Informational",Service="SIP",EventVersion="1",AccountID="100",SessionID="0x7f0ac43b3008",LocalAddress="IPV4/UDP/127.0.0.1/5060",RemoteAddress="IPV4/UDP/127.0.0.1/5061",UsingPassword="0"
[2017-09-09 17:22:31] SECURITY[1065] res_security_log.c: SecurityEvent="SuccessfulAuth",EventTV="1504941751-618498",Severity="Informational",Service="SIP",EventVersion="1",AccountID="100",SessionID="0x7f0ac4136fb8",LocalAddress="IPV4/UDP/127.0.0.1/5060",RemoteAddress="IPV4/UDP/127.0.0.1/5061",UsingPassword="0"
[2017-09-09 17:22:32] SECURITY[1065] res_security_log.c: SecurityEvent="SuccessfulAuth",EventTV="1504941752-619954",Severity="Informational",Service="SIP",EventVersion="1",AccountID="100",SessionID="0x7f0ac4229308",LocalAddress="IPV4/UDP/127.0.0.1/5060",RemoteAddress="IPV4/UDP/127.0.0.1/5061",UsingPassword="0"
[2017-09-09 17:22:33] SECURITY[1065] res_security_log.c: SecurityEvent="SuccessfulAuth",EventTV="1504941753-622088",Severity="Informational",Service="SIP",EventVersion="1",AccountID="100",SessionID="0x7f0ac4065788",LocalAddress="IPV4/UDP/127.0.0.1/5060",RemoteAddress="IPV4/UDP/127.0.0.1/5061",UsingPassword="0"

Не видит параметр 192.168.1.17? Почему удаленный хост loopback?




Попробовал свой собственный сценарий XML в привязке с CSV файлом.

XML FILE (test3.xml)
Структура.

SIPp UAC Remote
|(1) INVITE |
|------------------>|
|(2) 100 (optional) |
|<------------------|
|(3) 180 (optional) |
|<------------------|
|(4) 200 |
|<------------------|
|(5) ACK |
|------------------>|
| |
|(6) RTP send (8s) |
|==================>|
| |
|(7) RFC2833 DIGIT 1|
|==================>|
| |
|(8 ) BYE |
|------------------>|
|(9) 200 |
|<------------------|



Сценарий, по которому будут происходить согласования по установке, удержанию и разъединению вызова.

Сам XML FILE


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAC with media">
<send retrans="500">
<![CDATA[

INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio [auto_media_port] RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16

]]>
</send>

<recv response="100" optional="true">
</recv>
<recv response="180" optional="true">
</recv>


<recv response="200" rtd="true" crlf="true">
</recv>

<send>
<![CDATA[
ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0

]]>
</send>

<nop>
<action>
<exec play_pcap_audio="/usr/sipp/sipp-3.3.990/pcap/g711a.pcap"/>
</action>
</nop>

<pause milliseconds="8000"/>

<nop>
<action>
<exec play_pcap_audio="/usr/sipp/sipp-3.3.990/pcap/dtmf_2833_1.pcap"/>
</action>
</nop>
<pause milliseconds="1000"/>

<send retrans="500">
<![CDATA[
BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 2 BYE
Contact: sip:[field0]@[local_ip]:[local_port]
Max-Forwards: 70 Subject:
Performance Test
Content-Length: 0

]]>
</send>

<recv response="200" crlf="true">
</recv>
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>


Здесь в поле Field0 выставляю того, от кого делаются вызовы - то есть инициатора.Требуется CSV файл.



CSV FILE (peerofcalls.csv)

группы пользователей(их контактные данные)


SEQUENTIAL,PRINTF=9999
user%0004d;


Теперь, при диагностике, должно появится поле с описанием, от кого поступает вызов.



Делаю по следующей схеме в sipp.

sipp 192.168.1.17 -sf test3.xml -inf peerofcalls.csv -i 127.0.0.1 -d 10000 -s 100 -l 20 -aa -mi 127.0.0.1 -rtp_echo -nd -r 1



[2017-09-09 17:36:43] VERBOSE[1095][C-00000439] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:36:43] VERBOSE[2903][C-00000439] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-00000439", "") in new stack
[2017-09-09 17:36:43] VERBOSE[2903][C-00000439] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-00000439", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:36:43] VERBOSE[2903][C-00000439] file.c: -- <SIP/sipp-00000439> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:36:43] NOTICE[2903][C-00000439] channel.c: Dropping incompatible voice frame on SIP/sipp-00000439 of format ulaw since our native format has changed to (alaw)
[2017-09-09 17:36:43] VERBOSE[2876][C-00000430] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000430'
[2017-09-09 17:36:44] VERBOSE[1095][C-0000043a] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:36:44] VERBOSE[2906][C-0000043a] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000043a", "") in new stack
[2017-09-09 17:36:44] VERBOSE[2906][C-0000043a] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000043a", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:36:44] VERBOSE[2906][C-0000043a] file.c: -- <SIP/sipp-0000043a> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:36:44] NOTICE[2906][C-0000043a] channel.c: Dropping incompatible voice frame on SIP/sipp-0000043a of format ulaw since our native format has changed to (alaw)
[2017-09-09 17:36:44] VERBOSE[2879][C-00000431] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000431'
[2017-09-09 17:36:45] VERBOSE[1095][C-0000043b] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:36:45] VERBOSE[2909][C-0000043b] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000043b", "") in new stack
[2017-09-09 17:36:45] VERBOSE[2909][C-0000043b] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000043b", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:36:45] VERBOSE[2909][C-0000043b] file.c: -- <SIP/sipp-0000043b> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:36:45] NOTICE[2909][C-0000043b] channel.c: Dropping incompatible voice frame on SIP/sipp-0000043b of format ulaw since our native format has changed to (alaw)
[2017-09-09 17:36:45] VERBOSE[2882][C-00000432] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000432'
[2017-09-09 17:36:46] VERBOSE[1095][C-0000043c] netsock2.c: == Using SIP RTP CoS mark 5
[2017-09-09 17:36:46] VERBOSE[2912][C-0000043c] pbx.c: -- Executing [100@sipp_inbound:1] Answer("SIP/sipp-0000043c", "") in new stack
[2017-09-09 17:36:46] VERBOSE[2912][C-0000043c] pbx.c: -- Executing [100@sipp_inbound:2] Playback("SIP/sipp-0000043c", "/var/lib/asterisk/sounds/en/tt-monkeys") in new stack
[2017-09-09 17:36:46] VERBOSE[2912][C-0000043c] file.c: -- <SIP/sipp-0000043c> Playing '/var/lib/asterisk/sounds/en/tt-monkeys.gsm' (language 'en')
[2017-09-09 17:36:46] NOTICE[2912][C-0000043c] channel.c: Dropping incompatible voice frame on SIP/sipp-0000043c of format ulaw since our native format has changed to (alaw)
[2017-09-09 17:36:46] VERBOSE[2885][C-00000433] pbx.c: == Spawn extension (sipp_inbound, 100, 2) exited non-zero on 'SIP/sipp-00000433'

В результате, тот же самый диагноз, что и у простого сценария sipp(без XML). Не понятно, как идентифицировать вызовы и от кого пользователя поступает инициализация. Вот, что сейчас интересует.
И вот, что еще. В файле XML есть строки


<exec play_pcap_audio="/usr/sipp/sipp-3.3.990/pcap/g711a.pcap"/>

<exec play_pcap_audio="/usr/sipp/sipp-3.3.990/pcap/dtmf_2833_1.pcap"/>
Скорее всего из за них появляются NOTICE, но это неточно. Не критично по проблеме сейчас, но все же описать нужно было.

Ваши предложения?

GuonniBox
Сообщения: 9
Зарегистрирован: 27 апр 2017, 05:24

Сообщение GuonniBox » 12 сен 2017, 15:27


Ответить