planetWayne.com - Forums
Rants and Raves and Generally Anything
Rollover lines

 
Post new topic   Reply to topic    planetWayne.com - Forums Forum Index -> VoIP
View previous topic :: View next topic  
Author Message
hakkatil
planetFreshman


Joined: 16 Dec 2004
Posts: 4

PostPosted: Wed Dec 29, 2004 6:34 pm    Post subject: Rollover lines Reply with quote

My local macro is as follows

[trunklocal]
;
; Local seven-digit dialing accessed through trunk interface
;
exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _9NXXXXXX,2,Congestion

What I would like to is if a local call made from a sip phone, I would like asterisk to rollover to the next available line if it is busy or unavailable.

How can I do this? Does Asterisk handle this without telling it? Does anyone had this issue before?

I found that ChanIsAvail command is able to do this.

ChanIsAvail(Zap/1&Zap/2&Zap/3&Zap/4)

but I can't implement it above macro. Can anyone point me to the right direction?

Thank you
Back to top
View user's profile Send private message
planetWayne
Site Admin


Joined: 30 Jan 2003
Posts: 280

PostPosted: Fri Jan 14, 2005 12:12 am    Post subject: ChanIsAvail is your friend! Reply with quote

The Dial() command will dial all your specified channels untill one gets answered - so I guess that it would also attempt to bring up all your analogue lines and dial them out... not so good I guess Smile

As you suggested - it would appear that ChanIsAvail is going to be your friend with this.

Looking at the VoIP Wiki - you tell ChanIsAvail your prefered order to dial out on, to which it will check in that order to see if a channel is free. If yes, then a variable is set (${AVAILCHAN}) holding the channel id AND the session id (which can be stripped off with CUT() )

You can then use this with your Dial command to place the call. One thing (now I've been looking at this) I might do is get * to announce a message if there are no outbound channels to dial on (someone else has the line for example)...

Going in the right direction?
Wayne.
Back to top
View user's profile Send private message Visit poster's website
ScaredyCat
planetFreshman


Joined: 23 Mar 2005
Posts: 4

PostPosted: Wed Mar 23, 2005 7:13 pm    Post subject: Reply with quote

Ok,

here's what you do....

In /etc/asterisk/zapata.conf you can put channels into groups using the

group=n

command. Where n is a number. If you have multiple FXO interfaces, or a T1/E1 card, put them all in the same group. Then define your ${TRUNK} as:

ZAP/gn/

where n is the group you put them all in. Eg if in zapata.conf you have:

group=1

then your ${TRUNK} would be:

ZAP/g1/

This will cause asterisk to roll over to the next line in the same group if the first one is busy.. Okies??

SC
Back to top
View user's profile Send private message
planetWayne
Site Admin


Joined: 30 Jan 2003
Posts: 280

PostPosted: Wed Mar 23, 2005 9:47 pm    Post subject: Reply with quote

Hiya Mr ScaredyCat! Smile

Does the same logic apply to SIP channels as well?

And as a second thought - can you create a group across channel types ? eg 'group1' - can have a zap channel and sip channel? (am thinking along the lines of people with analogue phones and sip phones being in the same group.)

Cheers!
Wayne.
Back to top
View user's profile Send private message Visit poster's website
ScaredyCat
planetFreshman


Joined: 23 Mar 2005
Posts: 4

PostPosted: Wed Mar 23, 2005 10:50 pm    Post subject: Reply with quote

groups only apply to zaptel channels.

I'm not sure why you'd want to use it for sip etc since zap channels have a fixed number of calls that are possible because they are physical ports. SIP, IAX2 etc are not real ports as they use IP which is, in theory, an "infinate" capacity ... (well not really infinate at all - but not physically restricted by hardware ports)

if you want to emulate the feature for sip, iax2 etc then you just do something like:

exten => _XXX.,1,Dial(SIP/${EXTEN}@sipprovider-1-machineA)
exten => _XXX.,2,Dial(SIP/${EXTEN}@sipprovider-1-machineB)
exten => _XXX.,3,Dial(SIP/${EXTEN}@sipprovider-1-machineC)

If the first dial line fails it'll try the second, if that fails it'll try the 3rd .. if the first one fails and the 2nd one succeeds then the 3rd one will NOT get executed. You can do the same with all channel types (IAX2, ZAP etc).

This is a feature used widely to perform LCR (Least cost routing) but with a 'guarentee' of call delivery. For example:

exten => _XXX.,1,Dial(SIP/${EXTEN}@sipprovider-1)
exten => _XXX.,2,Dial(IAX2/${EXTEN}@iaxprovider-1)
exten => _XXX.,3,Dial(ZAP/g1/${EXTEN})

ie:

Try sipprovider-1 first, if that fails try iax2provider-1 and finally if that fails, try the pstn line... (placed in order of cheapest to more expensive)


SC
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    planetWayne.com - Forums Forum Index -> VoIP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group