Routing PSTN calls to ip phone

hi everyone,

can anyone help me on how to route PSTN calls to ip phone…
the scenario is there’s an incoming calls and i want my ip phone to be able to receive the calls…

hardware use:
Linksys SPA3102 - ATA
Linksys SPA921 - IP Phone

thanks… :slight_smile:

In the dialplan context that handles the incoming PSTN call, just use the dial command to have it dial whatever extension your IP phone is currently assigned.

hello,

Linksys devices have many features and an internal dialplan which allow you to made a small VoIP project without Asterisk.
I mean that you could configure the ATA to forward PSTN calls to your IP phone without only from their dialplan and settings.

You have just to google arround (like Linksys peer 2 peer).

HTH,
Ioan.

I think you may focus on setting inbound/ outbound rules.

You may have a look at http://www.freepbx.org/support/documentation/howtos/howto-linksys-spa-3102-sipura-spa-3000-freepbx

Vinod

mket can you give me an example about this? coz i really dont get it :cry:

[quote=“vinodc”]You may have a look at http://www.freepbx.org/support/documentation/howtos/howto-linksys-spa-3102-sipura-spa-3000-freepbx

Vinod[/quote]

thanks for the reply…but i dont use freepbx…

hi,

a dial plan logic similar to below could route incoming pstn to iphone.

1234 is the incoming pstn
5678 is the sip account corresponding to the iphone.

sip.conf

[5678]
type=friend
username=
nat=yes
secret=
host=dynamic
context=iphone
disallow=all
allow=alaw
allow=ulaw
call-limit=2

extensions.conf

[iphone]
exten => 1234,1, answer()
exten => 1234,n, dial(SIP/5678)

Ideally you should let Dial do the answer. Explicitly answering will charge the caller even if the call fails.

(I think there are some cases where call progress signalling is lost if you don’t prematurely answer.)

thanks for the reply but all i want is a sample dialplan in my SPA3102 like this below:

Dial Plan 1: (S0<: 1001@10.0.0.100>)

is this correct?

[quote=“donie evalle”]thanks for the reply but all i want is a sample dialplan in my SPA3102 like this below:

Dial Plan 1: (S0<: 1001@10.0.0.100>)

is this correct?[/quote]

your Linksys dialplan (in SPA3102) should work -> pay attention to the space you have between “: 1001” as it should not be there.

could you post somewhere your ATA configuration (save the html source page) as there you probably have to pay some attention to other settings as well (like “Ans Call Without Reg” = yes if you do not register your ATA’s Line in Asterisk).

BTW: you did not confirm if you use Asterisk or not. Normally you should configure your Line in SPA3102 to register in Asterisk but if you choose not to do this you have to use the “S0” approach.

HTH,
Ioan.

ahh ok i will try removing that space …

here is my SPA Configuration
http://www.4shared.com/file/hREI7aIk/Linksys_SPA_Configuration.html

I have looked in your config and see that you need to use your analog port on the SPA3102. In order to give the best advice for you you have to explain your setup.

Bellow is what I understand (under [ ] is the port name):

PSTN line ------ [Line ] SPA3102
analog phone --- [Phone] SPA3102 [Internet] --- Switch --- Asterisk=10.0.0.1
                                                  |
SPA921 -------------------------------------------+

a. both analog and SPA921 are defined in Asterisk - what extensions do they have?
b. when a call is received on the PSTN line it will be directed to SPA921
c. what about outgoing calls? Do you like to have a prefix (like 9) in order to identify these calls and to sent through the PSTN line?

in order to have more details you could post your sip.conf and your dialplan (extensions.conf).

HTH,
Ioan.

[quote=“indreias”]I have looked in your config and see that you need to use your analog port on the SPA3102. In order to give the best advice for you you have to explain your setup.

Bellow is what I understand (under [ ] is the port name):

PSTN line ------ [Line ] SPA3102
analog phone --- [Phone] SPA3102 [Internet] --- Switch --- Asterisk=10.0.0.1
                                                  |
SPA921 -------------------------------------------+

a. both analog and SPA921 are defined in Asterisk - what extensions do they have?
b. when a call is received on the PSTN line it will be directed to SPA921
c. what about outgoing calls? Do you like to have a prefix (like 9) in order to identify these calls and to sent through the PSTN line?

in order to have more details you could post your sip.conf and your dialplan (extensions.conf).

HTH,
Ioan.[/quote]

Thanks for the reply:
for the question ( a ) Analog has a extension of 1002 and SPA921 has a extension of 1001.
( b ) Yes
( c ) I still don’t get how to make an outgoing calls. Yes if possible to have a prefix to identify the outgoing
calls .

sip.conf

[spa3102]
username=spa3102
secret=spa3102
type=friend
host=dynamic
context=default
callgroup=1
pickupgroup=1
mailbox=4321@default

[analog1]
username=analog1
secret=analog1
type=friend
host=dynamic
context=default
diallow=all
allow=ulaw
dtmfmode=rfc2833
callgroup=1
pickupgroup=1

extensions.conf

exten => 1001,1,Dial(SIP/spa3102,20)
exten => 1001,n,HangUp()

exten => 1002,1,Dial(SIP/analog1,20)
exten => 1002,n,HangUp()

can you help me in making outgoing calls?

I believe you should have 3 SIP accounts defined.

  1. SPA921
  2. SPA3102 FXO (PSTN line)
  3. SPA3102 FXS (analog phone)

exten 1001 is supposed to be for the SPA921, but your saying dial the SPA3102…

[quote]exten => 1001,1,Dial(SIP/spa3102,20)
exten => 1001,n,HangUp()

exten => 1002,1,Dial(SIP/analog1,20)
exten => 1002,n,HangUp()[/quote]

Get the SIP accounts cleaned up and then change your dialplan to something like

exten => 1001,1,Dial(SIP/SPA921,20)
exten => 1001,n,Hangup()

exten => 1002,1,Dial(SIP/SPA3102FXS,20)
exten => 1002,n,Hangup()

exten => _9.,1,Dial(SIP/SPA3102FXO/${EXTEN:1},20)

[from-outside]
exten => s,1,Dial(SIP/SPA921)
exten => s,n,Hangup()

Change the above SIP accounts to match what you have created in your sip.conf. To dial outside, hit 9 and then the digits for the phone number. On your SIP account for the SPA3102FXO port add a line that says context=from-outside. That way incoming calls will go to that chunk of the dialplan, which is told to ring the SPA921.

ok i already setup something like that…do i need to put the spa3102fxo in the “Subscriber Information” under
PSTN Line?

and also when i dial a telephone number after 9 the operator of my provider will say that “the number entered
is invalid” so i can say that it actually connected to my provider but the number they received is invalid… is there
something wrong with my configuration or something lacking?

thanks,
donie

You should read the chapter in the Asterisk book about pattern matching. _9. matches all numbers starting with the number “9.” Of course your phone company says that the number “9” isn’t valid, because it isn’t. Try something like “9XXXXXXX,” replacing the seven Xs with a local number from your area.

[quote=“donie evalle”]and also when i dial a telephone number after 9 the operator of my provider will say that “the number entered
is invalid” so i can say that it actually connected to my provider but the number they received is invalid… is there
something wrong with my configuration or something lacking?
[/quote]

could you post the dialplan line for the 9 dial?

That rule should work. The _9., says its a pattern match and that anything starting with a 9 with 1 or more characters … Then in the line the ${EXTEN:1} says pass the digits on, minus the first one. So the 9 should not be passed to the PSTN.

i already read about pattern matching and i can say that the number 9 was not sent to the fxo port because i use ${EXTEN:1} to pass on the numbers to the fxo port.

YES. It actually pass the digits without the #9 to the fxo port. My dialplan line for the 9 dial is look like this:

exten => _9.,1,Dial(SIP/spa3102fxo/${EXTEN:1},20)

i read some forum with the same issue like i am facing now and i notice that they solve it by couple of “w” s (w/o the quote) on the Outbound Dial Prefix but I don’t know where to look at this setting cause they use TrixBox and I am not.

http://www.trixbox.org/forums/vendor-forums-certified/sangoma/pstn-outbound-local-call-problem

ok guys thanks so much for the help… i solve the problem now…all i did is delete all the Dial Plan from 2 - 8 :smile: