fixup
authorAndreas Eversberg <jolly@eversberg.eu>
Sun, 26 Nov 2017 11:31:03 +0000 (12:31 +0100)
committerAndreas Eversberg <jolly@eversberg.eu>
Sun, 26 Nov 2017 11:31:03 +0000 (12:31 +0100)
apppbx.cpp
sip.cpp

index 9752b87..8bcc36f 100644 (file)
@@ -1278,7 +1278,7 @@ int cfnr_call_timeout(struct lcr_timer *timer, void *instance, int index)
 {
        class EndpointAppPBX *ea = (class EndpointAppPBX *)instance;
 
-       PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-busy time has expired, calling the forwarded number: %s.\n", ea->ea_endpoint->ep_serial, ea->e_ext.cfnr);
+       PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-no-response time has expired, calling the forwarded number: %s.\n", ea->ea_endpoint->ep_serial, ea->e_ext.cfnr);
        ea->out_setup(1);
 
        return 0;
diff --git a/sip.cpp b/sip.cpp
index e274d39..a6b44a5 100644 (file)
--- a/sip.cpp
+++ b/sip.cpp
@@ -436,6 +436,8 @@ int Psip::rtp_open(void)
        unsigned int ip;
        unsigned short start_port;
 
+       PDEBUG(DEBUG_SIP, "rtp_open\n");
+
        /* create socket */
        rc = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
        if (rc < 0) {
@@ -930,7 +932,9 @@ int Psip::message_connect(unsigned int epoint_id, int message_id, union paramete
 
        memset(&ia, 0, sizeof(ia));
        ia.s_addr = htonl(get_local_ip(p_s_rtp_ip_local));
-       if (p_s_rtp_bridge || interface->is_tones != IS_YES) {
+#warning TESTING must always send SDP on 200 OK
+if (1) {
+//     if (p_s_rtp_bridge || interface->is_tones != IS_YES) {
                SPRINT(sdp_str,
                        "v=0\r\n"
                        "o=LCR-Sofia-SIP 0 0 IN IP4 %s\r\n"
@@ -1164,8 +1168,13 @@ int Psip::message_setup(unsigned int epoint_id, int message_id, union parameter
                SPRINT(asserted_id, "sip:%s@%s", inst->asserted_id, remote);
                SPRINT(asserted_msg, "P-Asserted-Identity: <%s>", asserted_id);
        }
-       if (inst->public_ip[0])
+       if (inst->public_ip[0]) {
+               char *p;
                SPRINT(contact, "sip:%s@%s", p_callerinfo.id, inst->public_ip);
+               p = strchr(inst->local_peer, ':');
+               if (p)
+                       SCAT(contact, p);
+       }
 
        sip_trace_header(this, inst->interface_name, "INVITE", DIRECTION_OUT);
        add_trace("from", "uri", "%s", from);
@@ -1361,7 +1370,7 @@ int Psip::message_epoint(unsigned int epoint_id, int message_id, union parameter
                return(1);
 
                default:
-               PDEBUG(DEBUG_SIP, "PORT(%s) SP port with (caller id %s) received an unsupported message: %d\n", p_name, p_callerinfo.id, message_id);
+               PDEBUG(DEBUG_SIP, "PORT(%s) SIP port with (caller id %s) received an unsupported message: %d\n", p_name, p_callerinfo.id, message_id);
        }
 
        return 0;
@@ -2168,6 +2177,7 @@ static void sip_callback(nua_event_t event, int status, char const *phrase, nua_
                default:
                        PDEBUG(DEBUG_SIP, "Destroying unknown instance\n");
                        nua_handle_destroy(nh);
+                       return;
                }
        }
 
@@ -2597,8 +2607,13 @@ static void sip_handle_register(struct sip_inst *inst)
 
                SPRINT(from, "sip:%s@%s", inst->register_user, inst->register_host);
                SPRINT(to, "sip:%s@%s", inst->register_user, inst->register_host);
-               if (inst->public_ip[0])
+               if (inst->public_ip[0]) {
+                       char *p;
                        SPRINT(contact, "sip:%s@%s", inst->register_user, inst->public_ip);
+                       p = strchr(inst->local_peer, ':');
+                       if (p)
+                               SCAT(contact, p);
+               }
 
                sip_trace_header(NULL, inst->interface_name, "REGISTER", DIRECTION_OUT);
                add_trace("from", "uri", "%s", from);