Browse code

ims_registrar_scscf: added '\n' for debug messages

- added a new line to the end of some debug logs for
better formatting.

Aleksandar Yosifov authored on 07/11/2019 16:11:21
Showing 2 changed files
... ...
@@ -448,7 +448,7 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, int event_type, str *presen
448 448
     get_act_time();
449 449
 
450 450
     LM_DBG("Sending Reg event notifies\n");
451
-    LM_DBG("Switching on event type: %d", event_type);
451
+    LM_DBG("Switching on event type: %d\n", event_type);
452 452
     switch (event_type) {
453 453
         case IMS_REGISTRAR_NONE:
454 454
             return 0;
... ...
@@ -457,7 +457,7 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, int event_type, str *presen
457 457
                 LM_ERR("this is a subscribe called from cfg file: r_passed be zero and presentity_uri, watcher_contact and _d should be valid for a subscribe");
458 458
                 return 0;
459 459
             }
460
-            LM_DBG("Event type is IMS REGISTRAR SUBSCRIBE about to get reginfo_full");
460
+            LM_DBG("Event type is IMS REGISTRAR SUBSCRIBE about to get reginfo_full\n");
461 461
             //lets get IMPU list for presentity as well as register for callbacks (IFF its a new SUBSCRIBE)
462 462
 
463 463
             ul.lock_udomain(_d, presentity_uri);
... ...
@@ -481,7 +481,7 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, int event_type, str *presen
481 481
                 return 1;
482 482
             }
483 483
             ul.unlock_udomain((udomain_t*) _d, presentity_uri);
484
-            LM_DBG("About to create notification");
484
+            LM_DBG("About to create notification\n");
485 485
 
486 486
             create_notifications(_d, r_passed, presentity_uri, watcher_contact, impu_list, num_impus, event_type, explit_dereg_contact, num_explit_dereg_contact);
487 487
             if (impu_list) {
... ...
@@ -519,7 +519,7 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, int event_type, str *presen
519 519
                 }
520 520
 				return 0;
521 521
             }
522
-            LM_DBG("About to create notification");
522
+            LM_DBG("About to create notification\n");
523 523
             create_notifications(_d, r_passed, presentity_uri, watcher_contact, impu_list, num_impus, event_type, explit_dereg_contact, num_explit_dereg_contact);
524 524
             if (impu_list) {
525 525
                     pkg_free(impu_list);
... ...
@@ -808,7 +808,7 @@ int process_publish_body(struct sip_msg* msg, str publish_body, udomain_t * doma
808 808
         LM_DBG("Received impurecord for presentity being published on [%.*s]\n", aor.len, aor.s);
809 809
 
810 810
         if (reg_state == STATE_TERMINATED) {
811
-            LM_DBG("This impurecord is in STATE_TERMINATED - TODO we should should delete all contacts");
811
+            LM_DBG("This impurecord is in STATE_TERMINATED - TODO we should should delete all contacts\n");
812 812
         } else {
813 813
             /* Now lets process the Contact's from this Registration: */
814 814
             contacts = registrations->children;
... ...
@@ -970,7 +970,7 @@ done:
970 970
     if (expires == -1) expires = subscription_default_expires;
971 971
 
972 972
     if (ret == CSCF_RETURN_TRUE) {
973
-        LM_DBG("Sending 200 OK to publishing user");
973
+        LM_DBG("Sending 200 OK to publishing user\n");
974 974
         subscribe_reply(msg, 200, MSG_REG_PUBLISH_OK, &expires, &scscf_name_str);
975 975
     }
976 976
 
... ...
@@ -1066,7 +1066,7 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
1066 1066
         LM_DBG("Msg has no ttag - this is initial subscribe\n");
1067 1067
         //to tag - doesn't exist in initial request, must use tm to get it
1068 1068
         tmb.t_get_reply_totag(msg, &ttag);
1069
-        LM_DBG("Got to tag from sent response: [%.*s]", ttag.len, ttag.s);
1069
+        LM_DBG("Got to tag from sent response: [%.*s]\n", ttag.len, ttag.s);
1070 1070
         LM_DBG("This is initial subscribe - get presentity URI from req URI\n");
1071 1071
         presentity_uri = cscf_get_public_identity_from_requri(msg);
1072 1072
 
... ...
@@ -1143,7 +1143,7 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
1143 1143
     subscriber_data.version = 1; /*default version starts at 1*/
1144 1144
 
1145 1145
     if (expires > 0) {
1146
-        LM_DBG("expires is more than zero - SUBSCRIBE");
1146
+        LM_DBG("expires is more than zero - SUBSCRIBE\n");
1147 1147
         event_type = IMS_REGISTRAR_SUBSCRIBE;
1148 1148
 
1149 1149
         if (expires < subscription_min_expires) expires = subscription_min_expires;
... ...
@@ -1214,7 +1214,7 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
1214 1214
         ul.unlock_udomain(domain, &presentity_uri);
1215 1215
 
1216 1216
         ret = CSCF_RETURN_TRUE;
1217
-        LM_DBG("Sending 200 OK to subscribing user");
1217
+        LM_DBG("Sending 200 OK to subscribing user\n");
1218 1218
         subscribe_reply(msg, 200, MSG_REG_SUBSCRIBE_OK, &expires, &scscf_name_str);
1219 1219
 
1220 1220
         //do reg event every time you get a subscribe
... ...
@@ -1227,7 +1227,7 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
1227 1227
         }
1228 1228
     } else {
1229 1229
         event_type = IMS_REGISTRAR_UNSUBSCRIBE;
1230
-        LM_DBG("expires is zero or less - UNSUBSCRIBE");
1230
+        LM_DBG("expires is zero or less - UNSUBSCRIBE\n");
1231 1231
 
1232 1232
         ul.lock_udomain(domain, &presentity_uri);
1233 1233
         res = ul.get_impurecord(domain, &presentity_uri, &presentity_impurecord);
... ...
@@ -1238,7 +1238,7 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
1238 1238
         }
1239 1239
         LM_DBG("Received impurecord for presentity being unsubscribed to [%.*s]\n", presentity_impurecord->public_identity.len, presentity_impurecord->public_identity.s);
1240 1240
         //        //get the subscription if it exists
1241
-        LM_DBG("Getting subscription s from usrloc");
1241
+        LM_DBG("Getting subscription s from usrloc\n");
1242 1242
 
1243 1243
         res = ul.get_subscriber(presentity_impurecord, &presentity_uri, &watcher_contact, event_i, &reg_subscriber);
1244 1244
         if (res != 0) {
... ...
@@ -1247,13 +1247,13 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
1247 1247
             ul.unlock_udomain(domain, &presentity_uri);
1248 1248
             goto doneorerror;
1249 1249
         } else {
1250
-            LM_DBG("subscription s exists");
1251
-            LM_DBG("deleting subscriber from usrloc");
1250
+            LM_DBG("subscription s exists\n");
1251
+            LM_DBG("deleting subscriber from usrloc\n");
1252 1252
             ul.external_delete_subscriber(reg_subscriber, (udomain_t*) _t, 0 /*domain is already locked*/);
1253 1253
             ul.unlock_udomain(domain, &presentity_uri);
1254 1254
         }
1255 1255
         ret = CSCF_RETURN_TRUE;
1256
-        LM_DBG("Sending 200 OK to subscribing user");
1256
+        LM_DBG("Sending 200 OK to subscribing user\n");
1257 1257
         subscribe_reply(msg, 200, MSG_REG_UNSUBSCRIBE_OK, &expires, &scscf_name_str);
1258 1258
     }
1259 1259
 
... ...
@@ -1394,14 +1394,14 @@ void create_notifications(udomain_t* _t, impurecord_t* r_passed, str *presentity
1394 1394
 
1395 1395
     int res;
1396 1396
 
1397
-    LM_DBG("Creating notification");
1397
+    LM_DBG("Creating notification\n");
1398 1398
 
1399 1399
     if (r_passed && !presentity_uri && !watcher_contact) {
1400
-        LM_DBG("r_passed and c_passed are valid and presentity uri and watcher_contact is 0 - this must be a ul callback no need to lock domain");
1400
+        LM_DBG("r_passed and c_passed are valid and presentity uri and watcher_contact is 0 - this must be a ul callback no need to lock domain\n");
1401 1401
         r = r_passed;
1402 1402
 
1403 1403
     } else {
1404
-        LM_DBG("This must be a cfg file subscribe need to lock domain and get impurecord");
1404
+        LM_DBG("This must be a cfg file subscribe need to lock domain and get impurecord\n");
1405 1405
         ul.lock_udomain(_t, presentity_uri);
1406 1406
         res = ul.get_impurecord(_t, presentity_uri, &r);
1407 1407
         if (res != 0) {
... ...
@@ -1414,10 +1414,9 @@ void create_notifications(udomain_t* _t, impurecord_t* r_passed, str *presentity
1414 1414
 
1415 1415
     s = r->shead;
1416 1416
     while (s) {
1417
-        LM_DBG("Scrolling through reg subscribers for this IMPU");
1417
+        LM_DBG("Scrolling through reg subscribers for this IMPU\n");
1418 1418
 
1419 1419
         if (s->expires > act_time) {
1420
-            LM_DBG("Expires is greater than current time!");
1421 1420
             subscription_state.s = (char*) pkg_malloc(32 * sizeof (char*));
1422 1421
             subscription_state.len = 0;
1423 1422
             if (subscription_state.s) {
... ...
@@ -1427,22 +1426,18 @@ void create_notifications(udomain_t* _t, impurecord_t* r_passed, str *presentity
1427 1427
                 subscription_state.len = strlen(subscription_state.s);
1428 1428
             }
1429 1429
 
1430
-            LM_DBG("Subscription state: [%.*s]", subscription_state.len, subscription_state.s);
1430
+            LM_DBG("Expires is greater than current time! Subscription state: [%.*s]\n", subscription_state.len, subscription_state.s);
1431 1431
 
1432 1432
         } else {
1433 1433
             STR_PKG_DUP(subscription_state, subs_terminated, "pkg subs state");
1434
-            LM_DBG("Expires is past than current time!");
1435
-            LM_DBG("Subscription state: [%.*s]", subscription_state.len, subscription_state.s);
1434
+            LM_DBG("Expires is past than current time! Subscription state: [%.*s]\n", subscription_state.len, subscription_state.s);
1436 1435
         }
1437 1436
 
1438 1437
         //This is a fix to ensure that when a user subscribes a full reg info is only sent to that UE
1439 1438
         if (event_type == IMS_REGISTRAR_SUBSCRIBE) {
1440 1439
             if (contact_port_ip_match(watcher_contact, &s->watcher_contact) &&
1441 1440
                     (presentity_uri->len == s->presentity_uri.len) && (memcmp(s->presentity_uri.s, presentity_uri->s, presentity_uri->len) == 0)) {
1442
-                LM_DBG("This is a fix to ensure that we only send full reg info XML to the UE that just subscribed");
1443
-                LM_DBG("about to make new notification!");
1444
-
1445
-                LM_DBG("we always increment the local cseq and version before we send a new notification\n");
1441
+                LM_DBG("This is a fix to ensure that we only send full reg info XML to the UE that just subscribed. About to make new notification! We always increment the local cseq and version before we send a new notification\n");
1446 1442
 
1447 1443
                 local_cseq = s->local_cseq + 1;
1448 1444
                 version = s->version + 1;
... ...
@@ -1451,10 +1446,10 @@ void create_notifications(udomain_t* _t, impurecord_t* r_passed, str *presentity
1451 1451
                 n = new_notification(subscription_state, content_type, &impus, num_impus, s, &explit_dereg_contact, num_explit_dereg_contact);
1452 1452
                 if (n) {
1453 1453
                     n->_d = _t;
1454
-                    LM_DBG("Notification exists - about to add it");
1454
+                    LM_DBG("Notification exists - about to add it\n");
1455 1455
                     add_notification(n);
1456 1456
                 } else {
1457
-                    LM_DBG("Notification does not exist");
1457
+                    LM_DBG("Notification does not exist\n");
1458 1458
                 }
1459 1459
             }
1460 1460
         } else {
... ...
@@ -1467,9 +1462,7 @@ void create_notifications(udomain_t* _t, impurecord_t* r_passed, str *presentity
1467 1467
             //                //then we do not send notifications
1468 1468
             //                LM_DBG("This is a UNREGISTER event for a UE that subscribed to its own state that does not unsubscribe to dereg - therefore no notification");
1469 1469
             //            } else {
1470
-            LM_DBG("about to make new notification!");
1471
-
1472
-            LM_DBG("we always increment the local cseq and version before we send a new notification\n");
1470
+            LM_DBG("About to make new notification! We always increment the local cseq and version before we send a new notification\n");
1473 1471
 
1474 1472
             local_cseq = s->local_cseq + 1;
1475 1473
             version = s->version + 1;
... ...
@@ -1478,11 +1471,11 @@ void create_notifications(udomain_t* _t, impurecord_t* r_passed, str *presentity
1478 1478
             n = new_notification(subscription_state, content_type, &impus, num_impus, s, &explit_dereg_contact, num_explit_dereg_contact);
1479 1479
             if (n) {
1480 1480
                 n->_d = _t;
1481
-                LM_DBG("Notification exists - about to add it");
1481
+                LM_DBG("Notification exists - about to add it\n");
1482 1482
                 add_notification(n);
1483 1483
 
1484 1484
             } else {
1485
-                LM_DBG("Notification does not exist");
1485
+                LM_DBG("Notification does not exist\n");
1486 1486
             }
1487 1487
             //            }
1488 1488
         }
... ...
@@ -1566,7 +1559,7 @@ static str uri_e = {"</uri>\n", 7};
1566 1566
 
1567 1567
 static void process_xml_for_explit_dereg_contact(str* buf, str* pad, str explit_dereg_contact) {
1568 1568
 
1569
-    LM_DBG("Processing XML for explicit dereg contact address: <%.*s>", explit_dereg_contact.len, explit_dereg_contact.s);
1569
+    LM_DBG("Processing XML for explicit dereg contact address: <%.*s>\n", explit_dereg_contact.len, explit_dereg_contact.s);
1570 1570
 
1571 1571
     sprintf(pad->s, contact_s_q.s, 1, r_terminated.len, r_terminated.s,
1572 1572
             r_expired.len, r_expired.s, 0);
... ...
@@ -1617,7 +1610,7 @@ static void process_xml_for_contact(str* buf, str* pad, ucontact_t* ptr) {
1617 1617
     STR_APPEND(*buf, *pad);
1618 1618
     STR_APPEND(*buf, uri_s);
1619 1619
 
1620
-    LM_DBG("Appending contact address: <%.*s>", ptr->c.len, ptr->c.s);
1620
+    LM_DBG("Appending contact address: <%.*s>\n", ptr->c.len, ptr->c.s);
1621 1621
 
1622 1622
     STR_APPEND(*buf, (ptr->c));
1623 1623
     STR_APPEND(*buf, uri_e);
... ...
@@ -1676,7 +1669,7 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, int num_impus, str *exp
1676 1676
     int terminate_impu = 1;
1677 1677
 	impu_contact_t *impucontact;
1678 1678
 
1679
-    LM_DBG("Getting reginfo_full");
1679
+    LM_DBG("Getting reginfo_full\n");
1680 1680
 
1681 1681
     STR_APPEND(buf, xml_start);
1682 1682
     sprintf(pad.s, r_reginfo_s.s, reginfo_version, r_full.len, r_full.s);
... ...
@@ -1684,7 +1677,7 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, int num_impus, str *exp
1684 1684
     STR_APPEND(buf, pad);
1685 1685
 
1686 1686
     for (i = 0; i < num_impus; i++) {
1687
-        LM_DBG("Scrolling through public identities, current one <%.*s>", impu_list[i].len, impu_list[i].s);
1687
+        LM_DBG("Scrolling through public identities, current one <%.*s>\n", impu_list[i].len, impu_list[i].s);
1688 1688
         //        if (primary_locked && strncasecmp(impu_list[i].s, primary_impu->s, impu_list[i].len) == 0) {
1689 1689
         //            LM_DBG("Don't need to lock this impu [%.*s]  as its a ul callback so already locked\n", impu_list[i].len, impu_list[i].s);
1690 1690
         //            domain_locked = 0;
... ...
@@ -1706,7 +1699,7 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, int num_impus, str *exp
1706 1706
         }
1707 1707
         //        domain_locked = 1;
1708 1708
 
1709
-        LM_DBG("Retrieved IMPU record");
1709
+        LM_DBG("Retrieved IMPU record\n");
1710 1710
 
1711 1711
         terminate_impu = 1;
1712 1712
 		
... ...
@@ -1722,12 +1715,12 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, int num_impus, str *exp
1722 1722
 			impucontact = impucontact->next;
1723 1723
         }
1724 1724
         if (terminate_impu) {
1725
-            LM_DBG("IMPU reg state has no active contacts so putting in status terminated");
1725
+            LM_DBG("IMPU reg state has no active contacts so putting in status terminated\n");
1726 1726
             sprintf(pad.s, registration_s.s, r->public_identity.len,
1727 1727
                     r->public_identity.s, r, r_terminated.len,
1728 1728
                     r_terminated.s);
1729 1729
         } else {
1730
-            LM_DBG("IMPU has active contacts so putting in status active");
1730
+            LM_DBG("IMPU has active contacts so putting in status active\n");
1731 1731
             sprintf(pad.s, registration_s.s, r->public_identity.len,
1732 1732
                     r->public_identity.s, r, r_active.len, r_active.s);
1733 1733
         }
... ...
@@ -1735,7 +1728,7 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, int num_impus, str *exp
1735 1735
         pad.len = strlen(pad.s);
1736 1736
         STR_APPEND(buf, pad);
1737 1737
 
1738
-        LM_DBG("Scrolling through contact for this IMPU");
1738
+        LM_DBG("Scrolling through contact for this IMPU\n");
1739 1739
         //        if (contact && !domain_locked /* we're dealing with the primary impu most likely related to de-reg */) {
1740 1740
         //            LM_DBG("We're dealing with the primary IMPU here AND a contact was passed in - must have been an explicit dereg\n");
1741 1741
         //            process_xml_for_contact(&buf, &pad, contact); //we do this because in the unlink_contact_from_impu the contact has already gone so we pass it in as a param...
... ...
@@ -1772,7 +1765,7 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, int num_impus, str *exp
1772 1772
         LM_ERR("no more pkg memory\n");
1773 1773
     }
1774 1774
 
1775
-    LM_DBG("Returned full reg-info: [%.*s]", x.len, x.s);
1775
+    LM_DBG("Returned full reg-info: [%.*s]\n", x.len, x.s);
1776 1776
 
1777 1777
     return x;
1778 1778
 }
... ...
@@ -1977,7 +1970,7 @@ void send_notification(reg_notification * n) {
1977 1977
 
1978 1978
     str method = {"NOTIFY", 6};
1979 1979
 
1980
-    LM_DBG("Notification content: [%.*s]", buf.len, buf.s);
1980
+    LM_DBG("Notification content: [%.*s]\n", buf.len, buf.s);
1981 1981
     LM_DBG("DBG:send_notification: NOTIFY about <%.*s>\n", n->watcher_uri.len, n->watcher_uri.s);
1982 1982
 
1983 1983
     h.len = 0;
... ...
@@ -2024,7 +2017,7 @@ void send_notification(reg_notification * n) {
2024 2024
     }
2025 2025
 
2026 2026
     if (buf.len) {
2027
-        LM_DBG("Notification content exists - about to send notification with subscription state: [%.*s] content_type: [%.*s] content: [%.*s] : presentity_uri: [%.*s] watcher_uri: [%.*s]",
2027
+        LM_DBG("Notification content exists - about to send notification with subscription state: [%.*s] content_type: [%.*s] content: [%.*s] : presentity_uri: [%.*s] watcher_uri: [%.*s]\n",
2028 2028
                 n->subscription_state.len, n->subscription_state.s, n->content_type.len, n->content_type.s, buf.len, buf.s,
2029 2029
                 n->presentity_uri.len, n->presentity_uri.s, n->watcher_uri.len, n->watcher_uri.s);
2030 2030
 
... ...
@@ -2032,7 +2025,7 @@ void send_notification(reg_notification * n) {
2032 2032
                 uac_request_cb, 0);
2033 2033
         tmb.t_request_within(&uac_r);
2034 2034
     } else {
2035
-        LM_DBG("o notification content - about to send notification with subscription state: [%.*s] presentity_uri: [%.*s] watcher_uri: [%.*s]",
2035
+        LM_DBG("o notification content - about to send notification with subscription state: [%.*s] presentity_uri: [%.*s] watcher_uri: [%.*s]\n",
2036 2036
                 n->subscription_state.len, n->subscription_state.s, n->presentity_uri.len, n->presentity_uri.s,
2037 2037
                 n->watcher_uri.len, n->watcher_uri.s);
2038 2038
 
... ...
@@ -2078,7 +2071,7 @@ reg_notification * new_notification(str subscription_state,
2078 2078
         len += (*explit_dereg_contact)[i].len;
2079 2079
     }
2080 2080
 
2081
-    LM_DBG("Creating new notification");
2081
+    LM_DBG("Creating new notification\n");
2082 2082
 
2083 2083
     n = (reg_notification*) shm_malloc(len);
2084 2084
     if (n == 0) {
... ...
@@ -2097,61 +2090,61 @@ reg_notification * new_notification(str subscription_state,
2097 2097
     n->call_id.len = r->call_id.len;
2098 2098
     memcpy(p, r->call_id.s, r->call_id.len);
2099 2099
     p += r->call_id.len;
2100
-    LM_DBG("call id: [%.*s]", n->call_id.len, n->call_id.s);
2100
+    LM_DBG("call id: [%.*s]\n", n->call_id.len, n->call_id.s);
2101 2101
 
2102 2102
     n->from_tag.s = p;
2103 2103
     n->from_tag.len = r->from_tag.len;
2104 2104
     memcpy(p, r->from_tag.s, r->from_tag.len);
2105 2105
     p += r->from_tag.len;
2106
-    LM_DBG("from tag: [%.*s]", n->from_tag.len, n->from_tag.s);
2106
+    LM_DBG("from tag: [%.*s]\n", n->from_tag.len, n->from_tag.s);
2107 2107
 
2108 2108
     n->to_tag.s = p;
2109 2109
     n->to_tag.len = r->to_tag.len;
2110 2110
     memcpy(p, r->to_tag.s, r->to_tag.len);
2111 2111
     p += r->to_tag.len;
2112
-    LM_DBG("to tag: [%.*s]", n->to_tag.len, n->to_tag.s);
2112
+    LM_DBG("to tag: [%.*s]\n", n->to_tag.len, n->to_tag.s);
2113 2113
 
2114 2114
     n->watcher_uri.s = p;
2115 2115
     n->watcher_uri.len = r->watcher_uri.len;
2116 2116
     memcpy(p, r->watcher_uri.s, r->watcher_uri.len);
2117 2117
     p += r->watcher_uri.len;
2118
-    LM_DBG("watcher_uri: [%.*s]", n->watcher_uri.len, n->watcher_uri.s);
2118
+    LM_DBG("watcher_uri: [%.*s]\n", n->watcher_uri.len, n->watcher_uri.s);
2119 2119
 
2120 2120
     n->watcher_contact.s = p;
2121 2121
     n->watcher_contact.len = r->watcher_contact.len;
2122 2122
     memcpy(p, r->watcher_contact.s, r->watcher_contact.len);
2123 2123
     p += r->watcher_contact.len;
2124
-    LM_DBG("watcher_contact: [%.*s]", n->watcher_contact.len, n->watcher_contact.s);
2124
+    LM_DBG("watcher_contact: [%.*s]\n", n->watcher_contact.len, n->watcher_contact.s);
2125 2125
 
2126 2126
     n->record_route.s = p;
2127 2127
     n->record_route.len = r->record_route.len;
2128 2128
     memcpy(p, r->record_route.s, r->record_route.len);
2129 2129
     p += r->record_route.len;
2130
-    LM_DBG("record_route: [%.*s]", n->record_route.len, n->record_route.s);
2130
+    LM_DBG("record_route: [%.*s]\n", n->record_route.len, n->record_route.s);
2131 2131
 
2132 2132
     n->sockinfo_str.s = p;
2133 2133
     n->sockinfo_str.len = r->sockinfo_str.len;
2134 2134
     memcpy(p, r->sockinfo_str.s, r->sockinfo_str.len);
2135 2135
     p += r->sockinfo_str.len;
2136
-    LM_DBG("sockinfo_str: [%.*s]", n->sockinfo_str.len, n->sockinfo_str.s);
2136
+    LM_DBG("sockinfo_str: [%.*s]\n", n->sockinfo_str.len, n->sockinfo_str.s);
2137 2137
 
2138 2138
     n->presentity_uri.s = p;
2139 2139
     n->presentity_uri.len = r->presentity_uri.len;
2140 2140
     memcpy(p, r->presentity_uri.s, r->presentity_uri.len);
2141 2141
     p += r->presentity_uri.len;
2142
-    LM_DBG("presentity_uri: [%.*s]", n->presentity_uri.len, n->presentity_uri.s);
2142
+    LM_DBG("presentity_uri: [%.*s]\n", n->presentity_uri.len, n->presentity_uri.s);
2143 2143
 
2144 2144
     n->subscription_state.s = p;
2145 2145
     n->subscription_state.len = subscription_state.len;
2146 2146
     memcpy(p, subscription_state.s, subscription_state.len);
2147 2147
     p += subscription_state.len;
2148
-    LM_DBG("Notification subscription state: [%.*s]", n->subscription_state.len, n->subscription_state.s);
2148
+    LM_DBG("Notification subscription state: [%.*s]\n", n->subscription_state.len, n->subscription_state.s);
2149 2149
 
2150 2150
     n->content_type.s = p;
2151 2151
     n->content_type.len = content_type.len;
2152 2152
     memcpy(p, content_type.s, content_type.len);
2153 2153
     p += content_type.len;
2154
-    LM_DBG("Notification content type: [%.*s]", n->content_type.len, n->content_type.s);
2154
+    LM_DBG("Notification content type: [%.*s]\n", n->content_type.len, n->content_type.s);
2155 2155
 
2156 2156
     n->impus = (str*) p;
2157 2157
     p += sizeof (str) * num_impus;
... ...
@@ -2192,12 +2185,12 @@ reg_notification * new_notification(str subscription_state,
2192 2192
  */
2193 2193
 void add_notification(reg_notification * n) {
2194 2194
 
2195
-    LM_DBG("Adding notification");
2195
+    LM_DBG("Adding notification\n");
2196 2196
     if (!n) {
2197
-        LM_DBG("Notification does not exist");
2197
+        LM_DBG("Notification does not exist\n");
2198 2198
         return;
2199 2199
     } else {
2200
-        LM_DBG("Notification exists");
2200
+        LM_DBG("Notification exists\n");
2201 2201
     }
2202 2202
 	
2203 2203
 	if (max_notification_list_size > 0 && ((notification_list->size+1) > max_notification_list_size )) {
... ...
@@ -2205,7 +2198,7 @@ void add_notification(reg_notification * n) {
2205 2205
 		return;
2206 2206
 	}
2207 2207
 	
2208
-    LM_DBG("Adding to notification list");
2208
+    LM_DBG("Adding to notification list\n");
2209 2209
     lock_get(notification_list->lock);
2210 2210
     n->next = 0;
2211 2211
     n->prev = notification_list->tail;
... ...
@@ -2214,7 +2207,7 @@ void add_notification(reg_notification * n) {
2214 2214
     if (!notification_list->head) notification_list->head = n;
2215 2215
     notification_list->size++;
2216 2216
     if (notification_list_size_threshold > 0 && notification_list->size > notification_list_size_threshold) {
2217
-        LM_WARN("notification_list is size [%d] and has exceed notification_list_size_threshold of [%d]", notification_list->size, notification_list_size_threshold);
2217
+        LM_WARN("notification_list is size [%d] and has exceed notification_list_size_threshold of [%d]\n", notification_list->size, notification_list_size_threshold);
2218 2218
     }
2219 2219
 
2220 2220
     sem_release(notification_list->empty);
... ...
@@ -2254,13 +2247,13 @@ void notification_event_process() {
2254 2254
 
2255 2255
     reg_notification *n = 0;
2256 2256
 
2257
-    LM_DBG("Running notification_event_process");
2257
+    LM_DBG("Running notification_event_process\n");
2258 2258
 
2259 2259
     for (;;) {
2260 2260
         n = get_notification();
2261
-        LM_DBG("About to send notification");
2261
+        LM_DBG("About to send notification\n");
2262 2262
         send_notification(n);
2263
-        LM_DBG("About to free notification");
2263
+        LM_DBG("About to free notification\n");
2264 2264
         free_notification(n);
2265 2265
     }
2266 2266
 }
... ...
@@ -2279,35 +2272,35 @@ dlg_t * build_dlg_t_from_notification(reg_notification * n) {
2279 2279
     dlg_t* td = NULL;
2280 2280
     td = (dlg_t*) pkg_malloc(sizeof (dlg_t));
2281 2281
     if (td == NULL) {
2282
-        LM_ERR("Error ran out of package memory");
2282
+        LM_ERR("Error ran out of package memory\n");
2283 2283
     }
2284 2284
     memset(td, 0, sizeof (dlg_t));
2285 2285
 
2286
-    LM_DBG("Building dlg_t structure");
2286
+    LM_DBG("Building dlg_t structure\n");
2287 2287
 
2288 2288
     td->loc_seq.value = n->local_cseq;
2289
-    LM_DBG("local cseq %d", n->local_cseq);
2289
+    LM_DBG("local cseq %d\n", n->local_cseq);
2290 2290
     td->loc_seq.is_set = 1;
2291 2291
 
2292 2292
     td->id.call_id = n->call_id;
2293
-    LM_DBG("call id %.*s", n->call_id.len, n->call_id.s);
2293
+    LM_DBG("call id %.*s\n", n->call_id.len, n->call_id.s);
2294 2294
 
2295 2295
     td->id.rem_tag = n->from_tag;
2296
-    LM_DBG("ftag %.*s", n->from_tag.len, n->from_tag.s);
2296
+    LM_DBG("ftag %.*s\n", n->from_tag.len, n->from_tag.s);
2297 2297
 
2298 2298
 
2299 2299
     td->id.loc_tag = n->to_tag;
2300
-    LM_DBG("ttag %.*s", n->to_tag.len, n->to_tag.s);
2300
+    LM_DBG("ttag %.*s\n", n->to_tag.len, n->to_tag.s);
2301 2301
 
2302 2302
 
2303 2303
     td->loc_uri = n->presentity_uri;
2304
-    LM_DBG("loc uri %.*s", n->presentity_uri.len, n->presentity_uri.s);
2304
+    LM_DBG("loc uri %.*s\n", n->presentity_uri.len, n->presentity_uri.s);
2305 2305
 
2306 2306
     td->rem_target = n->watcher_contact;
2307
-    LM_DBG("rem target %.*s", n->watcher_contact.len, n->watcher_contact.s);
2307
+    LM_DBG("rem target %.*s\n", n->watcher_contact.len, n->watcher_contact.s);
2308 2308
 
2309 2309
     td->rem_uri = n->watcher_uri;
2310
-    LM_DBG("rem uri %.*s", n->watcher_uri.len, n->watcher_uri.s);
2310
+    LM_DBG("rem uri %.*s\n", n->watcher_uri.len, n->watcher_uri.s);
2311 2311
 
2312 2312
     if (n->record_route.s && n->record_route.len) {
2313 2313
         if (parse_rr_body(n->record_route.s, n->record_route.len,
... ...
@@ -50,13 +50,13 @@ extern str scscf_name_str;
50 50
 
51 51
 void ul_impu_inserted(impurecord_t* r, ucontact_t* c, int type, void* param) {
52 52
 
53
-    LM_DBG("Received notification of UL IMPU insert for IMPU <%.*s>", r->public_identity.len, r->public_identity.s);
53
+    LM_DBG("Received notification of UL IMPU insert for IMPU <%.*s>\n", r->public_identity.len, r->public_identity.s);
54 54
 
55
-    LM_DBG("Registering for callbacks on this IMPU for contact insert, update, delete or expire to send notifications if there are any subscriptions");
55
+    LM_DBG("Registering for callbacks on this IMPU for contact insert, update, delete or expire to send notifications if there are any subscriptions\n");
56 56
     ul.register_ulcb(r, 0, UL_IMPU_NEW_CONTACT, ul_contact_changed, 0); //this allows us to receive cbs on new contact for IMPU
57 57
     ul.register_ulcb(r, 0, UL_IMPU_UPDATE_CONTACT | UL_IMPU_EXPIRE_CONTACT | UL_IMPU_DELETE_CONTACT | UL_IMPU_DELETE_CONTACT_IMPLICIT, ul_contact_changed, 0);
58 58
 
59
-    LM_DBG("Selectively asking for expire or no contact delete callbacks only on the anchor of the implicit set so that we only send one SAR per implicit set");
59
+    LM_DBG("Selectively asking for expire or no contact delete callbacks only on the anchor of the implicit set so that we only send one SAR per implicit set\n");
60 60
     if (r->is_primary) {
61 61
         //TODO only do this if a flag in the IMPU record identifies this as the implicit set anchor
62 62
         if (ul.register_ulcb(r, 0, UL_IMPU_REG_NC_DELETE | UL_IMPU_UNREG_EXPIRED, ul_impu_removed, 0) < 0) {
... ...
@@ -72,7 +72,7 @@ void ul_impu_removed(impurecord_t* r, ucontact_t* c, int type, void* param) {
72 72
 
73 73
     //we only send SAR if the REGISTRATION state is (NOT) IMPU_NOT_REGISTERED and if send_sar_on_delete is set
74 74
     //send_sar_on_delete is set by default - only unset if impu is deleted due to explicit dereg
75
-    LM_DBG("Received notification of UL IMPU removed for IMPU <%.*s>", r->public_identity.len, r->public_identity.s);
75
+    LM_DBG("Received notification of UL IMPU removed for IMPU <%.*s>\n", r->public_identity.len, r->public_identity.s);
76 76
 
77 77
     if (r->reg_state != IMPU_NOT_REGISTERED && r->send_sar_on_delete) {
78 78
         LM_DBG("Sending SAR to DeRegister [%.*s] (pvt: <%.*s>)\n",
... ...
@@ -85,15 +85,15 @@ void ul_impu_removed(impurecord_t* r, ucontact_t* c, int type, void* param) {
85 85
 
86 86
 void ul_contact_changed(impurecord_t* r, ucontact_t* c, int type, void* param) {
87 87
 
88
-    LM_DBG("Received notification of type %d on contact Address <%.*s>", type, c->c.len, c->c.s);
88
+    LM_DBG("Received notification of type %d on contact Address <%.*s>\n", type, c->c.len, c->c.s);
89 89
     
90 90
     if(!r->shead) {
91
-        LM_DBG("There are no subscriptions for this IMPU therefore breaking out now as nothing to do");
91
+        LM_DBG("There are no subscriptions for this IMPU therefore breaking out now as nothing to do\n");
92 92
         return;
93 93
     }
94 94
 //    
95 95
     if (type == UL_IMPU_DELETE_CONTACT) {
96
-        LM_DBG("Received notification of UL CONTACT DELETE");
96
+        LM_DBG("Received notification of UL CONTACT DELETE\n");
97 97
         event_reg(0, r, IMS_REGISTRAR_CONTACT_UNREGISTERED, 0, 0, 0, 0);
98 98
     }
99 99
 }