Failed Outbound calls though OBi110

Freepbx 15 version: 15.0.16.81
installed on Core 2 Duo PC.

I am pretty much a beginner in this, so any help would be much
appreciated.

I have it working with IP Phones and ATA boxes. It can call
IP extensions to Extension, and voicemail works as well.
I bought a Obi110 FSX/FXO box to allow making
calls through a PBX extension in our university.

I set this up using instructions posted on your wiki, and from 2 youtube
videos ( which replicated much of what was on the wiki ). They were all
very similar except for a few details.

Incoming calls to the FXO port work fine - call goes to a target
IP extension.

Outbound calls fail. It is set up so dialing
“81” should connect to a dialtone through the Obi.
I put a line monitor on the FXO port and
it never goes off-hook when I attempt the call. So the port is
never accessed.

I get a message “Your number cannot be completed as dialled. Would you
please check the number and try again later”

Here is the log for a failed Outbound call.

[2020-12-13 21:38:31] VERBOSE[31376] pbx_variables.c: Setting global variable 'SIPDOMAIN' to '10.10.0.137'
[2020-12-13 21:38:31] VERBOSE[31376] netsock2.c: Using SIP RTP Audio TOS bits 184
[2020-12-13 21:38:31] VERBOSE[31376] netsock2.c: Using SIP RTP Audio TOS bits 184 in TCLASS field.
[2020-12-13 21:38:31] VERBOSE[31376] netsock2.c: Using SIP RTP Audio CoS mark 5
[2020-12-13 21:38:31] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:1] ResetCDR("PJSIP/2001-0000001d", "") in new stack
[2020-12-13 21:38:31] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:2] NoCDR("PJSIP/2001-0000001d", "") in new stack
[2020-12-13 21:38:31] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:3] Progress("PJSIP/2001-0000001d", "") in new stack
[2020-12-13 21:38:31] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:4] Wait("PJSIP/2001-0000001d", "1") in new stack
[2020-12-13 21:38:32] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:5] Playback("PJSIP/2001-0000001d", "silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer") in new stack
[2020-12-13 21:38:32] VERBOSE[3016][C-0000001d] file.c: <PJSIP/2001-0000001d> Playing 'silence/1.ulaw' (language 'en')
[2020-12-13 21:38:33] VERBOSE[3016][C-0000001d] file.c: <PJSIP/2001-0000001d> Playing 'cannot-complete-as-dialed.ulaw' (language 'en')
[2020-12-13 21:38:36] VERBOSE[3016][C-0000001d] file.c: <PJSIP/2001-0000001d> Playing 'check-number-dial-again.ulaw' (language 'en')
[2020-12-13 21:38:38] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:6] Wait("PJSIP/2001-0000001d", "1") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [81@from-internal:7] Congestion("PJSIP/2001-0000001d", "20") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Spawn extension (from-internal, 81, 7) exited non-zero on 'PJSIP/2001-0000001d'
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [h@from-internal:1] Macro("PJSIP/2001-0000001d", "hangupcall") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [s@macro-hangupcall:1] GotoIf("PJSIP/2001-0000001d", "1?theend") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [s@macro-hangupcall:3] ExecIf("PJSIP/2001-0000001d", "0?Set(CDR(recordingfile)=)") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [s@macro-hangupcall:4] NoOp("PJSIP/2001-0000001d", " montior file= ") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [s@macro-hangupcall:5] GotoIf("PJSIP/2001-0000001d", "1?skipagi") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx_builtins.c: Goto (macro-hangupcall,s,7)
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Executing [s@macro-hangupcall:7] Hangup("PJSIP/2001-0000001d", "") in new stack
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] app_macro.c: Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'PJSIP/2001-0000001d' in macro 'hangupcall'
[2020-12-13 21:38:39] VERBOSE[3016][C-0000001d] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/2001-0000001d'

I have a log for a successful incoming call but it won’t fit in this post.

Here are the settings for the outbound route and trunk.

OUTBOUND ROUTE
name: 81DialPOTS
Trunk Sequence:
OBITRUNK1

[dial patterns]
no prepend
prefix= 81
match pattern = Z.
no CID

TRUNK
name OBITRUNK1

trunk is a chan_sip_trunk ( not pjsip)
outbound CID: 2001

[dialed number manipulation rules]
none

[sip settings]
host=dynamic
username=OBITRUNK1
secret=password1234
type=friend
context=from-trunk
qualify=yes
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
insecure=port,invite
trustrpid=yes

That would be an unusual setup, but if you have a good reason, we can explain how to do it.

For example, if you are calling ext. 2345 on the university system, FreePBX might be set up in one of three ways:

  1. You dial 2345, your Outbound Routes recognize this as a number on the university PBX and send 2345 to the OBi, which dials that on the external PBX.

  2. You dial 812345, where 81 is a ‘trunk access code’ for the OBi Line port. The Outbound Route strips the 81 and sends 2345 on the OBi trunk.

  3. You dial 81, wait for a second dial tone from the external PBX, then dial 2345.

Although you seem to be asking for (3), your FreePBX is set up for (2). If the OBi is properly configured, dialing 812345 should work

If it doesn’t, at the Asterisk command prompt, type
sip set debug on
make a failing call, paste the Asterisk log for the call (which will now include a SIP trace) at pastebin.freepbx.org and post the link here. Also post any non-default settings in the OBi for the SPx that registers to FreePBX and the Line port.

Thanks, Stewart1

Here are the non-default settings from the OBi110

[ these are non-default vals - all else left at default]
[obi110 settings: status]
Registered (server=10.10.0.137:5160; expire in 49s)

[Sp2 was used]

[ITSP Profile B]
Proxy server: 10.10.0.137
Proxy server port: 5160
Registrar Server: 10.10.0.137
Registrar Server Port: 5160
X_SpoofCallerID checked
X_AccessList 10.10.0.137

[ under Sp2 service]
X_ServProvProfile = B
X_InboundCallRoute = LI

[phys interfaces = line port]
InboundCallRoute = SP2(2001)
DialDigitOnTime = 50
DialDigitOffTime = 50

Here is the link to my pastebin for a failed call.
A lot of entries, but I didn’t want to leave out any of it
in case it was important…

https://pastebin.freepbx.org/view/8ca8f490

Sorry it isn’t a link - but the system says new users cannot post links, so
you will have to copy/paste it.

Something to note: When I dial a call as 81XXXX, I get the message:
“All circuits are busy now…”

But When I call just 81, I get " Your call cannot be completed as dialed…"

This probably stems from what you pointed out: I have 81 Z. configured…
which probably expects some additional digits. I’d prefer to dial just the 81
and receive a dialtone for the time being…

Thanks so much for the response!

Phil

The OBi is not responding to OPTIONS requests, so Asterisk finds the trunk ‘unavailable’ and the call fails. The question is why, because I believe that OBi normally would respond.

To get past this, change qualify=yes to qualify=no and retest. If it still doesn’t work, paste a new log.

Line 4 shows:
Via: SIP/2.0/UDP 10.10.48.255:5160;branch=z9hG4bK420c7866;rport

Do you recognize the 10.10.48.255 address? That’s wrong, and if the OBi ignores the rport parameter, it would send the responses there and Asterisk wouldn’t ‘hear’ them.

Why is the OBi on 10.10.32.181 and the PBX on 10.10.0.137 ? I would guess that if they are plugged into the same switch, they would be assigned addresses in the same /24. If there are any routers / firewalls / virtual machines involved, or the PBX has more than one NIC, please explain.

In Asterisk SIP Settings, confirm that External Address and Local Networks are properly set.
Assuming that 10.10.32.181 and 10.10.0.137 are really on the same LAN (but 10.10.48.255 is on a different one), set External Address to your public IPv4 address, and Local Networks to
10.10.0.0/24
10.10.32.0/24

After changing these settings, restart Asterisk.

What is the primary purpose of this system? To make and receive phone calls? Or is it educational e.g. part of a student’s thesis or a professor’s lab assignment?

If the former, I strongly recommend against dialing just 81. Call logs would show 81 as the destination, rather than the number actually called. Setting up a speed dial for ext. 1546 would be difficult. Failing over to a SIP trunk when the OBi line is in use would be very difficult. Adding restrictions (such as blocking international calls) would be essentially impossible.

If you really need to dial a code and get dialtone from the remote system, understand that you cannot dial ‘nothing’ on a trunk. Your Outbound Route would have to add a value that is not valid on the target system e.g. 0000, then the OBi would remove it. Let’s not try to do that until the simple case is working.

[you said]
The OBi is not responding to OPTIONS requests, so Asterisk finds the trunk ‘unavailable’ and the call fails. The question is why, because I believe that OBi normally would respond.

To get past this, change qualify=yes to qualify=no and retest. If it still doesn’t work, paste a new log.

[reply]
Do you mean paste a new log with qualify=no?
It didn’t work, byt the way…display on calling phone shows it’s trying, but there is no
message " All circuits are busy…" et al, just dead silence, which continues until
I cancel the request and hang up.

[you said]
Line 4 shows:
Via: SIP/2.0/UDP 10.10.48.255:5160;branch=z9hG4bK420c7866;rport

Do you recognize the 10.10.48.255 address? That’s wrong, and if the OBi ignores the rport parameter, it would send the responses there and Asterisk wouldn’t ‘hear’ them.

[my reply]
I put this address into my browser address bar…it goes to the same
FreePbx login page as 10.10.0.137…i.e. the 2 are equivalent.
Our network guy couldn’t figure this out…when I unplugged the ethernet cable from the
computer running the server, neither address could be “pinged”…so there is no
dupliate assignment…Also he says that an address shouldn’t end in 255 - this is the

‘Broadcast’ address, and is never assigned to a machine.

But, no worries about getting to asterisk this way…as both addresses
end up at the same destination.

[you said]
Why is the OBi on 10.10.32.181 and the PBX on 10.10.0.137 ? I would guess that if they are plugged into the same switch, they would be assigned addresses in the same /24. If there are any routers / firewalls / virtual machines involved, or the PBX has more than one NIC, please explain.

[my reply]
Both addresses are on the same VLAN inside our campus network. They both reference the same
upstream router…

In Asterisk SIP Settings, confirm that External Address and Local Networks are properly set.
Assuming that 10.10.32.181 and 10.10.0.137 are really on the same LAN (but 10.10.48.255 is on a different one), set External Address to your public IPv4 address, and Local Networks to
10.10.0.0/24
10.10.32.0/24

[my reply]
?? This I do not understand, Stewart…‘External Address’…the whole application
is run inside the campus network on the same VLAN…and sorry I don’t know enough about
the /24 addresses…

BTW, 10.10.48.255 is also on the same VLAN.

{you]
After changing these settings, restart Asterisk.

What is the primary purpose of this system? To make and receive phone calls? Or is it educational e.g. part of a student’s thesis or a professor’s lab assignment?

[my reply]
More like #2…but I do want to set up a working system able to make and receive calls to/from our campus PBX ( which is connected to the FXO port)

It appears that the network setup on the server is somehow messed up.

Did you install FreePBX from the Distro (booting the ISO file from a CD or flash drive)?
If not, please explain how you installed it.

Does FreePBX get its IP address and configuration from a university DHCP server?
If not, explain how you configured it.

At a root shell prompt, post the output of these two commands:
ifconfig -a
ip route

In the directory /etc/sysconfig/network-scripts, you will likely find some files with names beginning with ifcfg-, such as ifcfg-eth0 and ifcfg-lo. Except for ifcfg-lo, post the contents of each of these files.

In the FreePBX GUI, Settings -> Asterisk SIP Settings, what do you have for External Address and Local Networks? Does pressing Detect Network Settings change these?

Another thought: Though I have no idea why the PBX apparently has two local IP addresses, I suspect that 10.10.48.255 may be its default address and the OPTIONS packets (and subsequent INVITE packets, once qualify was turned off) were sent from that address and blocked by
X_AccessList 10.10.0.137 in the OBi. Try removing that (or adding 10.10.48.255 to the list) and see whether an attempted outgoing call gets any further.

Stewart, just reading your post now…been very busy…

I Installed FreePBX from distro.
FreePBX gets its IP address and config from a university DHCP server = yes.
I asked network people for a static IP, and they provided it: 10.10.0.137

I will run your suggested commands and make change to X_AccessList today and reply.

IN the FreePBX GUI, under settings => Asterisk SIP settings…
External Address did change when I clicked on “Detect Network Settings”

External Address was: 69.18.37.194
After clicking Detect… became: 209.152.96.166

Local Networks did not change : has 209.152.96.166/255.255.0.0
and 10.10.0.0/16

The problem seems to be that FreePBX has both an address acquired from DHCP and a manually configured static address. Once we remove the DHCP address, it should work without any changes to the OBi configuration.

Please explain how you configured the IP address (System Admin module, editing config files, etc.)
Posting the data requested in my earlier reply would also be useful.

It is working now…such a surprise.

As soon as I added 10.10.48.255 to X_AccessList, it worked.
No other changes were made. Left the default External Address (in settings->
Asterisk SIP settings).

Here is the contents of if-eth0 file in /etc/sysconfig/network-scripts/
(could not think of how to convert to a textfile, so I took a picture with my
smartphone)

Separate post for the ifconfig -a picture…

Stewart1,
Here is the other image: ifconfig -a

I’m glad that you got it working, but am completely puzzled about how the 10.10.48.255 address came about. It may be worth tracking it down, as it is likely to cause trouble if you add SIP trunks, external extensions, etc.

What networking hardware connects the PBX, OBi and the computer you are using for admin? If it’s more than a dumb switch, that could be responsible.

The PBX, OBi, and admin computers are all connected through a (dumb) netgear
switch on my desk, which connects to a gateway router at 10.10.0.1 ( in fact
almost the entire university is on that VLAN ( the 10.10. network).
So, addresses would have to be unique…

As I posted earlier, the network manager also was puzzled by the extra address,
but he didn’t have time to pursue it…we tried various experiments to figure it out…
all inconclusive.

Anyway, for now at least, I have something to work with in this self-tutorial in
IP Telephony…

Many many thanks for your help - I probably could never have figured this out
alone!

Phil

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.