[Freeswitch-svn] [commit] r3190 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia

Freeswitch SVN mikej at freeswitch.org
Tue Oct 24 23:45:20 EDT 2006


Author: mikej
Date: Tue Oct 24 23:45:20 2006
New Revision: 3190

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/switch_channel.c

Log:
update more sip cause code to qsig cause code mappings from rfc 4497 sections 8.4.1 and 8.4.4

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Tue Oct 24 23:45:20 2006
@@ -680,8 +680,11 @@
 	SWITCH_CAUSE_USER_BUSY = 17,
 	SWITCH_CAUSE_NO_USER_RESPONSE = 18,
 	SWITCH_CAUSE_NO_ANSWER = 19,
+	SWITCH_CAUSE_SUBSCRIBER_ABSENT = 20,
 	SWITCH_CAUSE_CALL_REJECTED = 21,
 	SWITCH_CAUSE_NUMBER_CHANGED = 22,
+	SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION = 23,
+	SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR = 25,
 	SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER = 27,
 	SWITCH_CAUSE_INVALID_NUMBER_FORMAT = 28,
 	SWITCH_CAUSE_FACILITY_REJECTED = 29,
@@ -699,9 +702,11 @@
 	SWITCH_CAUSE_INCOMING_CALL_BARRED = 54,
 	SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH = 57,
 	SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL = 58,
+	SWITCH_CAUSE_SERVICE_UNAVAILABLE = 63,
 	SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL = 65,
 	SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED = 66,
 	SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED = 69,
+	SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED = 79,
 	SWITCH_CAUSE_INVALID_CALL_REFERENCE = 81,
 	SWITCH_CAUSE_INCOMPATIBLE_DESTINATION = 88,
 	SWITCH_CAUSE_INVALID_MSG_UNSPECIFIED = 95,

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Tue Oct 24 23:45:20 2006
@@ -1075,7 +1075,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-// map QSIG cause codes to SIP ala RFC4497
+// map QSIG cause codes to SIP from RFC4497 section 8.4.1
 static int hangup_cause_to_sip(switch_call_cause_t cause) {
 	switch (cause) {
 		case SWITCH_CAUSE_UNALLOCATED: 
@@ -1088,9 +1088,12 @@
 			return 408;
 		case SWITCH_CAUSE_NO_ANSWER:
 			return 480;
+		case SWITCH_CAUSE_SUBSCRIBER_ABSENT:
+			return 480;
 		case SWITCH_CAUSE_CALL_REJECTED:
 			return 603;
 		case SWITCH_CAUSE_NUMBER_CHANGED:
+		case SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION:
 			return 410;
 		case SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER:
 			return 502;
@@ -1114,6 +1117,7 @@
 		case SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL:
 			return 488;
 		case SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED:
+		case SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED:
 			return 501;
 		case SWITCH_CAUSE_INCOMPATIBLE_DESTINATION:
 			return 503;
@@ -2026,7 +2030,7 @@
 	return match;
 }
 
-// map sip responses to QSIG cause codes ala RFC4497
+// map sip responses to QSIG cause codes ala RFC4497 section 8.4.4
 static switch_call_cause_t sip_cause_to_freeswitch(int status) {
 	switch (status) {
 		case 200:
@@ -2072,6 +2076,15 @@
 			return SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL;
 		case 502:
 			return SWITCH_CAUSE_NETWORK_OUT_OF_ORDER;
+		case 405:
+			return SWITCH_CAUSE_SERVICE_UNAVAILABLE;
+		case 406:
+		case 415:
+		case 501:
+			return SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED;
+		case 482:
+		case 483:
+			return SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR;
 		default: 
 			return SWITCH_CAUSE_NORMAL_UNSPECIFIED;
 	}

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Oct 24 23:45:20 2006
@@ -48,8 +48,11 @@
 	{ "USER_BUSY", SWITCH_CAUSE_USER_BUSY },
 	{ "NO_USER_RESPONSE", SWITCH_CAUSE_NO_USER_RESPONSE },
 	{ "NO_ANSWER", SWITCH_CAUSE_NO_ANSWER },
+	{ "SUBSCRIBER_ABSENT", SWITCH_CAUSE_SUBSCRIBER_ABSENT },
 	{ "CALL_REJECTED", SWITCH_CAUSE_CALL_REJECTED },
 	{ "NUMBER_CHANGED", SWITCH_CAUSE_NUMBER_CHANGED },
+	{ "REDIRECTION_TO_NEW_DESTINATION", SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION },
+	{ "EXCHANGE_ROUTING_ERROR", SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR },
 	{ "DESTINATION_OUT_OF_ORDER", SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER },
 	{ "INVALID_NUMBER_FORMAT", SWITCH_CAUSE_INVALID_NUMBER_FORMAT },
 	{ "FACILITY_REJECTED", SWITCH_CAUSE_FACILITY_REJECTED },
@@ -67,9 +70,10 @@
 	{ "INCOMING_CALL_BARRED", SWITCH_CAUSE_INCOMING_CALL_BARRED },
 	{ "BEARERCAPABILITY_NOTAUTH", SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH },
 	{ "BEARERCAPABILITY_NOTAVAIL", SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL },
-	{ "BEARERCAPABILITY_NOTIMPL", SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL },
+	{ "SERVICE_UNAVAILABLE", SWITCH_CAUSE_SERVICE_UNAVAILABLE },
 	{ "CHAN_NOT_IMPLEMENTED", SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED },
 	{ "FACILITY_NOT_IMPLEMENTED", SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED },
+	{ "SERVICE_NOT_IMPLEMENTED", SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED },
 	{ "INVALID_CALL_REFERENCE", SWITCH_CAUSE_INVALID_CALL_REFERENCE },
 	{ "INCOMPATIBLE_DESTINATION", SWITCH_CAUSE_INCOMPATIBLE_DESTINATION },
 	{ "INVALID_MSG_UNSPECIFIED", SWITCH_CAUSE_INVALID_MSG_UNSPECIFIED },



More information about the Freeswitch-svn mailing list