planetWayne.com - Forums
Rants and Raves and Generally Anything
URL Dialing

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


Joined: 30 Jan 2003
Posts: 280

PostPosted: Sun Sep 19, 2004 6:38 pm    Post subject: URL Dialing Reply with quote

This one allows you to 'dial' a SIP URL from your phone (as long as you can input letters!) - I have a set of Cisco 7960's which you can type letters into your dialing string.

You may think this is simple to do on one front - you just stick the URL in and away you go ('person@othernetwork.com') - but all is not as it first appears.

For some reason Asterisk does not like accepting a '@' simbol as part of the dialed number. So we have to work around the fact that we cant send a '@' from the phone. The way I've done this is to use another substitute character that you 'dial' from the phone. This then gets replaced by the context to be correct to dial with.

If you have read any of my other posts you will see I use global variables to hold extentions (for ease of changing to suit your dial plan) also, with this, theres a variable to hold the character you are looking to replace the '@' with.

So - In your globals - a few variables
Code:
[globals]
URLATMARK==
URLACCESSCODE=82

My substitute character in this example is '='. I did opt for the '#' as a suitable replacement but the Cisco's use this to 'send' your dial string so you would only be able to dial the first part of the URL!
URLACCESSCODE=82 may seem a bit strange. You know the old '9 for an outside line' well I've gone for '8 for an internet call'. '81' for a FreeWorld Dial number, and '82' to start a URL number. Neat eh.

The next context needs to be 'included' within your phones context so it can be called when you want to make an internet call.
Code:
[urldial]

exten => _${URLACCESSCODE}.,1,NoOp,${EXTEN}
exten => _${URLACCESSCODE}.,2,Setvar(url=${EXTEN:${LEN(${URLACCESSCODE})}})

exten => _${URLACCESSCODE}.,3,NoOp,${url}
exten => _${URLACCESSCODE}.,4,cut(name=url,${URLATMARK},1)
exten => _${URLACCESSCODE}.,5,NoOp,${name}
exten => _${URLACCESSCODE}.,6,cut(address=url,${URLATMARK},2)
exten => _${URLACCESSCODE}.,7,NoOp,${address}
exten => _${URLACCESSCODE}.,8,NoOp,${name}@${address}
exten => _${URLACCESSCODE}.,9,Setvar(FullAddr=${name}@${address})
exten => _${URLACCESSCODE}.,10,NoOp,${FullAddr}
exten => _${URLACCESSCODE}.,11,dial(SIP/${FullAddr},120)
exten => _${URLACCESSCODE}.,12,hangup

Theres a few NoOps in there you can remote - but it was there to help debugging.
Back to top
View user's profile Send private message Visit poster's website
Nugget
planetFreshman


Joined: 17 Nov 2004
Posts: 1
Location: Austin TX USA

PostPosted: Wed Nov 17, 2004 9:26 pm    Post subject: Perhaps a cleaner solution Reply with quote

For my two asterisk servers I've tried to avoid implementing any sort of dial prefixes. My view is that "dial 9 to get an outside line" is a slightly archiac mechanism and is used more from inertia than from technical necessity. (Sort of like using www. as a hostname prefix for websites :)

For my servers I came up with an alternative approach which some might find more appealing than the #->@ prefixed transformation found here. I use a catch-all _. extension to trap all dialed calls which arrive from my local phones and within that extension I look at the ${SIPDOMAIN} variable to determine if they are local or remote targets. If they're local I process as normal but if they're remote I shunt directly to a Dial(SIP/${EXTEN}@${SIPDOMAIN}) directive.

In practice I'm finding it to be a very workable solution. My config files and notes are documented at my website
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
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