summaryrefslogtreecommitdiffstats
path: root/src/sip/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sip/main.c')
-rw-r--r--src/sip/main.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/sip/main.c b/src/sip/main.c
index 355a0c0..cd584a8 100644
--- a/src/sip/main.c
+++ b/src/sip/main.c
@@ -43,6 +43,8 @@ const char *remote_peer = NULL;
const char *asserted_id = NULL;
int local_register = 0;
int remote_register = 0;
+int remote_nat_sip = 0;
+int remote_nat_rtp = 0;
const char *register_user = NULL;
const char *register_peer = NULL;
int local_auth = 0;
@@ -105,6 +107,12 @@ static void print_help()
printf(" Define, if we must register to a registrar.\n");
printf(" If '--register' was given, but not any of '--local-register' or\n");
printf(" '--remote-register', remote registration automatically used.\n");
+ printf(" --remote-nat-sip\n");
+ printf(" Ignore the address+port from the SIP contact. Use the address+port from\n");
+ printf(" where the SIP massasge was sent.\n");
+ printf(" --remote-nat-rtp\n");
+ printf(" Ignore the RTP address from the SDP message. Use the RTP address from\n");
+ printf(" the remote peer. (untested!)\n");
printf(" -A --auth <user> <password> <realm>\n");
printf(" Define, if we must perform authentication.\n");
printf(" Realm can be set to anything. It is relevant for local authentication.\n");
@@ -135,12 +143,14 @@ static void print_help()
#define OPT_RECEIVE_NER 257
#define OPT_LOCAL_REG 258
#define OPT_REMOTE_REG 259
-#define OPT_LOCAL_AUTH 260
-#define OPT_REMOTE_AUTH 261
-#define OPT_REG_INTER 262
-#define OPT_OPT_INTER 263
-#define OPT_STUN_INTER 264
-#define OPT_EXPIRES 265
+#define OPT_REMOTE_SIP 260
+#define OPT_REMOTE_RTP 261
+#define OPT_LOCAL_AUTH 262
+#define OPT_REMOTE_AUTH 263
+#define OPT_REG_INTER 264
+#define OPT_OPT_INTER 265
+#define OPT_STUN_INTER 266
+#define OPT_EXPIRES 267
static void add_options(void)
{
@@ -156,6 +166,8 @@ static void add_options(void)
option_add('R', "register", 1);
option_add(OPT_LOCAL_REG, "local-register", 0);
option_add(OPT_REMOTE_REG, "remote-register", 0);
+ option_add(OPT_REMOTE_SIP, "remote-nat-sip", 0);
+ option_add(OPT_REMOTE_RTP, "remote-nat-rtp", 0);
option_add('A', "auth", 3);
option_add(OPT_LOCAL_AUTH, "local-auth", 0);
option_add(OPT_REMOTE_AUTH, "remote-auth", 0);
@@ -237,6 +249,12 @@ static int handle_options(int short_option, int argi, char **argv)
case OPT_REMOTE_REG:
remote_register = 1;
break;
+ case OPT_REMOTE_SIP:
+ remote_nat_sip = 1;
+ break;
+ case OPT_REMOTE_RTP:
+ remote_nat_rtp = 1;
+ break;
case 'A':
auth_user = options_strdup(argv[argi]);
auth_password = options_strdup(argv[argi + 1]);
@@ -336,7 +354,7 @@ int main(int argc, char *argv[])
}
if (!cc_argc || !!strncasecmp(cc_argv[0], "help", 4)) {
- sip_ep = sip_endpoint_create(user_agent, send_no_ringing_after_progress, receive_no_ringing_after_progress, name, local_user, local_peer, remote_user, remote_peer, asserted_id, local_register, remote_register, register_user, register_peer, local_auth, remote_auth, auth_user, auth_password, auth_realm, public_ip, stun_server, register_interval, options_interval, stun_interval, expires);
+ sip_ep = sip_endpoint_create(user_agent, send_no_ringing_after_progress, receive_no_ringing_after_progress, name, local_user, local_peer, remote_user, remote_peer, asserted_id, local_register, remote_register, remote_nat_sip, remote_nat_rtp, register_user, register_peer, local_auth, remote_auth, auth_user, auth_password, auth_realm, public_ip, stun_server, register_interval, options_interval, stun_interval, expires);
if (!sip_ep) {
PDEBUG(DSIP, DEBUG_ERROR, "SIP initializing failed!\n");
goto error;