Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi All,

I have used Patrick's helpful doument here

https://www.myciscocommunity.com/docs/DOC-7654

To get inbound calls from the PSTN to be routed to my Asterisk PBX.

My question is how do I go the other way and route calls from Asterisk to the SPA8800 and out an FXO port to the PSTN?

Thanks

Roland

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi Roland,

I'm glad that you found the document useful. I appreciate the feedback. Take a look at the Asterisk phone config documents if you want to deploy SPA phones with your Asterisk server. We now have guides on using the web-ui to configure SPA phones with Asterisk and automatic provisioning, aka zero touch configuration of SPA phones with Asterisk. Available from here: https://www.myciscocommunity.com/docs/DOC-10647

Here's how to call from IP phone > Asterisk > SPA8800 FXO > PSTN

I'll refer to https://www.myciscocommunity.com/docs/DOC-7654 in this explanation:

This section defines lines 2 and 3 of the SPA8800. I know that they are lines 2 and 3 by looking at the port number, 5060= line 1, ... 5063= line 4.

Page 7 shows a snippet of /etc/asterisk/sip.conf where the FXO ports (lines) are declared:

;define SPA8800 pstn2 user

[pstn2]

type=friend

host=192.168.2.237 ;IP address of the SPA8800

port=5161 ;5161 is the default SIP port for line 2 on the SPA8800

dtmfmode=rfc2833

context=pstn2

insecure=very

;

;define SPA8800 pstn3 user

[pstn3]

type=friend

host=192.168.2.237 ;IP address of the SPA8800

port=5261 ;5261 is the default SIP port for line 2 on the SPA8800

dtmfmode=rfc2833

context=pstn3

insecure=very

;



This section uses two SPA8800 FXO ports (lines 2 and 3) and trunks them together. This allows the trunk to be shared among many users. The trunk is oversubscribed, so there can never be more than 2 simultaneous calls...

Page 8 shows a snippet of /etc/asterisk/extensions.conf where outbound call routing is defined:

;

; dial 7 to explicitly use FXO3

exten => _7.,1,Dial(SIP/${EXTEN:1}@pstn3,60,r)

;

; dial 8 as a steering digit:

; if FXO2 is not available, FXO3 will be used.

; if FXO3 is not available, the user hears congestion

exten => _8.,1,Dial(SIP/${EXTEN:1}@pstn2,60,r)

exten => _8.,2,Dial(SIP/${EXTEN:1}@pstn3,60,r)

;



Page 15 in the Configuring FXO Line Ports on the SPA8800configures SPA8800 FXO ports 2 and 3 to point to the Asterisk server:

Once you've saved the changes and reloaded the SIP module on the Asterisk server, you should be able to make outbound calls by using either 7 or 8 as a steering digit where 7 will only use line 3 and 8 will first try line 2 and then line 3 if line 2 is not available.

Does this make sense to you?

Regards,

Patrick

-----------

8 REPLIES
Cisco Employee

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi Roland,

I'm glad that you found the document useful. I appreciate the feedback. Take a look at the Asterisk phone config documents if you want to deploy SPA phones with your Asterisk server. We now have guides on using the web-ui to configure SPA phones with Asterisk and automatic provisioning, aka zero touch configuration of SPA phones with Asterisk. Available from here: https://www.myciscocommunity.com/docs/DOC-10647

Here's how to call from IP phone > Asterisk > SPA8800 FXO > PSTN

I'll refer to https://www.myciscocommunity.com/docs/DOC-7654 in this explanation:

This section defines lines 2 and 3 of the SPA8800. I know that they are lines 2 and 3 by looking at the port number, 5060= line 1, ... 5063= line 4.

Page 7 shows a snippet of /etc/asterisk/sip.conf where the FXO ports (lines) are declared:

;define SPA8800 pstn2 user

[pstn2]

type=friend

host=192.168.2.237 ;IP address of the SPA8800

port=5161 ;5161 is the default SIP port for line 2 on the SPA8800

dtmfmode=rfc2833

context=pstn2

insecure=very

;

;define SPA8800 pstn3 user

[pstn3]

type=friend

host=192.168.2.237 ;IP address of the SPA8800

port=5261 ;5261 is the default SIP port for line 2 on the SPA8800

dtmfmode=rfc2833

context=pstn3

insecure=very

;



This section uses two SPA8800 FXO ports (lines 2 and 3) and trunks them together. This allows the trunk to be shared among many users. The trunk is oversubscribed, so there can never be more than 2 simultaneous calls...

Page 8 shows a snippet of /etc/asterisk/extensions.conf where outbound call routing is defined:

;

; dial 7 to explicitly use FXO3

exten => _7.,1,Dial(SIP/${EXTEN:1}@pstn3,60,r)

;

; dial 8 as a steering digit:

; if FXO2 is not available, FXO3 will be used.

; if FXO3 is not available, the user hears congestion

exten => _8.,1,Dial(SIP/${EXTEN:1}@pstn2,60,r)

exten => _8.,2,Dial(SIP/${EXTEN:1}@pstn3,60,r)

;



Page 15 in the Configuring FXO Line Ports on the SPA8800configures SPA8800 FXO ports 2 and 3 to point to the Asterisk server:

Once you've saved the changes and reloaded the SIP module on the Asterisk server, you should be able to make outbound calls by using either 7 or 8 as a steering digit where 7 will only use line 3 and 8 will first try line 2 and then line 3 if line 2 is not available.

Does this make sense to you?

Regards,

Patrick

-----------

New Member

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi Patrick !

We  are about to  buy an SPA8800 and I'd like to ask you about its Line Ports for outbound calls.

I don't want to have to dial the steering digit (8 in you example) to make an outbound call.

I want SPA8800 to decide for a free FXO Line Port to make it, via round robin or something like that.

So, is it possible to have the following for outbound calls ?

In my sip.conf:

[192.168.2.237]
type=friend
host=192.168.2.237 ;IP address of the SPA8800
port=5060
dtmfmode=rfc2833
context=default
insecure=very

; -------------------------------

And in extensions.conf:

exten => XXXXXXXX,1,Dial(SIP/${EXTEN}@192.168.2.237,60,r)

; -------------------------------

Regards,

André Lemos

Cisco Employee

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi André

The only reason that steering digit is used is because Asterisk is acting as a PBX and may have many different outbound routes and it wants you to choose.

For example, just by using the SPA8800, outbound routes could be SIP or PSTN-based.

Each SPA8800 port is explicitly registered to the Asterisk server at ports 5060-5063.

I bet that there are Asterisk experts that can offer a suggestion as to how you can make an outbound call without select a route and automatically route the call out of any one of 4 possible routes.

Not much help, I'm afraid.

Regards,

Patrick

-----------

New Member

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi André,

You can just drop the steering digit '_8' and leave the '_.', this will match on any number. Then setup 4 outbound routes one after the other with the port definition on each one lining up with the port declared on each of the FXO lines on the SPA8800.

In theory, when the call to the first FXO port fails, it will try the next then the next  and so on until you run out of ports to try.

Roland

New Member

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Roland and Patrick,

thank you for the answers.

Another question:  and what if I dial directly to the SPA8800 address like above?

exten => XXXXXXXX,1,Dial(SIP/${EXTEN}@192.168.2.237,60,r)

Have you ever tested this ?

Andre

Cisco Employee

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi Andre,

I've not tested this.

I'll run the test for you next week. What are you hoping will happen?

Regards,

Patrick

-----------

New Member

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi!
I hope SPA8800 makes the outgoing call to XXXXXXXX, choosing the most  apropriated free port line.

André

Cisco Employee

Re: Using a SPA8800 as an outbound FXO Gateway from Asterisk

Hi Roland,

Thanks for contributing to the community. Your expertise is most appreciated.

Regards,

Patrick

-----------

6847
Views
0
Helpful
8
Replies
CreatePlease to create content