How make Asterisk change field "To" to PSTN callee number

Hello
Our company using hardware SIP phones with FXO ports.
I have configured Asterisk - create user account for this phone, but I can’t understand, how configure dialplan for transfer callee PSTN number to this phone?
As I understand - Asterisk have to modify filed “To” in SIP Invite message to callee PSTN number, but “Requst-URI” must stay as URI hardware SIP phone.
My current configuration:

sip.conf

[code][general]
minexpiry=10
bindport=5060
context=router
allowoverlap=no
udpbindaddr=192.168.10.233
tcpenable=no
language=en
dtmfmode=rfc2833

[555]
type=friend
username=555
callerid=User555 <555>
context=router
secret=Emzior555
qualify=no ; linphone will become unreachable if qualify=yes
host=dynamic
canreinvite=no ; no
nat=no
port=50600

[777]
type=friend
username=777
callerid=User777 <777>
context=router
secret=Emzior777
qualify=no ; linphone will become unreachable if qualify=yes
host=dynamic
canreinvite=no ; yes
insecure=invite,port
nat=nonat[/code]

extensions.conf

[code][router]
include => outbound

exten => 777,1,Dial(SIP/777)

[outbound]
exten => _6.,1,Dial(SIP/555)[/code]
In this configuration I’m trying call PSTN callee from 777 user through 555 (hardware SIP phone)

hi,

Are you using analog port of hardphone or digital?

regards,

sohaib khan

I’m using analog port of harphone.

Then you may need to configure it with your fxo port (with your fxo card), and then you need to call to that channel on which your phone is connected.

Let me google it more to understand the scenario and will get back you .

BTW, which fxo card you are using?

regards,

Sohaib Khan

It’s “noname” card(based on Si32260 chip) and it’s not matter, because Asterisk running on dedicated server and talking with hardphone over SIP/RTP channel

have you configured your fxo port with your hardphone?

That’s what i get after googling … :smile:

viewtopic.php?f=13&t=73774

Thank You, Sohaib Khan for your quick responses.
But this (viewtopic.php?f=13&t=73774) is not my case, because I don’t have PCI card.

Harphone have configured only via Web Interface - there are some fields available to change - SIP name, SIP domain, SIP proxy, SIP password, preferable codecs, and others.

ooohhh… you mean you are configuring hardphone via on SIP… I was thinking you are configuring on fxo … lol… sorry for misunderstanding…

just read it…
in this case you need to add ${EXTEN}
[outbound]
exten => _6.,1,Dial(SIP/555/${EXTEN})
so what ever the number you are dialing (starting from 6) it will dial through 555.

Thank You.
It’s work!

you are welcome… :smile: