Janusz Starzyk
2004-Feb-24 15:26 UTC
[Asterisk-Users] painful first steps with * and SIP phones
I hope, you do not mind few questions from the newbie: As a first after installing the Asterisk I try to make it working with two PCs and Xten-Lite installed. Both PCs have fixed IP addresses but they log in to Asterisk only if configured in sip.conf with host=dynamic. Why? I have them defined in the default context in extensions.conf as: exten => 621,1,Dial(SIP/621,20) exten => 621,2,Voicemail(u621) exten => 621,3,Hangup exten => 621,102,Voicemail(b621) exten => 621,103,Hangup exten => 622,1,Dial(SIP/622,20) exten => 622,2,Voicemail(u622) exten => 622,3,Hangup exten => 622,102,Voicemail(b622) exten => 622,103,Hangup in the sip.conf I put for each sip phone the following (<x> equals 1 and 2 respectively) [62<x>] type=friend secret=<password> host=dynamic username=62<x> dtmfmode=inband mailbox=62<x> callerid="<name>" context=default The Xten-Lite has dtmfmode set to inband too. When I try to call from one phone the other one, I get voicemail saying the other party is unavailable. Moreover, I can not navigate in the voicemail as the key press seems to be not received or unrecognized by the voicemail. ON the Asterisk console I get the following messages: Executing Dial("SIP/621-2cea","SIP/622|20") in new stack Specify address with base=0xNNNNN Called 622 Feb 24, WARNING[-1126650960]: chan_sip.c:495 retrans_pkt: Maximum retries exceeded on call ........ for seqno 102 (Request) No one is available to answer at this time Executing Voicemail...... Playing 'vm-theperson' Feb 24 WARNING[-1231549520]: dsp.c:1424 ast_dsp_process: Unable to process inband DTMF on 2 frames -- repeated many times Can somebody please help and suggest any corrections? Thanks, Janusz
Jan Larsen
2004-Feb-24 16:44 UTC
[Asterisk-Users] painful first steps with * and SIP phones
Hi I have the same setup as You. Here are my sip.conf , extensions.conf and modules.conf that is currently on my system. Just copy and paste, change numbers and reload.......... This is my sip.conf which I have on my system and it is working. It is a modified eksample file ; 2003-04-24 05:06 GMT jtodd@loligo.com ; ; This is the sip.conf file for John Todd's Asterisk ; server. Asterisk can be found on http://www.asterisk.org/ ; ; More recent versions of this file can be found on: ; http://www.loligo.com/asterisk/ ; ; ; SIP Configuration for Asterisk ; [general] ;disallow=gsm ;allow=ulaw port = 5060 ; Port to bind to bindaddr = 0.0.0.0 ; Address to bind to context = local ; Default for incoming calls callerid=No CallID ; Other general settings for the SIP channels that are used ; ; tos=['lowdelay', 'throughput', 'reliability', 'mincost', or 'none'] ; Sets Type Of Service flags (?) ; ; maxexpirey=3600 ; Max duration (seconds) of incoming registration allowed ; ; defaultexpirey=120 ; Default length of incoming/outoing registrations ; ; ; Under each peer/user/friend, you can specify some additional notes: ; tos=['lowdelay', 'throughput', 'reliability', 'mincost', or 'none'] ; ; My SIP phones in the house/office are listed below ; ; By my own convention (and to save my sanity) I have given ; all the ATA-186 devices in my network "extensions" that ; are numeric. I picked "2200" to start for historical ; laziness. Again, for my sanity, I also made the usernames ; on the phone identical to the extension number of the ; channel. ; ; I distribute IP addresses with a DHCP server to these phones, ; on the network 204.91.156.0/24 or behind a NAT (for some) ; ; All the Cisco ATA-186 units I have are on "real" IP addresses, ; and I haven't experimented with NAT yet. NAT has been a real ; PITA with the ATA's, and I don't relish having to make it work. ; ; Anytime a call is dialed from "2203" or "2204", it will be ; parsed by the context [intern] in the extensions.conf file ; ; If you want the message waiting light to light up, or stutter ; dialtone, you can set mailbox=[mbox#] - note you can also ; set a comma-delimited list of mailboxes if you want multiples. ; ; You can use "permit=x.x.x.x/yy" lists for hosts that are dynamic ; ; You don't need to register SIP peers that are static (host=) ; ; Setting "nat=1" is required to get the "Via:" headers to be configured ; correctly so that the Ciscos (and others?) will re-register when ; they are behind a NAT. If nat=1 is set, it will not harm non-NAT ; connections on the Ciscos, but there are reports of other phones ; (pingtel) not working if you have nat=1 set and the phone is not ; behind a NAT. ; [2201] ; X-Lite client 2201 type=friend secret=<password> auth=md5 nat=1 ; we assume clients are behind NAT host=dynamic ; and have dynamic IP addresses reinvite=no ; if so, we need to make them canreinvite=no ; always go through Asterisk qualify=1000 dtmfmode=rfc2833 ; To be used with dub-fix.diff to avoid dubble dtmf tones callerid="any name" <2201> disallow=all allow=ulaw ; since we chose 'inband' for dtmf we must use g.711 allow=alaw ; add whatever other codecs we fancy context=local ; use a context that exists ;-) mailbox=2201 [2202] ; X-lite client 2202 type=friend secret=<password> auth=md5 nat=1 ; we assume clients are behind NAT host=dynamic ; and have dynamic IP addresses reinvite=no ; if so, we need to make them canreinvite=no ; always go through Asterisk qualify=1000 dtmfmode=rfc2833 ; To be used with dub-fix.diff to avoid dubble dtmf tones callerid="any name" <2202> disallow=all allow=ulaw ; since we chose 'inband' for dtmf we must use g.711 allow=alaw ; add whatever other codecs we fancy context=local ; use a context that exists ;-) mailbox=2202 This is my extensions.conf which I have on my system and it is working. It is a modified eksample file ; 2003-04-24 05:06 GMT jtodd@loligo.com ; ; This is the extensions.conf file for John Todd's Asterisk ; server. Asterisk can be found on http://www.asterisk.org/ ; ; More recent versions of this file can be found on: ; http://www.loligo.com/asterisk/ ; ; ; The "General" category is for certain variables. All other categories ; are interpreted as extension contexts ; ; ; If static is set to no, or omitted, then the pbx_config will rewrite ; this file when extensions are modified. Remember that all comments ; made in the file will be lost when that happens. ; ; XXX Not yet implemented XXX ; ; if stati=yes and writeprotect=no, you can save dialplan by ; CLI command 'save dialplan' too [general] static=yes writeprotect=yes ; The [globals] context is where you can set variables that ; can be referenced elsewhere in the dialplan with ${VARIABLE} ; ; I decided that for ease of reference, I should create a variable ; called "PHONE1" that I could set to the phone where I normally ; am found. I then set "ME" to be my extention, raw, for use ; with voicemail forwarding. ; ; Variable "PHONE2" is the other ATA-186 in the house. ; I create variables here so that if I decide to update my ; extensions list, or my dial-out interface list, it's just ; a simple variable change here at the top of the file. ; [globals] PHONE1=SIP/2201 PHONE1VM=2201 PHONE2=SIP/2202 PHONE2VM=2202 TRUNK=CAPI ; The [intern] context is where I pass all calls ; that are dialed by the SIP phones in my house/office. ; I name these phones in the sip.conf file when I define the ; SIP peers. ; ; This context is the "main" context that gets used for outbound ; calls out of the house. It, in turn, calls other contexts ; which contain bits and pieces of other places that it's possible ; to dial from my house phone. I've split them up into many sub-segments ; so that they are re-usable if I should decide to allow other ; persons or organizations access some of those dialplan parts ; in some future configuration. My older extensions.conf had many ; fewer contexts, but I have opted to build this version with more ; flexible use of "include" commands to make my life easier for ; future configuration chores. ; ;[intern] ;exten => _.,1,NoOp ;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] ; Send calls to operator (private PSTN gateway, analog line in my house) ;include => operator ; Send 911 calls to emergency outbound (private PSTN gateway, analog line in my house) ;include => e911 ; If someone dials a "9" in front of their number, send out via analog (private PSTN gateway) ;include => forced-analog ; If someone dials one of the 22xx numbers that are local (SIP phones in my house) ;include => local ;[operator] ; Handle calls to the Operator ("9") ; ; All Operator calls go to the analog line, since ; that is the only place that there is an operator ; on duty. At some point, this extension will lead ; a particular person in the office. ; ; Note that one can reach the operator by dialing "90" ; according to the pattern sets below, but I include ; just a single "9" as this system will be used by ; persons who are not used to dialing prefixes for ; their phone calls. ; ; I have to build an international dialing plan ; shortly to use a different iconnect account, which ; has international rate plans. Currently, the system ; simply does not allow interational dialing (011...) ; unless it's sent out to the local analog via the "9" ; prefix below. ; ;exten => 9,1,Dial(${DIALOUTANALOG}/${EXTEN},70) ;exten => 9,2,Macro(fastbusy) ;exten => 9,102,Playback(ss-noservice) ;exten => 9,103,Macro(fastbusy) ;[e911] ; EMERGENCY OUTBOUND ; ; United States dialing supports "911" emergency calls ; which are routed to the "closest" emergency contact center. ; ; Of course, you need to make sure that the center to which ; you are connecting is actually able to do something useful ; for the dialer; it doesn't make sense to have your NY branch ; offices dialing a 911 center in San Francisco. ; ; Note: The ATA-186 is auto-configured to send "911" ; directly to the SIP server with no delay. Be very, very ; careful when experimenting with this - the system does not ; follow standard rules with 911 calls. ; ; If you're !(USA), feel free to comment this context out entirely. ; ;exten => 911,1,Dial(${DIALOUTANALOG}/${EXTEN}) ;exten => 911,2,Macro(fastbusy) ;[forced-analog] ; This is for failure-case outbound dialing. If for some reason ; the outbound SIP connections aren't working, but aren't giving errors ; (i.e.: my path to larger Internet is dead) then I can short-circuit ; my way to the local analog dial port by dialing "91npaxxxyyyy" and ; the call will be shunted out the analog port. This is for when ; the inevitable cry of "IT DOESN'T WORK!!" is screamed from the ; living room by She Who Makes Calls. ; ;exten => _9.,1,Dial(${DIALOUTANALOG}/${EXTEN:1},70,Tt) ;exten => _9.,2,Macro(fastbusy) ;exten => _9.,102,Macro(fastbusy) ; The [inbound-analog] context is where calls coming in from the ; zaptel X100P analog circuit are passed. Right now, this ; is a very simple dial plan that rings my two SIP phones. ; ; First, send the call through Zapateller. If there's no callerid, ; the system will answer the line, play a quick two-tone "re-order" ; signal which will cause many telemarketer systems to register the ; number as "out of order" and remove it from their lists. If the ; caller is a human, they'll jump to the next step... ; ; Next, if desired, start recording the call with the record-on ; macro. See my notes on legality. Make sure to clean up the ; calls with the record-cleanup macro in the "h" extension. ; Since I don't have the "called" number at this point (I only ; have "s") I will fill in what normally is ${EXTEN} in the ; macro call with the static ${MYHOMEPHONE} variable. ; Recording commented out and replaced by NoOp. ; ; The PrivacyManager will only work if the caller has no caller ID ; information in the inbound call. The PrivacyManager application ; will then give the caller 3 attempts to enter in a 10 digit phone ; number. That number then becomes the CallerID, and the call ; process is continued. ; ; Ring both SIP phones in the house that are "general" lines. ; ; If the lines ring for >20 seconds, play an amusing message and ; then dial the "u"navaialable voicemail box. ; If the lines are busy, dial the "b"usy voicemail box. ; ; See the file zapata.conf for how to configure the Zaptel X100P ; to forward calls to this context when called ; ; Handels incomming call on ISDN Bri [incomming-ISDN2] exten => s,1,NoOp exten => s,2,Dial(${PHONE1},35,Ttm) exten => s,3,Voicemail(u${PHONE1VM}) exten => s,104,Hangup ; The [local] context is where I put all of the locally dialable ; numbers. These entries could be made in each context where I ; reference them, but that would be redundant. ; ; Mostly, they are used from context [intern] right now, but I'm sure ; I'll include them in other contexts later. ; ; Note: due to my wacky/kludgey prefix dialing crap, all the "internal" ; extensions that are local to this system must begin with a "2" ; This means that voicemail, echo, all users, etc. must have an extension ; that starts with the digit "2" or one of the other dialplans will ; snag the call and do whatever with it. This is sub-optimal for a ; system with hundreds of extensions, but for my purposes it works ; just fine. ; Furthermore, all of "my" extensions begin with 220, since I don't ; expect to have more than 10 phones. My friends can then have ; extension plans with 221X or 222X or whatever, and we won't ; overlap. ; ; ; 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. ; [local] ; ; Test ISDN2 access exten => _0XXX.,1,StripMSD,1 exten => _XXX.,2,Dial,CAPI/*:bBYEXTENSION ; 2201 is my test Phone ; exten => 2201,1,Dial(${PHONE1},60,t) ; Ring for 60 seconds exten => 2201,2,Voicemail(u${EXTEN}) ; Unavail voicemail if extension doesn't answer exten => 2201,3,Hangup exten => 2201,102,Voicemail(b${EXTEN}) ; Busy Voicemail if extension is busy exten => 2201,103,Hangup ; 2202 is my test Phone ; exten => 2202,1,Dial(${PHONE2},60,t) ; Ring for 60 seconds exten => 2202,2,Voicemail(u${EXTEN}) ; Unavail voicemail if extension doesn't answer exten => 2202,3,Hangup exten => 2202,102,Voicemail(b${EXTEN}) ; Busy Voicemail if extension is busy exten => 2202,103,Hangup ; Dial 3000 from any phone to go to the voicemail system ; exten => 3000,1,Wait,2 exten => 3000,2,VoicemailMain(${EXTEN}) exten => 3000,3,Hangup This is my modules.conf which I have on my system and it is working. It is a modified eksample file ; ; Asterisk configuration file ; ; Module Loader configuration file ; [modules] autoload=yes ; ; If you want, load the GTK console right away. ; Don't load the KDE console since ; it's not as sophisticated right now. ; noload => pbx_gtkconsole.so ;load => pbx_gtkconsole.so noload => pbx_kdeconsole.so ; ; Intercom application is obsoleted by ; chan_oss. Don't load it. ; noload => app_intercom.so ; ; Explicitly load the chan_modem.so early on to be sure ; it loads before any of the chan_modem_* 's afte rit ; load => chan_modem.so load => res_musiconhold.so ; ; MUST to be loaded before chan_capi.so load => res_parking.so ; ; Load capi driver load => chan_modem_i4l.so load => chan_capi.so ; Load either OSS or ALSA, not both ; By default, load OSS only (automatically) and do not load ALSA ; ;noload => chan_alsa.so noload => chan_oss.so ; ; Module names listed in "global" section will have symbols globally ; exported to modules loaded after them. ; [global] chan_modem.so=yes res_parking.so=yes chan_capi.so=yes Regards Jan Larsen ----- Original Message ----- From: "Janusz Starzyk" <jstarzyk@adres.pl> To: <asterisk-users@lists.digium.com> Sent: Tuesday, February 24, 2004 11:26 PM Subject: [Asterisk-Users] painful first steps with * and SIP phones> I hope, you do not mind few questions from the newbie: > > As a first after installing the Asterisk I try to make it working with two > PCs and Xten-Lite installed. > Both PCs have fixed IP addresses but they log in to Asterisk only if > configured in sip.conf with host=dynamic. Why? > > I have them defined in the default context in extensions.conf as: > > exten => 621,1,Dial(SIP/621,20) > exten => 621,2,Voicemail(u621) > exten => 621,3,Hangup > exten => 621,102,Voicemail(b621) > exten => 621,103,Hangup > > exten => 622,1,Dial(SIP/622,20) > exten => 622,2,Voicemail(u622) > exten => 622,3,Hangup > exten => 622,102,Voicemail(b622) > exten => 622,103,Hangup > > in the sip.conf I put for each sip phone the following (<x> equals 1 and 2 > respectively) > > [62<x>] > type=friend > secret=<password> > host=dynamic > username=62<x> > dtmfmode=inband > mailbox=62<x> > callerid="<name>" > context=default > > The Xten-Lite has dtmfmode set to inband too. > > When I try to call from one phone the other one, I get voicemail sayingthe> other party is unavailable. > Moreover, I can not navigate in the voicemail as the key press seems to be > not received or unrecognized by the voicemail. > > ON the Asterisk console I get the following messages: > > Executing Dial("SIP/621-2cea","SIP/622|20") in new stack > Specify address with base=0xNNNNN > Called 622 > Feb 24, WARNING[-1126650960]: chan_sip.c:495 retrans_pkt: Maximum retries > exceeded on call ........ for seqno 102 (Request) > No one is available to answer at this time > Executing Voicemail...... > Playing 'vm-theperson' > Feb 24 WARNING[-1231549520]: dsp.c:1424 ast_dsp_process: Unable toprocess> inband DTMF on 2 frames -- repeated many times > > Can somebody please help and suggest any corrections? > > Thanks, > Janusz > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >