diff -Naur twinkle-1.1-orig/src/phone.cpp twinkle/twinkle-1.0.1/src/phone.cpp --- twinkle-1.1-orig/src/phone.cpp 2007-11-02 21:00:00.000000000 +0100 +++ twinkle-1.1-nat/src/phone.cpp 2007-11-02 21:01:24.000000000 +0100 @@ -2793,6 +2793,16 @@ return result; } +string t_phone::get_call_id_ip_sip(t_user *user) { + string result; + + lock(); + result = LOCAL_IP; + unlock(); + + return result; +} + unsigned short t_phone::get_public_port_sip(const t_user *user) const { unsigned short result; diff -Naur twinkle-1.1-orig/src/phone.h twinkle/twinkle-1.0.1/src/phone.h --- twinkle-1.1-orig/src/phone.h 2007-11-02 21:00:00.000000000 +0100 +++ twinkle-1.1-nat/src/phone.h 2007-11-02 21:01:44.000000000 +0100 @@ -422,6 +422,7 @@ // Get IP address and port for SIP string get_ip_sip(const t_user *user) const; + string get_call_id_ip_sip(t_user *user); unsigned short get_public_port_sip(const t_user *user) const; // Indicates if STUN is used diff -Naur twinkle-1.1-orig/src/protocol.h twinkle/twinkle-1.0.1/src/protocol.h --- twinkle-1.1-orig/src/protocol.h 2007-11-02 21:00:00.000000000 +0100 +++ twinkle-1.1-nat/src/protocol.h 2007-11-02 21:03:06.000000000 +0100 @@ -214,7 +214,7 @@ #define CALL_ID_LEN 15 // Create a new call-id -#define NEW_CALL_ID(u) (random_token(CALL_ID_LEN) + '@' + USER_HOST(u)) +#define NEW_CALL_ID(u) (random_token(CALL_ID_LEN) + '@' + CALL_ID_USER_HOST(u)) // Create a new sequence number fo CSeq header #define NEW_SEQNR rand() % 1000 + 1 diff -Naur twinkle-1.1-orig/src/user.h twinkle/twinkle-1.0.1/src/user.h --- twinkle-1.1-orig/src/user.h 2007-11-02 21:00:00.000000000 +0100 +++ twinkle-1.1-nat/src/user.h 2007-11-02 21:03:52.000000000 +0100 @@ -43,6 +43,7 @@ #define PUBLIC_SIP_UDP_PORT(u) phone->get_public_port_sip(u) #define USER_HOST(u) phone->get_ip_sip(u) +#define CALL_ID_USER_HOST(u) phone->get_call_id_ip_sip(u) #define LOCAL_IP user_host #define SPECIAL_PHONE_SYMBOLS "-()/."