Question : music on hold

hi,
i had configured 10 extentions in which from 2000-2005 can make external calls
2006-2010 can not make external calls. now i want that when ever those 10 extentions hold the call music on hold should play.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
extensions.conf
===============
 
[internal] 
; this is the section for internal calls every phone can dial
exten => 2000,1,Dial(SIP/2000)
exten => 2001,1,Dial(SIP/2001)
exten => 2002,1,Dial(SIP/2002)
exten => 2003,1,Dial(SIP/2003)
exten => 2004,1,Dial(SIP/2004)
exten => 2005,1,Dial(SIP/2005)
exten => 2006,1,Dial(SIP/2006)
exten => 2007,1,Dial(SIP/2007)
exten => 2008,1,Dial(SIP/2008)
exten => 2009,1,Dial(SIP/2009)
exten => 2010,1,Dial(SIP/2010) 
 
[external]
; place your dialplan entries to make external calls here.
 
[permitall]
; put phones in this context to enable them to make any phone call
include => internal
include => external
 
[denyexternal]
; put phones in this context to permit only internal calls
include => internal
 
 
 
sip.conf
========
 
[general]
port = 5060
bindaddr = 0.0.0.0
context = others 
 
[2000]
type=friend
context=my-phones
secret=1234
host=dynamic 
context=permitall
 
[2002]
type=friend
context=my-phones
secret=1234
host=dynamic 
context=permitall
 
[2003]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=permitall
 
[2004]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=permitall
 
[2005]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=permitall
 
 
[2006]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=denyexternal
 
[2007]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=denyexternal
 
[2008]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=denyexternal
 
[2009]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=denyexternal
 
[2010]
type=friend
contex=my-phones
secret=1234
host=dynamic 
context=denyexternal

Answer : music on hold

You would just use the following to ring the phone for up to 60 seconds and then hangup if it was not answered.

exten => 2000,1,Dial(SIP/2000,60)
exten => 2000,n,Hangup

I dont know of a way to automatically hangup if a person is on hold for more than 60 seconds. Its not a feature asterisk supports directly.

You might be able to make use of the asterisk agent system. Have a look at http://www.voip-info.org/wiki/view/Asterisk+call+queues.
In theory you could define a queue for each extension and instead of the user putting people on hold they can transfer them to the queue. They can pickup the queue to unhold or if the person is in a queue for more than a specified amout of time they jump out and the next command can be to hangup.
I havent used queues before myself so cannot help that much.

Perhaps if you describe exactly what you are trying to acomplish as an end result we might be able to suggest alternative ways of doing it.
Random Solutions  
 
programming4us programming4us