libamsip  5.2.1
Functions
amsip network interface

Functions

int am_network_guess_ip (int family, char *address, int size)
 
int am_network_masquerade (const char *ip, int port)
 
int am_network_start (const char *transport, int port)
 
int am_network_connection_tests (struct stun_test *stuntest, char *stun_server, int srcport)
 
int am_network_add_local_candidates (struct SdpCandidate *_candidates, int srcport)
 
int am_network_add_stun_candidates (struct SdpCandidate *candidates, struct SdpCandidate *localcandidates, char *unusedparameter, int srcport)
 
int am_network_add_turn_candidates (struct SdpCandidate *candidates, char *unusedparameter, int srcport)
 
int am_network_add_relay_candidates (struct SdpCandidate *candidates, char *relay_server, int srcport)
 
char * am_network_test_nat (const char *stun_server, int port, const char *proxy)
 
char * am_network_get_nat_info (const char *stun_server, int srcport)
 
int am_network_get_nat (char *stun_server, int srcport)
 
int am_network_get_stun_socket (const char *stun_server, int srcport, char *firewall, int *port)
 

Detailed Description

Function Documentation

◆ am_network_guess_ip()

int am_network_guess_ip ( int  family,
char *  address,
int  size 
)

Find default address of interface to reach the defined gateway.

Parameters
familyAF_INET or AF_INET6
addressa string containing the local IP address.
sizeThe size of the string

◆ am_network_masquerade()

int am_network_masquerade ( const char *  ip,
int  port 
)

Configure amsip to do masquerading on SIP Contact address. at run time.

PLEASE DO NOT USE UNLESS YOU REALLY UNDERSTAND THIS OPTION! THIS OPTIONS CANNOT BE USED IF YOU CONFIGURED THE STACK WITH STUN or ICE SUPPORT.

Parameters
ipIP to appear in Contact.
portport to appear in Contact.

◆ am_network_start()

int am_network_start ( const char *  transport,
int  port 
)

Configure amsip to listen on a specific transport layer.

Parameters
transportTransport Protocol to use ("UDP", "TCP", "TLS")
portLocal port to use for socket. (0 for random port)

◆ am_network_connection_tests()

int am_network_connection_tests ( struct stun_test *  stuntest,
char *  stun_server,
int  srcport 
)

Test NAT type.

Parameters
stuntestelement to receive all stun test.
stun_serverStun server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_add_local_candidates()

int am_network_add_local_candidates ( struct SdpCandidate *  _candidates,
int  srcport 
)

Add local candidates.

Parameters
_candidatesTable for MAX_NUMBER_OF_CANDIDATES local candidates.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_add_stun_candidates()

int am_network_add_stun_candidates ( struct SdpCandidate *  candidates,
struct SdpCandidate *  localcandidates,
char *  unusedparameter,
int  srcport 
)

Add Stun candidate.

Parameters
candidatescandidates to receive all stun candidates.
localcandidatescandidates with all local candidates. (used to remove duplicates)
unusedparameterStun server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_add_turn_candidates()

int am_network_add_turn_candidates ( struct SdpCandidate *  candidates,
char *  unusedparameter,
int  srcport 
)

Add TURN candidate.

Parameters
candidatescandidates to receive all turn candidates.
unusedparameterTURN server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_add_relay_candidates()

int am_network_add_relay_candidates ( struct SdpCandidate *  candidates,
char *  relay_server,
int  srcport 
)

Add RELAY candidate.

Parameters
candidatescandidates to receive all turn candidates.
relay_serverSTUN server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_test_nat()

char* am_network_test_nat ( const char *  stun_server,
int  port,
const char *  proxy 
)

Test NAT type.

Parameters
stun_serverStun server to use for NAT traversal solution.
portLocal port to use for socket. (0 for random port)
proxySIP Proxy Address (used to determine which interface to test)

◆ am_network_get_nat_info()

char* am_network_get_nat_info ( const char *  stun_server,
int  srcport 
)

Return text information on NAT type.

Parameters
stun_serverStun server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_get_nat()

int am_network_get_nat ( char *  stun_server,
int  srcport 
)

Return binary information on NAT type.

Parameters
stun_serverStun server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)

◆ am_network_get_stun_socket()

int am_network_get_stun_socket ( const char *  stun_server,
int  srcport,
char *  firewall,
int *  port 
)

Return IP/port and socket for a STUN server test.

Parameters
stun_serverStun server to use for NAT traversal solution.
srcportLocal port to use for socket. (0 for random port)
firewallOUT: firewall IP detected.
portOUT: firewall port detected.