Adding busy-level to the SIP_PEER() dialplan function.
authorOlle Johansson <oej@edvina.net>
Mon, 19 Nov 2007 09:12:27 +0000 (09:12 +0000)
committerOlle Johansson <oej@edvina.net>
Mon, 19 Nov 2007 09:12:27 +0000 (09:12 +0000)
With this, you can control the peer in the dialplan, so you avoid placing outbound
calls when the device has reached busy-level.
Reported by pj.

Closes bug #11180

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89406 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9651233..106368c 100644 (file)
@@ -12988,6 +12988,8 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat
                ast_copy_string(buf, peer->regexten, len);
        } else  if (!strcasecmp(colname, "limit")) {
                snprintf(buf, len, "%d", peer->call_limit);
+       } else  if (!strcasecmp(colname, "busylevel")) {
+               snprintf(buf, len, "%d", peer->busy_level);
        } else  if (!strcasecmp(colname, "curcalls")) {
                snprintf(buf, len, "%d", peer->inUse);
        } else  if (!strcasecmp(colname, "accountcode")) {
@@ -13052,6 +13054,7 @@ struct ast_custom_function sippeer_function = {
        "- status                Status (if qualify=yes).\n"
        "- regexten              Registration extension\n"
        "- limit                 Call limit (call-limit)\n"
+       "- busylevel             Configured call level for signalling busy\n"
        "- curcalls              Current amount of calls \n"
        "                        Only available if call-limit is set\n"
        "- language              Default language for peer\n"