Reading destination IP address from incoming message

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

 



Hi all,

I am developing an application using pjsua that uses multiple NICs (outside
and inside network).  To achieve this using UDP I create two UDP transports
that are bound to each NIC (bound_addr).  Each transport also has
public_addr option set to advertise the correct IP address in the 'Contact'
header.  I am also creating two RTP transports that are bound to each
interface and have public_addr option set.  I initializing the applications
calls array appropriately so that correct RTP transport is used (on
incoming/outgoing calls) therefore advertising the correct SDP c= field.  To
achieve the same using TCP I tried creating multiple TCP transports but i
get an error message on creating the second TCP transport.

Q1. Does pjsua support multiple TCP transports?

I can overcome the problem with a single TCP transport that is not bound to
any interface and is listening on both interfaces.  I then create
non-registering accounts and attach them to the transport using
pjsua_acc_set_transport.
These accounts then have force_contact option configured for
internal/external interface so that correct 'Contact' header is
sent.  Currently i'm checking the source address of the incoming message in
pjsua_call_on_incoming  -  pjsip_rx_data to determine if it came from
internal/external interface and then I land the call on the appropriate
account.  What I would like to do is to detect which interface received the
call (so that I can land it on the correct account) without having
to specify all the internal networks to the application.

Q2.  Is there a way to read the destination IP address in pjsip_rx_data?  Or
when there is a single transport listening on multiple interfaces, is there
a way to determine which interface received the message?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20101123/895eea1d/attachment.html>


[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