On Wednesday 04 October 2006 16:24, Syed Zia wrote:
> I have these voxbone DID's, The way I m using these DID's now that I
> forward it to an extension (e.g: [EMAIL PROTECTED]) where 192.168.1.1 is my
> asterisk box, then I have a dial plan for each extension which dials to a
> pst number through a trunk I am using.
>
> E.g: exten
> Exten => 300,1,Answer()
> exten => 300,2,Wait(2)
> exten => 300,3,NoOp(${CALLERID})
> exten => 300,4,Dial(SIP/[EMAIL PROTECTED])
> exten => 300,5,Hangup()
That looks like it'll work.
> What I really want is that I want to map the actual PSTN number in the sip
> URI for each DID (e,g: [EMAIL PROTECTED]). Then I want to write a
> dialplan in my asterisk box which should terminate all these calls through
> this trunk 202.202.202.202
Please restate the request. I don't understand what you want to do here.
> [globals]
> ;define trunck as global variable
> Trunka=192.168.1.1
> prefix=12345
>
> [Voxbone context]
>
> Any call which starts with 1416,1=> Answer()
> 1416,2=> Dial(${TrunkA})
Well if you correct it to
[incomingcontext]
exten => _1416NXXXXXX,1,Dial(SIP/[EMAIL PROTECTED])
then yes... any time this box dials 1416{valid #} it will attempt to dial
192.168.1.1 via SIP and connect to the extension that was dialed here.
> 1. How am I suppose to tell the asterisk that all calls received form this
> context should be terminated by this truck. Is my dialplan is correct? Can
> somebody write me the right syntax?
I just gave you the line above. You shouldn't Answer(), as the Dial() may
fail and you should give the originator the option of getting the correct
code back. Once you answer, they will always see it as answered, even if the
Dial() fails and passes back BUSY, NOANSWER, CONGESTION, etc..
> 2.The trunk which I am using requires me to use prefix before dialing any
> number.. E.g.: [EMAIL PROTECTED], So how am I suppose to set
> the prefix in a variable so I don't need to hard code it in all the uri's?
Very easily:
[incomingcontext]
exten => _1416NXXXXXX,1,Dial(SIP/[EMAIL PROTECTED])
HTH,
-A.