[Asterisk-Users] Call Waiting on SIP phones

Walker Haddock whaddock at datacrest.com
Wed Oct 22 20:20:47 MST 2003


> 
> I tried to duplicate your problem, but I couln't, could you please let me
> know the exact calling situation, so I could try and duplicate it. Also
> noted that you have a repeat SIP number in your Dial command for extension
> 203 (don't think that could impact it).
Paul,

Well, the repeat SIP number was a typo.  I was creating an example of what
my exten looked like.  I'm actually using a macro.  I have a variable which
contains all of the extensions that need to ring when an incomming call comes
in.  There are 5 SIP extensions that we are presently ringing.  I am
also running a loop.  I let it ring for 11 seconds and then redial.  After
4 passes through the loop it drops out to the unavailable voicemail.

So, I have a T1 PRI.  A call comes in and I match the DNIS.  That exten executes
the Dial app with the extensions like in my example.

What happens is that one of the extensions will answer and the Dial app will
stop dialing and bridge the call from the Zap channel to the SIP channel that
answered the call.

If another call comes in while the caller is still bridged, they get dialed again
by the exten Dial app.  Because the GS has horrible call waiting indicator, it
disrupts the call.

I have been looking at running an AGI script that calls manager to get a list 
of the channels, ie 'show channels' and regex out the SIP channels that are
in use.  Then I could remove them from the string holding the extensions to dial.

I was working on that when I read your email in the list.  It would be great if
you could get it working.

Maybe the difference between my setup and yours is because I am receiving calls
from the Zap channels to the SIP channels.  I saw where you were testing between
softw SIP phones and the GS phones.

Asterisk CVS-09/24/03-20:51:12 built by root at asterisk on a i686 running Linux
Pentium IV 2.4GH, 512MB RAM, SCSI disks.

Here is my extensions.conf file in total:
[general]

;these lines prevent you from rewriting the extensions.conf from the CLI
;we don't really recommend you try to do so, it's safer to edit the
;extensions.conf and run 'reload' at the CLI (which will not drop calls)

static=yes
writeprotect=yes
[globals]
FACIMILE=ZAP/25
PHONE200=SIP/200      ; Kathy
PHONE201=SIP/201      ; Workroom
PHONE202=SIP/202      ; Shannon
PHONE203=SIP/203      ; Tim
PHONE204=SIP/204      ; Conference 1
PHONE205=SIP/205      ; Conference 2
PHONE206=SIP/206      ; Katie
PHONE207=SIP/207      ; Kitchen
PHONE208=SIP/208      ; Reception
PHONE209=SIP/209      ; Storage Room
PHONE210=SIP/210      ; Recorder Work Room
PHONE211=SIP/211      ; Spare

RECEPTION=${PHONE208}&${PHONE200}&${PHONE201}&${PHONE202}&${PHONE206}&${PHONE207}

; Caller ID info
COMPANYNAME="XXX"
MAINNUMBER=NPANXXNXXX
FACIMILENUMBER =NPANXXNXXX

[macro-oneline]
exten => s,1,Dial(${ARG1},30,Tt)
exten => s,2,Voicemail(u${MACRO_EXTEN})
exten => s,3,Hangup
exten => s,102,Voicemail(u${MACRO_EXTEN})
exten => s,103,Hangup


[bogon-calls]
;
; Take unknown callers that may have found
; our system, and send them to a re-order tone.
;

exten => _.,1,Congestion


[incoming]

;exten => s,1,Dial(${RECEPTION},30,t)

; We're going to ring all of the RECEPTION extensions
; for 11 seconds and then dial them again.  We're doing
; this so that if a person gets off of their phone they
; will be able to answer a new call without running to
; another person's desk.
; The parser is picky, picky, picky.  Watch those $ and spaces!

exten => 1050,1,SetVar(Loop=0)
exten => 1050,2,Dial(${RECEPTION},11,t)
exten => 1050,3,SetVar(Loop=$[${Loop} + 1])
exten => 1050,4,Gotoif($[${Loop} < 4]?1050|2:1050|103)
exten => 1050,5,Hangup
exten => 1050,103,Voicemail2(u299)
exten => 1050,104,Hangup

; exten => 1050,1,Dial(${RECEPTION},30,t)
; exten => 1050,2,Voicemail2(u299)
; exten => 1050,3,Hangup
; exten => 1050,102,Voicemail2(u299)
; exten => 1050,103,Hangup
;
exten => 0553,1,ChanIsAvail(${RECEPTION})
exten => 0553,2,Dial(${AVAILCHAN:0:7},30,t)
exten => 0553,3,Voicemail2(u299)
exten => 0553,4,Hangup
exten => 0553,103,Voicemail2(u299)
exten => 0553,104,Hangup

;exten => 0553,1,Dial(${RECEPTION},30,t)
:
;exten => 0553,2,Voicemail2(u299)
;exten => 0553,3,Hangup
;exten => 0553,102,Voicemail2(u299)
;exten => 0553,103,Hangup

exten => 0554,1,Dial(${RECEPTION},30,t)
exten => 0554,2,Voicemail2(u299)
exten => 0554,3,Hangup
exten => 0554,102,Voicemail2(u299)
exten => 0554,103,Hangup

exten => 0555,1,Dial(${RECEPTION},30,t)
exten => 0555,2,Voicemail2(u299)
exten => 0555,3,Hangup
exten => 0555,102,Voicemail2(u299)
exten => 0555,103,Hangup

exten => 0556,1,Dial(${RECEPTION},30,t)
exten => 0556,2,Voicemail2(u299)
exten => 0556,3,Hangup
exten => 0556,102,Voicemail2(u299)
exten => 0556,103,Hangup

exten => 0557,1,Dial(${RECEPTION},30,t)
exten => 0557,2,Voicemail2(u299)
exten => 0557,3,Hangup
exten => 0557,102,Voicemail2(u299)
exten => 0557,103,Hangup

exten => 0558,1,Dial(${RECEPTION},30,t)
exten => 0558,2,Voicemail2(u299)
exten => 0558,3,Hangup
exten => 0558,102,Voicemail2(u299)
exten => 0558,103,Hangup

exten => 0023,1,Dial(${FACIMILE},30)
exten => 0023,2,Congestion
exten => 0023,102,Congestion


[dialout]

;CHANGED 9/29/03 9 is not required.  wh
;
;first step is to strip the 9 from the call, and not send it to Ma Bell.
;in short, stripmsd will strip the number of digits specified from the
;beginning of the dialed string.  It will move on to the next priority
;in the new extension (i.e. _9NXXXXXX became _NXXXXXX when we stripped
;the '9' For a bit more info do 'show application stripmsd' from the
;asterisk CLI

;extension matches are preceeded by an underscore.  other chars are either
;absolute digits or 'N' (for any number greater than 1) or 'X' (for any
;number

;exten => _9NXXXXXX,1,StripMSD,1
exten => _NXXXXXX,1,SetCallerID(${MAINNUMBER})
exten => _NXXXXXX,2,SetCIDName(${COMPANYNAME})
exten => _NXXXXXX,3,Dial,Zap/g1/BYEXTENSION

;exten => _91NXXNXXXXXX,1,StripMSD,1
exten => _1NXXNXXXXXX,1,SetCallerID(${MAINNUMBER})
exten => _1NXXNXXXXXX,2,SetCIDName(${COMPANYNAME})
exten => _1NXXNXXXXXX,3,Dial,Zap/g1/BYEXTENSION

;exten => _9911,1,StripMSD,1
exten => _911,1,SetCallerID(${MAINNUMBER})
exten => _911,2,SetCIDName(${COMPANYNAME})
exten => _911,3,Dial,Zap/g1/BYEXTENSION


;
; This macro takes two arguments: ARG1 is the phone number
;  to be dialed (including leading "1") and ARG2 is the
;  number of seconds that we should wait for an answer.
;
[macro-dialoutvoice]
exten => s,1,SetCallerID(${MAINNUMBER})
exten => s,3,Dial(ZAP/${ARG1}@iconnect,${ARG2})
exten => s,4,Playback(new/acnt-or-cir-busy-now)
exten => s,5,Hangup
exten => s,104,Playback(new/acnt-or-cir-busy-now)
exten => s,105,Wait,3
exten => s,106,Playtones(congestion)
exten => s,107,Wait,30
exten => s,108,Playback(new/are-you-still-here)
exten => s,108,Hangup


; When I dial something that throws an error, I expect
;  to get a re-order (fast busy) tone.  Well, since this
;  system is more intelligent than that, I'd like to hear
;  a bit more about what kind of error happened.  However,
;  that isn't in the system yet, so I have to play an "all-circuits-busy"
;  message that I recorded myself.  I'd really rather know
;  what the SIP (or ISDN, or whatever) error code was so that
;  I could play a message appropriate to the error (hint, hint, kram)
;
[macro-fastbusy]
exten => s,1,Answer
exten => s,2,Wait 1
exten => s,3,Playback(new/all-circuits-busy)
exten => s,4,Wait(30)
exten => s,5,Hangup


[intern]
exten => _.,1,NoOp
;exten => _.,1,Macro(record-on,${EXTEN},${CALLERIDNUM})
exten => _.,2,Goto(intern-post,${EXTEN},1)


; After we set up some initial housekeeping things in the [intern] context,
;  the [intern-post] context is jumped to, which is where the true dialplans
;  are kept.
;
[intern-post]

; Phones in the 'intern' context can dial other 'intern' phones and dial out
include => local
include => dialout
include => parkedcalls

[local]

; First extension (office) in the house
;
; Note that I try to keep extension names and numbers
;  identical.  You don't need to be bound to this
;  method.
;
; Note that many internal extensions do not time out to voicemail.
;


; Kathy 200 Grandstream Sip Phone
;
exten => 200,1,Macro(oneline,${PHONE200})

; Workroom 201 Grandstream Sip Phone
;
exten => 201,1,Macro(oneline,${PHONE201})

; Shannon 202 Grandstream Sip Phone
;
exten => 202,1,Macro(oneline,${PHONE202})

; Tim 203 Grandstream Sip Phone
;
exten => 203,1,Macro(oneline,${PHONE203})

; Conference 1 204 Grandstream Sip Phone
;
exten => 204,1,Macro(oneline,${PHONE204})

; Conference 2 205 Grandstream Sip Phone
;
exten => 205,1,Macro(oneline,${PHONE205})

; Katie 206 Grandstream Sip Phone
;
exten => 206,1,Macro(oneline,${PHONE206})

; Kitchen 207 Grandstream Sip Phone
;
exten => 207,1,Macro(oneline,${PHONE207})

; Reception 208 Grandstream Sip Phone
;
exten => 208,1,Macro(oneline,${PHONE208})

; Storage Room 209 Grandstream Sip Phone
;
exten => 209,1,Macro(oneline,${PHONE209})

; Recorder Work Room 210 Grandstream Sip Phone
;
exten => 210,1,Macro(oneline,${PHONE210})

; Spare 211 Grandstream Sip Phone
;
exten => 211,1,Macro(oneline,${PHONE211})

; 270 Meetme conference 1
;
exten => 270,1,MeetMe(270|p)
exten => 270,2,Hangup
exten => 270,102,Congestion()

; 271 Meetme conference 2
;
exten => 271,1,MeetMe(271|p)
exten => 271,2,Hangup
exten => 271,102,Congestion()

; 290 Fax
;
exten => 290,1,Dial(${FACIMILE},30)
exten => 290,2,Hangup
exten => 290,102,Congestion()

exten => 299,1,Wait,2
exten => 299,2,Voicemail(u299)
exten => 299,3,Hangup
exten => 299,103,Hangup


; Extensions to check voicemail from Grandstream phones


exten => 6200,1,Wait,2
exten => 6200,2,VoicemailMain2(s200)
exten => 6200,3,Hangup
exten => 6200,103,Hangup

exten => 6202,1,Wait,2
exten => 6202,2,VoicemailMain2(s202)
exten => 6202,3,Hangup
exten => 6202,103,Hangup

exten => 6203,1,Wait,2
exten => 6203,2,VoicemailMain2(s203)
exten => 6203,3,Hangup
exten => 6203,103,Hangup

exten => 6206,1,Wait,2
exten => 6206,2,VoicemailMain2(s206)
exten => 6206,3,Hangup
exten => 6206,103,Hangup

exten => 6299,1,Wait,2
exten => 6299,2,VoicemailMain2(s299)
exten => 6299,3,Hangup
exten => 6299,103,Hangup

; Dial 6500 from any phone to go to the voicemail system
;
exten => 6500,1,Wait,2
exten => 6500,2,VoicemailMain2
exten => 6500,3,Hangup
.....
Walker




More information about the asterisk-users mailing list