Add sipp-sendfax.xml and spandspflow2pcap.py to contrib/scripts.
[asterisk/asterisk.git] / contrib / scripts / sipp-sendfax.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE scenario SYSTEM "sipp.dtd">
3 <scenario name="INVITE (optional auth), re-INVITE to T38 and send a Fax, Walter Doekes 2012-2013">
4
5   <!--
6
7   NOTE: Creating a sipp-sendfax.pcap is as easy as:
8   - receive a fax with asterisk
9   - get the incoming side of the spansdp.log (use 'fax set debug on',
10     check your logger.conf)
11   - feed it to spandspflow2pcap.py
12
13   NOTE: sipp-sendfax.xml requires image pcap play support in SIPp. This
14   means a version above 3.5.0, or the master git branch from
15   https://github.com/SIPp/sipp.
16
17   -->
18
19   <label id="invite"/>
20
21   <send retrans="500" start_txn="invite">
22     <![CDATA[
23
24       INVITE sip:[tel]@[remote_ip]:[remote_port] SIP/2.0
25       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
26       From: sip:[service]@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
27       To: sip:[tel]@[remote_ip]:[remote_port]
28       Contact: sip:[service]@[local_ip]:[local_port]
29       Call-ID: [call_id]
30       CSeq: [cseq] INVITE
31       Max-Forwards: 70
32       Content-Type: application/sdp
33       Content-Length: [len]
34
35       v=0
36       o=- 144969 144969 IN IP[local_ip_type] [local_ip]
37       s=-
38       c=IN IP[media_ip_type] [media_ip]
39       t=0 0
40       m=audio [media_port] RTP/AVP 8 0
41       a=rtpmap:8 PCMA/8000
42       a=rtpmap:0 PCMU/8000
43
44     ]]>
45   </send>
46
47   <recv response="100" optional="true" response_txn="invite"/>
48
49   <recv response="180" optional="true" response_txn="invite"/>
50
51   <recv response="181" optional="true" response_txn="invite"/>
52
53   <recv response="183" optional="true" response_txn="invite"/>
54
55   <recv response="200" optional="true" rrs="true" response_txn="invite" next="invite-ack"/>
56
57   <recv response="401" optional="true" rrs="true" next="invite-with-auth" auth="true" rrs="true" response_txn="invite"/>
58
59   <recv response="407" auth="true" rrs="true" response_txn="invite"/>
60
61   <label id="invite-with-auth"/>
62
63   <send ack_txn="invite">
64     <![CDATA[
65
66       ACK sip:[tel]@[remote_ip]:[remote_port] SIP/2.0
67       [last_Via:]
68       [last_From:]
69       [last_To:]
70       Contact: sip:[service]@[local_ip]:[local_port]
71       Call-ID: [call_id]
72       CSeq: [cseq] ACK
73       Max-Forwards: 70
74       Content-Length: 0
75
76     ]]>
77   </send>
78
79   <send retrans="500" start_txn="invite">
80     <![CDATA[
81
82       INVITE sip:[tel]@[remote_ip]:[remote_port] SIP/2.0
83       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
84       From: sip:[service]@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
85       To: sip:[tel]@[remote_ip]:[remote_port]
86       Contact: sip:[service]@[local_ip]:[local_port]
87       [authentication]
88       Call-ID: [call_id]
89       CSeq: [cseq] INVITE
90       Max-Forwards: 70
91       Content-Type: application/sdp
92       Content-Length: [len]
93
94       v=0
95       o=- 144969 144969 IN IP[local_ip_type] [local_ip]
96       s=-
97       c=IN IP[media_ip_type] [media_ip]
98       t=0 0
99       m=audio [media_port] RTP/AVP 8 0
100       a=rtpmap:8 PCMA/8000
101       a=rtpmap:0 PCMU/8000
102
103     ]]>
104   </send>
105
106   <recv response="100" response_txn="invite"/>
107
108   <recv response="180" optional="true" response_txn="invite"/>
109
110   <recv response="181" optional="true" response_txn="invite"/>
111
112   <recv response="183" optional="true" response_txn="invite"/>
113
114   <recv response="200" rrs="true" response_txn="invite"/>
115
116   <label id="invite-ack"/>
117
118   <send ack_txn="invite">
119     <![CDATA[
120
121       ACK [next_url] SIP/2.0
122       [last_Via:]
123       [routes]
124       [last_From:]
125       [last_To:]
126       Contact: sip:[service]@[local_ip]:[local_port]
127       Call-ID: [call_id]
128       CSeq: [cseq] ACK
129       Max-Forwards: 70
130       Content-Length: 0
131
132     ]]>
133   </send>
134
135   <!-- Send a bit of noise to start the RTP. You may need to use
136        the -i MY_IP command line option. -->
137   <pause milliseconds="500"/>
138
139   <nop>
140     <action>
141       <exec play_pcap_audio="g711a.pcap"/>
142     </action>
143   </nop>
144
145   <pause milliseconds="500"/>
146
147
148   <!-- *****************************************************************
149
150   Initiate re-INVITE to T38.
151
152   ****************************************************************** -->
153
154   <send start_txn="t38invite">
155     <![CDATA[
156
157       INVITE [next_url] SIP/2.0
158       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
159       [routes]
160       [last_From:]
161       [last_To:]
162       Contact: sip:[service]@[local_ip]:[local_port]
163       Call-ID: [call_id]
164       CSeq: [cseq] INVITE
165       Max-Forwards: 70
166       Content-Type: application/sdp
167       Content-Length: [len]
168
169       v=0
170       o=- 145280 145280 IN IP[local_ip_type] [local_ip]
171       s=-
172       c=IN IP[media_ip_type] [media_ip]
173       t=0 0
174       m=image [media_port] udptl t38
175       a=T38FaxVersion:0
176       a=T38MaxBitRate:14400
177       a=T38FaxRateManagement:transferredTCF
178       a=T38FaxMaxBuffer:200
179       a=T38FaxMaxDatagram:200
180       a=T38FaxUdpEC:t38UDPRedundancy
181
182     ]]>
183   </send>
184
185   <recv response="100" optional="true" response_txn="t38invite"/>
186
187   <recv response="488" optional="true" response_txn="t38invite" next="abort"/>
188
189   <recv response="200" response_txn="t38invite"/>
190
191   <send ack_txn="t38invite">
192     <![CDATA[
193
194       ACK [next_url] SIP/2.0
195       [last_Via:]
196       [routes]
197       [last_From:]
198       [last_To:]
199       Contact: sip:[service]@[local_ip]:[local_port]
200       Call-ID: [call_id]
201       CSeq: [cseq] ACK
202       Max-Forwards: 70
203       Content-Length: 0
204
205     ]]>
206   </send>
207
208   <!-- Enable the nop/action below to replay the FAX image. You may need to use
209        the -i MY_IP command line option. -->
210   <pause milliseconds="500"/>
211
212   <nop>
213     <action>
214       <exec play_pcap_image="sipp-sendfax.pcap"/>
215     </action>
216   </nop>
217
218
219   <!-- *****************************************************************
220
221   Wait for re-INVITE back to audio.
222
223   ****************************************************************** -->
224
225   <recv request="INVITE"/>
226
227   <send retrans="500">
228     <![CDATA[
229
230       SIP/2.0 200 OK
231       [last_Via:]
232       [last_Record-Route:]
233       [last_From:]
234       [last_To:]
235       Contact: sip:[service]@[local_ip]:[local_port]
236       [last_Call-ID:]
237       [last_CSeq:]
238       Max-Forwards: 70
239       Content-Type: application/sdp
240       Content-Length: [len]
241
242       v=0
243       o=- 146312 146312 IN IP[local_ip_type] [local_ip]
244       s=-
245       c=IN IP[media_ip_type] [media_ip]
246       t=0 0
247       m=audio [media_port] RTP/AVP 8 0
248       a=rtpmap:8 PCMA/8000
249       a=rtpmap:0 PCMU/8000
250
251     ]]>
252   </send>
253
254   <recv request="ACK"/>
255
256   <recv request="BYE"/>
257
258   <send next="done">
259     <![CDATA[
260
261       SIP/2.0 200 OK
262       [last_Via:]
263       [last_Record-Route:]
264       [last_From:]
265       [last_To:]
266       Contact: sip:[service]@[local_ip]:[local_port]
267       [last_Call-ID:]
268       [last_CSeq:]
269       Content-Length: 0
270
271     ]]>
272   </send>
273
274
275   <!-- *****************************************************************
276
277   Abort the call ourselves
278
279   ****************************************************************** -->
280
281   <label id="abort"/>
282
283   <send ack_txn="t38invite">
284     <![CDATA[
285
286       ACK [next_url] SIP/2.0
287       [last_Via:]
288       [routes]
289       [last_From:]
290       [last_To:]
291       Contact: sip:[service]@[local_ip]:[local_port]
292       Call-ID: [call_id]
293       CSeq: [cseq] ACK
294       Max-Forwards: 70
295       Content-Length: 0
296
297     ]]>
298   </send>
299
300   <send start_txn="bye">
301     <![CDATA[
302
303       BYE [next_url] SIP/2.0
304       [last_Via:]
305       [routes]
306       [last_From:]
307       [last_To:]
308       Contact: sip:[service]@[local_ip]:[local_port]
309       Call-ID: [call_id]
310       CSeq: [cseq] BYE
311       Max-Forwards: 70
312       Content-Length: 0
313
314     ]]>
315   </send>
316
317   <recv response="200" response_txn="bye" next="done"/>
318
319
320   <!-- *****************************************************************
321
322   Finalize
323
324   ****************************************************************** -->
325
326   <label id="done"/>
327
328   <!-- Keep call open to be able to retransmit stuff -->
329   <timewait milliseconds="2000"/>
330
331 </scenario><!-- vim: set ts=8 sw=2 sts=2 et ai: -->