Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93315

Scapy and MGCP

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dchokshi@cisco.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.042
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'creighton': 0.09; 'protocols,': 0.09; 'python': 0.11; 'example:': 0.11; 'message-----': 0.15; 'output': 0.15; '23,': 0.16; 'packets.': 0.16; 'sip': 0.16; 'url:py': 0.16; 'laura': 0.18; 'to:name:python- list@python.org': 0.20; 'to:2**1': 0.22; '2015': 0.23; 'passing': 0.23; 'file.': 0.24; 'import': 0.24; 'mon,': 0.24; 'url:mailman': 0.31; 'received:169.254': 0.31; 'url:python': 0.33; 'url:code': 0.34; 'file': 0.34; 'server': 0.34; 'skip:- 10': 0.34; 'received:169': 0.35; 'sent:': 0.35; 'url:listinfo': 0.35; 'to:addr:python-list': 0.35; 'cc:': 0.35; 'returning': 0.35; 'something': 0.35; 'but': 0.36; 'url:org': 0.36; 'there': 0.36; 'url:source': 0.36; 'subject:': 0.36; 'charset:us-ascii': 0.37; 'thought': 0.37; 'thank': 0.39; 'url:2': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'hello,': 0.40; 'per': 0.61; 'voice': 0.63; 'you.': 0.64; 'email name:python-list': 0.67; 'reply': 0.67; 'url:r': 0.71; 'url:v2': 0.84; '262': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1645; q=dns/txt; s=iport; t=1435608437; x=1436818037; h=from:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=0wO6ZHxUsxSNGMIFDaoc9hkr199ItV3kVbqMif5yFZQ=; b=EmQNwGFG0zOpomJe6tx/iY1b/kL/z/Kid8DgRH20VJHrX2ZFMdEQ7tUM yHhupirieNX/1rHoSqNZ8n/O04Q1doejBR8EpahqldkV7BNuc+nzmxo+j a3v0yK8oquKFuGTGXQS0HmCgGjDXrxsWntDZSBxb6i0AFtO8xy050x0HF g=;
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result A0DkAADko5FV/5RdJa1bgxFUXwa9JglxBWYFhTNKAoE/OBQBAQEBAQEBgQqEIgEBAQQBAQE3SwYBGQQBAQsUCS4LFAkJAQQBEggBiCYNyVgBAQEBAQEBAQEBAQEBAQEBAQEBAQEXjjWBSQEBBRo+gxGBFAWMEodyAYRYhn2BOYcej2MmY4MXbwEBAQEBgQc6gQIBAQE
X-IronPort-AV E=Sophos;i="5.15,372,1432598400"; d="scan'208";a="163944137"
From "Devaki Chokshi (dchokshi)" <dchokshi@cisco.com>
To "lac@openend.se" <lac@openend.se>, "python-list@python.org" <python-list@python.org>
Subject Scapy and MGCP
Thread-Topic Scapy and MGCP
Thread-Index AdCypwO4GOTLhZsRQa+9r98eUyI7yA==
Date Mon, 29 Jun 2015 20:06:05 +0000
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [10.116.81.152]
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-Mailman-Approved-At Tue, 30 Jun 2015 09:14:49 +0200
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.182.1435648490.3674.python-list@python.org> (permalink)
Lines 62
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1435648490 news.xs4all.nl 2850 [2001:888:2000:d::a6]:56062
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:93315

Show key headers only | View raw


Hello,

As per reply received I have begun to use scapy for MGCP. 

I started off with  reading a .pcap file with MGCP packets. 

For example:

from scapy.all import *
from scapy.utils import *
from scapy.layers.mgcp import *

mgcp_pkts = rdpcap("my-mgcp-capture.pcap")

However, rdpcap() is returning all MGCP packets as UDP packets. The output is something like:

<my-mgcp-capture.pcap: TCP:33 UDP:262 ICMP:1 Other:0>

All 262 UDP packets are actually MGCP packets. 

I would have thought rdpcap() will understand MGCP packet format. 

Would appreciate help on how I can make scapy read MGCP packets from a .pcap file.

Thank you
Devaki

-----Original Message-----
From: Laura Creighton [mailto:lac@openend.se] 
Sent: Tuesday, June 23, 2015 7:47 AM
To: Devaki Chokshi (dchokshi)
Cc: python-list@python.org; shtoom@python.org; lac@openend.se
Subject: Re: MGCP Server implementation

In a message of Mon, 22 Jun 2015 20:42:21 -0000, "Devaki Chokshi (dchokshi)" wr
ites:
>Hello,
>
>I have a use case where a SIP voice call will be passing through an MGCP gateway.
>
>Is there a python implementation that simulates MGCP gateway/server?
>
>Thank you
>Devaki Chokshi
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list
>

I think http://www.secdev.org/projects/scapy/ will do this for you.
In particular
https://code.google.com/p/pythonxy/source/browse/src/python/_scapy/PURELIB/scapy/layers/mgcp.py?repo=xy-27&name=v2.7.2.1&r=c4a08530c8ff74fd6078507743ce9982675aea8c

But I have only used Sacpy for other protocols, so I am not certain.

Laura

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Scapy and MGCP "Devaki Chokshi (dchokshi)" <dchokshi@cisco.com> - 2015-06-29 20:06 +0000

csiph-web