login | register
Sat 17 of May, 2008 [19:12 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Juan Ortega, Thu 15 of May, 2008 [10:33 UTC]: Hi everybody, I'm Juan, an ITCom student, and I need to know what basic elements I need to create a VoIP network. Can anybody helpme, please?,Thank you very much
  • gineta, Wed 14 of May, 2008 [03:58 UTC]: any here not fine the configuration of firewall juniper -screem for VOIP asterisk????
  • Anoop Prabhakaran, Tue 13 of May, 2008 [12:16 UTC]: I am developing Asterisk IVR, Whenever i make a internation call to the IVR system, the DTMF is not getting detected properly, this happens only for the first time, second call onwards system works fine. why this is happening
  • joe, Mon 12 of May, 2008 [04:27 UTC]: Is there an opensource browser based softphone, or a system like Busta where everything is not manages through their website?
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
Server Stats
  • Execution time: 0.40s
  • Memory usage: 2.28MB
  • Database queries: 30
  • GZIP: Disabled
  • Server load: 0.77

Asterisk ZAP channels

The Zap Channel Module provides an interface layer between Asterisk on the one side, and the Zaptel interface drivers on the other side. These drivers, in turn, provide the ability to use interface cards to connect your PBX to traditional digital and analog telephone equipment:

Asterisk <--> chan_zap.so <-> zaptel.ko (kernel) <-> device driver <-> Zaptel device <-> Phone/switch/PSTN


  • /etc/asterisk/zapata.conf - configuration file of The Asterisk Zaptel channel (chan_zap.so) is configured through . This is generally the first place to look for configuration.
  • /etc/asterisk/users.conf - Some configuration options from Zapata.conf may also be used in users.conf.
  • /etc/zaptel.conf - Some lower-level configuration applied directly to spans and channels.
  • Specific kernel parameters can be used to change the behaviour of drivers.

Using the Dial Command with Zap Channels

Recall that the format of the Dial command is like this:

   Dial(type/identifier,timeout,options)

For Zap channels, the type is always Zap. The timeout and options parts are explained on the Dial page.

The identifier parameter can be made up of a number of parts. It can be a little complex:

   chanspec[c][d][rcadence][/phonenumber]

  • chanspec: specifies which Zap channel or channel group, as defined in the configuration file, you want to use. It can be one of three types:
    • one of the letters g, G, r, or R followed by a Zap channel group number. See "Dialing a Group", below.
    • for analog Zap interfaces: a simple channel number. Example: 1 means Zap channel 1.
    • for PRI Zap interfaces: a span number, then a hyphen, then a port number. Example: 1-2 means Zap span 1, port 2.

  • If the letter c follows, then "Answer Confirmation" is requested, in which the call is not considered answered until the called user presses #.

  • If the letter d follows, and the channel is an ISDN PRI channel, then the channel will be "made digital", whatever that means. If you are not getting ringing/busy feedback on your PRI, using the 'd' option may fix your problem!

  • If the letter r and a number follow, that number specifies which "distinctive ring" style to use. See "Distinctive Ring Styles", below. Note that specifying a distinctive ring makes sense only when you are ringing an internal extension (e.g. the channel is connected by an FXS interface).

  • phonenumber, if present, specifies which telephone number you wish to be connected with. Note that this makes sense only when you are dialing a telephone line (an FXO or PRI interface), not an internal extension. Within the phone number, you may use the special modifier w to indicate a half-second pause. You might want to use this to wait for a dialtone or for a pause while dialing digits. "w would normally indicate a "wait", but putting it at the end of your dialstring will cause asterisk to assume the number before is "complete"."(sic! ~markster). This is usefull if you have the situation of calls where the cdr-records are truncated due to outbound overlapdial. You may also use the special modifier c to allow for clear channel connections between PRI ports.



Here are some examples of complete Dial commands as they might appear in your Dialplan:

   exten => s,1,Dial(Zap/1)            ; Ring extension on channel 1
   exten => s,1,Dial(Zap/1r2)          ; Ring extension on channel 1 with distinctive ring #2
   exten => s,1,Dial(Zap/1,30)         ; Ring extension on channel 1 with 30 second timeout
   exten => s,1,Dial(Zap/2/5551234)    ; Dial 5551234 on channel 2
   exten => s,1,Dial(Zap/2c/5551234)   ; Dial 5551234 on channel 2 with answer confirmation
   exten => s,1,Dial(Zap/2/ww5551234)  ; Wait 1 second then dial 5551234 on channel 2
   exten => s,1,Dial(Zap/2/5551234w)   ;  Assume the number is complete, then dial 5551234 on channel 2
   exten => s,1,Dial(Zap/g1/5551234)   ; Dial 5551234 on the first available channel in group 1
   exten => s,1,Dial(Zap/1-2/1234)     ; Dial 1234 on span 1, port 2
   exten => s,1,Dial(Zap/1-2/c1234)    ; Dial 1234 on span 1, port 2, with PRI clear channel option

Dialing a Group

In the Zap Channel Module's configuration file (zapata.conf), you can define groups of Zap channels that get treated as a single channel as far as the Dial command is concerned. You specify which of four methods the Zap channel module is to use to select a non-busy channel from the channel group by prefixing the group number with one of the letters g, G, r, or R:

  • g: select the lowest-numbered non-busy Zap channel (aka. ascending sequential hunt group).
  • G: select the highest-numbered non-busy Zap channel (aka. descending sequential hunt group).
  • r: use a round-robin search, starting at the next highest channel than last time (aka. ascending rotary hunt group).
  • R: use a round-robin search, starting at the next lowest channel than last time (aka. descending rotary hunt group).

The round-robin searches make the Zap channel module start looking for an available channel from a different channel number each time. For each channel group, the Zap channel module keeps track of the last round-robin start point, and this time starts checking availability from either the next (lowercase r)) or the previous uppercase R channel in the group. Which channel it actually finds available (if any) does not affect the starting point for the next round-robin search. Calls to the Dial command using ordinary (g or G) group selections do not affect future round-robin starting points either.

For example, if you have defined channel group 2 as containing Zap channels 1, 2, 5 and 8, and the last round-robin search for this group (group 2) began searching from channel 5, this is the order of searching that the Zap channel module will use for the four possible selection methods:

  • Dial(Zap/g2...): Looks in order 1, 2, 5, 8
  • Dial(Zap/G2...): Looks in order 8, 5, 2, 1
  • Dial(Zap/r2...): Looks in order 8, 1, 2, 5
  • Dial(Zap/R2...): Looks in order 2, 1, 8, 5

Distinctive Ring Styles

The four distinctive ring styles that the Zaptel driver can generate when ringing a Zap-connected handset are:
  1. Quick chirp followed by long ring
  2. British style ring
  3. Three quick chirps
  4. Short ring followed by long ring
If you do not specify any distinctive ring style, then the ring style used depends on your the country code specified by defaultzone in your Zaptel configuration file, zaptel.conf. The default ring style for a particular country setting may be one of the above four, or it may be a fifth style.

NOTE: You can also add you own custom ring styles by adding cadence= lines to your zapata.conf file.
  • The format for the cadence command is ontime,offtime,ontime,offtime .... etc in ms.
  • A negative number indicates where to place the Caller ID spill.
  • The new ring styles will be assigned 'r' numbers from 1 and up depending on how many cadence= lines you have; they replace the default definitions. (This may only apply to 1.2.x or later.)
  • Ring styles can also be hard coded in asterisk by editing chan_zap.c.

Zap ring styles are NOT defined anywhere in the Zapata source.

NOTICE: The ring styles (and also the defintion of the "dialtone", "busy", "ringing", etc tones) are defined by the Zaptel driver. You can not change the definitions without recompiling the zaptel driver (see Zaptel Installation). The settings in your indications.conf file do not have any effect on the tones and ring styles generated by the Zaptel driver.

Detecting Distinctive Ring on Incoming Calls

Your telco may let you use the one analog telephone line for several different phone numbers. Your telco will make your incoming lilne ring in different ways depending on which number the caller dialed.

The Zap channel module can be configured to detect up to three different distinctive ring styles in addition to your normal ring pattern. First of all, you must enable distinctive ring detection by setting usedistinctiveringdetection=yes in your zapata.conf file. Then you can use the dringn and dringncontext keywords to describe (a) the pattern of ring cadences your telco uses, and (b) which context a call matching that cadence should go into. Calls not matching any of your defined distinctive ring styles go to the regular context you defined for this channel.

The distinctive ring detection feature is still rather experimental. Apparently it assumes that if your telco provides distinctive ring, you must also be getting caller ID, which is of course an invalid assumption. If you are in the US, you may have more success with distinctive ring detection than the rest of us.

Note that enabling distinctive ring detection will mean that Asterisk will have to let the phone ring a two or three times to see what kind of ring style it is using. Only after it has done that will it ring your handsets. So you may think you've answered the phone after the first ring, but your callers will tell you that they heard a ringing signal maybe four times before you picked up.

You describe a distinctive ring pattern to Asterisk by giving it three integers. Apparently the only way you can find out which numbers to use is to enable distinctive ring detection and then enter the Asterisk console in verbose mode. When a call comes in, Asterisk will apparently report the three numbers it sees as representing the ring tone it heard, and you can use these numbers in a dring definition. If you discovered that the three numbers it reports are: 325, 95, 0, then you would put this into your zapata.conf:

   usedistinctiveringdetection=yes
   dring1=325,95,0
   dring1context=mycontext

If you have multiple distinctive ring styles, you may add entries for dring2 and dring3.

Here are some ring patterns other people have suggested:

  • 95,0,0
  • 325,95,0
  • 367,0,0
  • 247,0,0

SBC\Wisconsin uses the following:
  • 337,0,0 - Distinctive Ring 1
  • 337,312,0 - Distinctive Ring 2

They may use them in other states as well, report back here and let us know!

For Australian users, who have Caller ID enabled and Distinctive Ring, you might find that asterisk cannot detect your distinctive ring. This is logged in the issue tracker as bug 1007 (and bug 3596). There is a patch available attached to bug 3596 to enable this, but cant be added to asterisk because the author of the original patch is unknown and the there isnt a disclaimer for the patch from the author. If there is somebody who could write the patch again (it may need improvement) and submit the required paper work to the asterisk developers, this would be great :)

Names of Established Zap Connections

When you have an established Zap connection, its channel name will be in this format:

   Zap/channel-instance

channel is the channel number and instance is a number from 1 to 3 representing which of up to 3 logical channels associated with a single physical channel this is.

   Zap/1-1  First call appearance on Zap channel 1
   Zap/3-2  Second call appearance on Zap channel 3

Note that using the ChanIsAvail command will return channel names in this format.

The Cut command can be useful for extracting the channel type from a full channel name. Let's say that the variable Foo has the value "Zap/1-2":

   Cut(ChannelType=Foo,/,1)

Now variable ChannelType has the value "Zap". You could use the GotoIf command to check that a channel is a Zap channel:

   GotoIf($[${ChannelType} = Zap]?10)

If you wish to extract just the channel number from a channel name, you might use two Cuts. If variable Foo has the value "Zap/1-2", then after these steps, variable Bar will have the value "1":

   Cut(Bar=Foo,/,2})
   Cut(Bar=Bar,-,1)

Built-in Extension Numbers

There are some "extension numbers" that are built into the Zap channel module. You may override these in your Dialplan, i.e. these are used only if the number dialed does not match any of your Dialplan extension patterns.

Some of them will only be used if a specific configuration option in zapata.conf is enabled for the channel.
Ext.zapata.conf Action
*0 Send hook flash
*67 Disable Caller ID
*69callreturn Say last caller's Caller ID ("call return")
*70callwaiting Disable call waiting (for current call)
*72cancallforward Activate "call forward immediate"
*73cancallforward Deactivate "call forward immediate"
*78Enable "Do Not Disturb"
*79Disable "Do Not Disturb"
*60Add last caller's caller ID to blacklist
*82Enable Caller ID (only if disabled with *67)


In addition, there are other codes that are not specific to the Zap channel module:

   *8# Callgroup pickup


Pulse Dialing

The Zap channel drivers also work fine with pulse dialing on analog channels.

The configuration option for that is:

 pulsedial=yes

For more information, see:


ISDN Data Services

If you are connecting an ISDN interface through a Zap channel, and you wish to provide ISDN data services (PPP over ISDN), then you need to refer to the ZapRAS command, and refer to the following four configuration options in zapata.conf: idledial, idleext, minunused, minidle.

There is support for GR303 in the Zap channel since June 2004


Analog Dial

When dialing on an analog zap channel and the dialtone does not come up instantly, adding the w (wait) to the front of the number for a 1/2 sec pause usually works. Some analog lines however take a random time to provide the dialtone and just adding w's is not the best solution. What I did was use a macro that checks if the line is silent or not before dialing and that seems to have done the trick, as below:

   macro-dialanalog
   exten => s,1,NoOp
   exten => s,n(clear),   Dial(${DIALOUTANALOG}|${ARG2}|M(dialanalogcont^${ARG1}))
   exten => s,clear+101,  Set(MACRO_OFFSET=100)
   
   macro-dialanalogcont
   exten => s,1,NoOp
   exten => s,n(silence), WaitForSilence(100)
   exten => s,n,          GotoIf($"${WAITSTATUS}" = "SILENCE"?silence) ; Loop if silence is detected
   exten => s,n(realdial),SendDTMF(${ARG1})
   exten => s,n,          Goto(end)
   exten => s,n(end),     Macro(record-on)


Troubleshooting

Missing libpri

Symptom: chan_zap fails to load (no 'zap' in the CLI). In the logs you see the error:

  chan_zap.c: Unknown signalling method 'pri_cpe'

Cause: chan_zap.so in Asterisk was built without support for libpri. libpri was not installed when you ran ./configure before building asterisk.

Fix: Rebuild asterisk and make sure libpri is supported.

 $ strings channels/chan_zap.so | grep pri_cpe
 pri_cpe


See also



Asterisk | Channels
Created by oej, Last modification by Tzafrir Cohen on Tue 01 of Apr, 2008 [09:15 UTC]

Comments Filter

Dial more than one extension on different timeouts at a time

by dhineshkumar on Friday 16 of May, 2008 [11:29:55 UTC]
As i know we can dial more than extension at a time in single dial command like :
<br>
     $AGI->exec('Dial', 'SIP/316&SIP/315|10' );
<br><br><br>
But it used to exit the call on all the extension after 10 seconds,

But the need the below scenario :<br>   
   * All the extension need to dial at a same time,<br>   
   * But the ringing duration( timeout ) on that extension should be differed on extension wise.<br>

Is it possible in single dial(), or any other way.
<br><br><br>

THANKS in Advance

Re: flash button not working

by Hans Feringa on Thursday 23 of August, 2007 [11:16:19 UTC]
In the zaptel drivers (1.4.5; don't know before that) you can configure a short flash time in the zconfig.h file:
/*
* Uncomment if you have a European phone, or any other phone with a
*  short flash time.
* This will stop the flash being mis-detected as a pulse dial "1" on
*  phones with short flashes
*/
/* #define SHORT_FLASH_TIME */

Recompile/install after changing this.

Help with Context

by Tim on Friday 14 of April, 2006 [13:18:30 UTC]
I am using asterisk@home 2.8 beta. I have one PSTN line coming in on a X100P with 2 telephone numbers one of which is on a distinctive ring. I also have a VOIP for incoming on another trunk. What I am trying to do is get the 3 different incoming numbers to go to 3 different extensions and voicemail. I have already figured out the distinctive ring part with this in the zapata.conf

sedistinctiveringdetection=yes
dring1=375,339,133
dring1context=ministry

The logs tell me it is recognizing the "ministry" context. I just don't know where to put the "ministry" context and what to put it in it to route these calls to a seperate extension. Nor do I know how to split the VOIP incoming from the PSTN incoming. They both seem to be using the "from-pstn" context. I think I can do the VOIP using DID for an incoming route. Can I fake an incoming route in the distinctive ring context.

Any help would be appreciated
Edit

Distinctive Ring for UK

by Anonymous on Tuesday 25 of January, 2005 [20:44:17 UTC]
Just to help anybody out, I've got two separate rings coming in from a BT line :-

ring-ring (the normal)
367,246,216
riiiiiiing (the US-style)
337,187,0

Edit

built-in extensions

by Anonymous on Thursday 25 of November, 2004 [17:25:46 UTC]
(:cry:)
hello
chan_zap.so is loaded I added callreturn=yes in zapata.conf but when i dial *69 nothing is happen .
What may i do ?

harry
Edit

unable to create channel of type zap

by Anonymous on Wednesday 20 of October, 2004 [19:11:56 UTC]
If you are getting types message, make sure that you have a good phone cable from the card to the wall. I am not sure if it is a dial tone check or a electrical check from the card, but if you are not connected and try to Dial(Zap/1/...) for instance, you can get this message.
Edit

Typo

by Anonymous on Friday 10 of September, 2004 [00:00:05 UTC]
Typo but could be misleading:

In the Zap Channel Module's configuration file (zapata.conf), you can define groups of Zap channels that get treated as a single channel as far as the Dial command is concerned. You specify which of four methods the Zap channel module is to use to select a non-busy channel from the channel group by prefixing the group number with one of the letters g, G, r, or R:


g: select the lowest-numbered non-busy Zap channel.
G: select the highest-numbered non-busy Zap channel.
r: use a round-robin search, starting at the next highest channel than last time.
G: use a round-robin search, starting at the next lowest channel than last time.

Last uppercase "G" should be "R"
Edit

flash button not working

by Anonymous on Thursday 19 of August, 2004 [19:11:14 UTC]
For european asterisk users...

If your phone's flash button doesn't work in asterisk (or asterisk thinks that you have dialed '1') it may be a problem of ZT_MAXPULSETIME being too high for european phones.

If the "pulse" is shorter than ZT_MAXPULSETIME ms, the zaptel driver takes it as a (pulse-dialed) '1'. If it's longer, it takes it as a "flash". By default ZT_MAXPULSETIME is 150 ms, but many phones in Europe use 80-120 ms flash pulses. The fix is recompiling the zaptel driver, changing the value for ZT_MAXPULSETIME in zaptel.h

(It's an old issue that has appeared several times on the * mailing lists, like
here or here ).
Edit

Small error in Dial example

by Anonymous on Sunday 06 of June, 2004 [22:13:44 UTC]


The Dial command requires lower case 'w' characters in the DTMF string for wait. Uppercase 'W' doesn't work.


Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver