[asterisk-commits] mmichelson: branch mmichelson/realtime-sip-devicestate r99968 - /team/mmichel...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 23 13:18:07 CST 2008


Author: mmichelson
Date: Wed Jan 23 13:18:07 2008
New Revision: 99968

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99968
Log:
Now realtime sip peers also show the "ringing" state correctly.


Modified:
    team/mmichelson/realtime-sip-devicestate/channels/chan_sip.c

Change Statistics:
 0 files changed

Modified: team/mmichelson/realtime-sip-devicestate/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/realtime-sip-devicestate/channels/chan_sip.c?view=diff&rev=99968&r1=99967&r2=99968
==============================================================================
--- team/mmichelson/realtime-sip-devicestate/channels/chan_sip.c (original)
+++ team/mmichelson/realtime-sip-devicestate/channels/chan_sip.c Wed Jan 23 13:18:07 2008
@@ -3276,9 +3276,10 @@
 		ast_log(LOG_ERROR, "update_call_counter(%s, %d) called with no event!\n", name, event);
 	}
 	if (p) {
-		char usestr[20];
+		char usestr[20], ringstr[20];
 		snprintf(usestr, sizeof(usestr), "%d", *inuse);
-		ast_update_realtime("sippeers", "name", p->name, "inuse", usestr, NULL);
+		snprintf(ringstr, sizeof(ringstr), "%d", inringing ? *inringing : p->inRinging);
+		ast_update_realtime("sippeers", "name", name, "inuse", usestr, "inringing", ringstr, NULL);
 		ast_device_state_changed("SIP/%s", p->name);
 		ASTOBJ_UNREF(p, sip_destroy_peer);
 	} else /* u must be set */
@@ -16674,11 +16675,14 @@
 			peer->maxcallbitrate = atoi(v->value);
 			if (peer->maxcallbitrate < 0)
 				peer->maxcallbitrate = default_maxcallbitrate;
-		}
-		else if (realtime && !strcasecmp(v->name, "inuse")) {
+		} else if (realtime && !strcasecmp(v->name, "inuse")) {
 			peer->inUse = atoi(v->value);
 			if (peer->inUse < 0)
 				peer->inUse = 0;
+		} else if (realtime && !strcasecmp(v->name, "inringing")) {
+			peer->inRinging = atoi(v->value);
+			if (peer->inRinging < 0)
+				peer->inRinging = 0;
 		}
 	}
 	if (!ast_test_flag(&global_flags[1], SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC) && realtime) {




More information about the asterisk-commits mailing list