[python] Problem selecting the transport bound address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I'm having a little trouble selecting the bound address when creating
the transport object. The port selection is OK, but when I try to set
the bound address I get this error:

python: ../src/pj/sock_common.c:297: pj_sockaddr_get_addr: Assertion
`a->addr.sa_family == PJ_AF_INET || a->addr.sa_family == PJ_AF_INET6'
failed.

I'm using the following code:

def bind(self, bindaddr="0.0.0.0", bindport=5060):
        try:
            t = pj.TransportConfig()
            t.bound_addr = bindaddr
            t.port = bindport
            self.transport = self.lib.create_transport(pj.TransportType.UDP, t)
        except pj.Error, e:
            print "Error creating transport ", e

I'm getting the error when I do

bind("10.10.0.207", 5080)

because if I do

bind(bindport=5080)

everything is OK. I think this is a really stupid mistake, but I
haven't found it :( What am I doing wrong? Thanks in advance.


-- 
Sa?l -- "Nunca subestimes el ancho de banda de un cami?n lleno de disketes."
----------------------------------------------------------------
http://www.saghul.net/



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux