~davewalker/ubuntu/maverick/asterisk/lp_705014

« back to all changes in this revision

Viewing changes to apps/app_softhangup.c

  • Committer: Bazaar Package Importer
  • Author(s): Kilian Krause
  • Date: 2005-03-09 22:09:05 UTC
  • mto: (1.2.1 upstream) (8.2.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050309220905-9afy6hcpw96xbr6j
Tags: upstream-1.0.6
ImportĀ upstreamĀ versionĀ 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include <asterisk/channel.h>
18
18
#include <asterisk/pbx.h>
19
19
#include <asterisk/module.h>
 
20
#include <asterisk/lock.h>
20
21
#include <stdlib.h>
21
22
#include <unistd.h>
22
23
#include <string.h>
23
24
#include <stdlib.h>
24
25
 
25
 
#include <pthread.h>
26
 
 
27
 
 
28
26
static char *synopsis = "Soft Hangup Application";
29
27
 
30
28
static char *tdesc = "Hangs up the requested channel";
47
45
                return 0;
48
46
        }
49
47
        LOCAL_USER_ADD(u);
50
 
        c = ast_channel_walk(NULL);
 
48
        c = ast_channel_walk_locked(NULL);
51
49
        while (c) {
52
50
                if (!strcasecmp(c->name, data)) {
53
51
                        ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);
 
52
                        ast_mutex_unlock(&c->lock);
54
53
                        break;
55
54
                }
56
 
                c = ast_channel_walk(c);
 
55
                ast_mutex_unlock(&c->lock);
 
56
                c = ast_channel_walk_locked(c);
57
57
        }
58
58
        LOCAL_USER_REMOVE(u);
59
59