Revision
14720
Author
gmaruzz
Date
2009-09-01 13:26:23 -0500 (Tue, 01 Sep 2009)

Log Message

celliax: caller_id, when there is no name associated with the number, use the number as name

Modified Paths

Diff

Modified: freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c (14719 => 14720)


--- freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c	2009-09-01 18:04:01 UTC (rev 14719)
+++ freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c	2009-09-01 18:26:23 UTC (rev 14720)
@@ -655,9 +655,22 @@
 				tech_pvt->interface_state = SKYPIAX_STATE_RING;
 				tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING;
 				DEBUGA_SKYPE("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", SKYPIAX_P_LOG,
-							 tech_pvt->line_array.result[i],
-							 tech_pvt->callid_name[0] != 1 ? tech_pvt->callid_name : "not available",
-							 tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available");
+						tech_pvt->line_array.result[i],
+						(strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) ? tech_pvt->callid_name : "not available",
+						strlen(tech_pvt->callid_number) ? tech_pvt->callid_number : "not available");
+
+				if(!strlen(tech_pvt->callid_number)){
+					strcpy(tech_pvt->callid_number, "not available") ;
+				}
+
+				if( !strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) {
+					strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)) ;
+				}
+
+				DEBUGA_SKYPE("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", SKYPIAX_P_LOG,
+						tech_pvt->line_array.result[i],
+						(strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) ? tech_pvt->callid_name : "CUCU",
+						strlen(tech_pvt->callid_number) ? tech_pvt->callid_number : "CUCU");
 			}
 
 			if ((strcmp(tech_pvt->line_array.result[i], "BUSY") == 0)) {