MCPcopy Index your code
hub / github.com/secdev/scapy / voip_play3

Function voip_play3

scapy/modules/voip.py:148–174  ·  view source on GitHub ↗

Same than voip_play, but made to read and play VoIP RTP packets, without checking IP. .. seealso:: voip_play for basic VoIP packets

(lst=None, **kargs)

Source from the content-addressed store, hash-verified

146
147
148def voip_play3(lst=None, **kargs):
149 """Same than voip_play, but made to
150 read and play VoIP RTP packets, without
151 checking IP.
152
153 .. seealso:: voip_play
154 for basic VoIP packets
155 """
156 proc = subprocess.Popen(sox_base[0] + sox_base[1], stdin=subprocess.PIPE,
157 stdout=subprocess.PIPE)
158 dsp, rd = proc.stdin, proc.stdout
159
160 def play(pkt, dsp=dsp):
161 if pkt and pkt.haslayer(UDP) and pkt.haslayer(RTP):
162 dsp.write(pkt.getlayer(RTP).load)
163 try:
164 if lst is None:
165 sniff(store=0, prn=play, **kargs)
166 else:
167 for p in lst:
168 play(p)
169 finally:
170 try:
171 dsp.close()
172 rd.close()
173 except Exception:
174 pass

Callers

nothing calls this directly

Calls 3

sniffFunction · 0.90
playFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected