[asterisk-commits] murf: branch murf/bug7433 r47634 - in
/team/murf/bug7433: channels/ doc/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Nov 14 17:02:37 MST 2006
Author: murf
Date: Tue Nov 14 18:02:37 2006
New Revision: 47634
URL: http://svn.digium.com/view/asterisk?view=rev&rev=47634
Log:
added some advice to the queues doc, removed some logging
Modified:
team/murf/bug7433/channels/chan_sip.c
team/murf/bug7433/doc/queues-with-callback-members.txt
Modified: team/murf/bug7433/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug7433/channels/chan_sip.c?view=diff&rev=47634&r1=47633&r2=47634
==============================================================================
--- team/murf/bug7433/channels/chan_sip.c (original)
+++ team/murf/bug7433/channels/chan_sip.c Tue Nov 14 18:02:37 2006
@@ -2941,7 +2941,7 @@
static int update_call_counter(struct sip_pvt *fup, int event)
{
char name[256];
- int *inuse, *call_limit, *inringing;
+ int *inuse=NULL, *call_limit=NULL, *inringing=NULL;
int outgoing = ast_test_flag(&fup->flags[0], SIP_OUTGOING);
struct sip_user *u = NULL;
struct sip_peer *p = NULL;
@@ -13065,6 +13065,8 @@
parse_ok_contact(p, req);
} else { /* Re-invite on existing call */
ast_clear_flag(&p->flags[0], SIP_OUTGOING); /* This is now an inbound dialog */
+ /* aught not something be done here, to make sure the devicestate
+ * is proper in the sip_user struct? */
/* Handle SDP here if we already have an owner */
if (find_sdp(req)) {
if (process_sdp(p, req)) {
@@ -14919,7 +14921,6 @@
struct hostent *hp;
struct ast_hostent ahp;
struct sip_peer *p;
- struct sip_user *u;
int res = AST_DEVICE_INVALID;
@@ -14931,69 +14932,38 @@
if (option_debug > 2)
ast_log(LOG_DEBUG, "Checking device state for peer %s\n", host);
- u = find_user(host, 1);
- if (!u) {
- ast_log(LOG_NOTICE,"**USER(%s) Not Found. Choices:", host);
- ASTOBJ_CONTAINER_TRAVERSE(&userl, 1, do {
- ASTOBJ_RDLOCK(iterator);
- ast_log(LOG_NOTICE,"==%s== ", iterator->name);
- ASTOBJ_UNLOCK(iterator);
- } while (0) );
- }
if ((p = find_peer(host, NULL, 1))) {
if (p->addr.sin_addr.s_addr || p->defaddr.sin_addr.s_addr) {
/* we have an address for the peer */
/* if qualify is turned on, check the status */
if (p->maxms && (p->lastms > p->maxms)) {
res = AST_DEVICE_UNAVAILABLE;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
} else {
/* qualify is not on, or the peer is responding properly */
/* check call limit */
if (p->call_limit && (p->inUse == p->call_limit)) {
res = AST_DEVICE_BUSY;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
} else if (p->onHold) {
res = AST_DEVICE_ONHOLD;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
} else if (p->inRinging && p->inRinging == p->inUse) {
res = AST_DEVICE_RINGING;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
} else if (p->inRinging) {
res = AST_DEVICE_RINGINUSE;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
} else if (p->inUse) {
res = AST_DEVICE_INUSE;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
} else {
res = AST_DEVICE_NOT_INUSE;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
- if (u)
- ast_log(LOG_NOTICE, "sip_devicestate(%s) USER: call_limit=%d, inUse=%d\n", host, u->call_limit, u->inUse);
}
}
} else {
/* there is no address, it's unavailable */
res = AST_DEVICE_UNAVAILABLE;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) returning %s call-lim=%d, inuse=%d, onHold=%d, inRinging=%d, maxms=%d, lastms=%d\n",
- host, devstate2str(res), p->call_limit, p->inUse, p->onHold, p->inRinging, p->maxms, p->lastms);
}
ASTOBJ_UNREF(p,sip_destroy_peer);
- } else if (u) {
- ast_log(LOG_NOTICE, "sip_devicestate(%s): ====Peer not set====; User: call_limit=%d, inUse=%d\n", host, u->call_limit, u->inUse);
} else {
hp = ast_gethostbyname(host, &ahp);
if (hp) {
res = AST_DEVICE_UNKNOWN;
- ast_log(LOG_NOTICE, "sip_devicestate(%s) #### NO PEER or USER#### returning %s\n",
- host, devstate2str(res));
}
}
Modified: team/murf/bug7433/doc/queues-with-callback-members.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug7433/doc/queues-with-callback-members.txt?view=diff&rev=47634&r1=47633&r2=47634
==============================================================================
--- team/murf/bug7433/doc/queues-with-callback-members.txt (original)
+++ team/murf/bug7433/doc/queues-with-callback-members.txt Tue Nov 14 18:02:37 2006
@@ -522,3 +522,10 @@
In the above examples, some of the possible error checking has been omitted,
to reduce clutter and make the examples clearer.
+If SIP devices are being used with queues, you will want to
+specify limitpeersonly=yes in the [general] section of the sip.conf
+file; it will help keep devicestate visible and correct for your
+sip extensions, with regards to "in use", "ringing", "not in use", etc,
+with respect to queues. Queues use this information to determine
+whether or not the agent is available for calling.
+
More information about the asterisk-commits
mailing list