[Asterisk-Users] Dial via sip gateway?

Greg Hill gregh-asterisk at hillnet.us
Sun Feb 1 12:41:57 MST 2004


On Sun, 1 Feb 2004, Rich Adamson wrote:
> The above does not seem to work either. Since the mediatrix has four pstn
> ports, there must be a way to construct a Dial command that would embed
> a userid:password, port alias name, or something like that. Just can't find
> any reference to what that syntax would look like. (The gateway is properly
> handling incoming pstn calls, just not the outgoing pstn attempts.)
>
> Really need to the sip dial command to include...
>   - the string of digits to be called
>   - either a userid:password, or, port alias name (or both)
>   - ip address of the gateway
>
> Anybody have a clue what that dial sip syntax would look like????

I have only recently begun actually playing with *, but I'll venture a
guess.. You (or somebody else) mentioned that you can force a call to go
out a particular port on the Mediatrix by using the username/password pair
which corresponds to that port, and this guess is based on that
assumption. (I hope it's a valid assumption!)

At http://www.voip-info.org/wiki-Asterisk+SIP+channels, under "Using a SIP
channel in extensions.conf," we read that the dial string format is either
SIP/<exten>@<peer> or SIP/peer/exten. <peer> may be a hostname of a SIP
proxy server, a domain where * should look for a SRV record, or a service
defined in sip.conf.

So try something like this in extensions.conf:
exten => 101,1,Dial(SIP/<number>@mediatrixport1)
exten => 102,1,Dial(SIP/<number>@mediatrixport2)
exten => 103,1,Dial(SIP/<number>@mediatrixport3)
exten => 104,1,Dial(SIP/<number>@mediatrixport4)

and then define those services in sip.conf:
[mediatrixport1]
username=<username for access to port1>
password=
host=<mediatrix IP/name>

[mediatrixport2]
username=<username for access to port2>
password=
host=<same mediatrix IP/name>

and so on for ports 3 and 4. I think a setup like this will allow you to
use distinct username/password pairs for connections to the same SIP
proxy.

Greg





More information about the asterisk-users mailing list