Dialing via ISDN Card from another Asterisk server

Hi all,

I’m new in the forums and I would like to ask you for some support, if possible.

I have installed a new server with the following configuration:

  • Asterisk 1.8.19
  • FreePBX 2.10

I’ve configured a DUNDi trunk which works with no problem. It is connected to a different server and the authentication for dundi peers is done with no problems among themselves.

Furthermore, I’ve tried to configure a DAHDi trunk in order to have it as a back up line. However, even though the ISDN Card (Network controller: SiteCom Europe BV ISDN PCI DC-105V2) has been properly installed, the outgoing calls are dropped because the trunk hasn’t been correctly defined.

The reason why I ask you for support is as follows:

We had an old server whose ISDN Card was working with no problem.

Would it be possible to stablish a SIP trunk between the two servers, so this trunk will be used in an emergency case, and then such trunk should somehow take the DAHDI trunk from the old server in order to make calls via the ISDN line?

I’d be great if you can suggest any solution. I don’t know if I’m clear enough. If not, please let me know and I will try to describe the situation better.

Thanks a lot in advance!

Yes, you should build a trunk between the machines. I would use IAX not SIP.

Make sure the end that will be terminating the calls is in the from-internal context.

The context will allow the remote users to access the dial plan on the target machine.

You will have to craft outbound routes to mesh the dial plans as needed.

Hi again. Thanks a lot for the suggestion.

I’ve built the IAX2 trunk between the two servers. The IAX2 show peers command shows both peers whose status are OK.

Nevetheless, when I make a call from asterisk02 using the right outbound configuration and this outbound fetches the IAX2 trunk, I got an error message and the typical recording that the call cannot be completed as dialed. In addition, there’s nothing displayed on the CLI from asterisk04.

asterisk04*CLI> iax2 show peers
Name/Username Host Mask Port Status
IAXTest/admin 10.10.11.2 (S) 255.255.255.0 4569 OK (1 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]

asterisk02CLI> iax2 show peers
Name/Username Host Mask Port Status
IAXTest/IAXTest 10.10.11.5 (S) 255.255.255.0 4569 (T) OK (1 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
asterisk02
CLI>

From asterisk02 I try to make the call, so asterisk04 should handle it in order to pass it over to the next trunk which should be the DAHDi trunk.

Outgoing settings for asterisk02 (Via FreePBX)

allow=g729&alaw
context=from-internal
deny=all
host=10.10.11.5
mask=255.255.255.0
qualify=yes
secret=admin
trunk=yes
type=peer
username=IAXTest-user

Incoming settings for asterisk04 (Via FreePBX)

USER CONTEXT: IAXTest-user
secret=admin
type=user
context=from-internal

More suggestions would be very helpful.

Thanks again in advance!

P.S. This is the output generated when making a call.

asterisk02CLI>
– Executing Macro(“SIP/5833-b6605d78”, “dialout-trunk|3|5833||”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “DIAL_TRUNK=3”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “DIAL_NUMBER=5833”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “ROUTE_PASSWD=”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?noauth”) in new stack
– Goto (macro-dialout-trunk,s,6)
– Executing GotoIf(“SIP/5833-b6605d78”, “0?disabletrunk|1”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “_NODEST=”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “GROUP()=OUT_3”) in new stack
– Executing Macro(“SIP/5833-b6605d78”, “user-callerid|SKIPTTL”) in new stack
– Executing NoOp(“SIP/5833-b6605d78”, “user-callerid: device 5833”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “AMPUSER=5833”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?report”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?start”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “REALCALLERIDNUM=5833”) in new stack
– Executing NoOp(“SIP/5833-b6605d78”, “REALCALLERIDNUM is 5833”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “AMPUSER=5833”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “AMPUSERCIDNAME=Angela Merkel”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?report”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “AMPUSERCID=5833”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “CALLERID(all)=“Angela Merkel” <5833>”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “REALCALLERIDNUM=5833”) in new stack
– Executing NoOp(“SIP/5833-b6605d78”, “TTL: ARG1: SKIPTTL”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,23)
– Executing NoOp(“SIP/5833-b6605d78”, “Using CallerID “Angela Merkel” <5833>”) in new stack
– Executing Macro(“SIP/5833-b6605d78”, “record-enable|5833|OUT”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing AGI(“SIP/5833-b6605d78”, “recordingcheck|20121214-101316|asterisk-16616-1355479996.7339”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20121214-101316|asterisk-16616-1355479996.7339: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/5833-b6605d78”, “No recording needed”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?skipoutcid”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing Macro(“SIP/5833-b6605d78”, “outbound-callerid|3”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/5833-b6605d78”, “REALCALLERIDNUM is 5833”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,9)
– Executing Set(“SIP/5833-b6605d78”, “USEROUTCID=”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “TRUNKOUTCID=”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,16)
– Executing GotoIf(“SIP/5833-b6605d78”, “1?usercid”) in new stack
– Goto (macro-outbound-callerid,s,18)
– Executing GotoIf(“SIP/5833-b6605d78”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/5833-b6605d78”, “CallerID set to “Angela Merkel” <5833>”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,17)
– Executing AGI(“SIP/5833-b6605d78”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/5833-b6605d78”, “OUTNUM=5833”) in new stack
– Executing Set(“SIP/5833-b6605d78”, “custom=IAX2/IAXTest”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?gocall”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing Macro(“SIP/5833-b6605d78”, “dialout-trunk-predial-hook”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?bypass|1”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/5833-b6605d78”, “IAX2/IAXTest/5833|300|”) in new stack
– Called IAXTest/5833
– Hungup ‘IAX2/IAXTest-16384’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Goto(“SIP/5833-b6605d78”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing GotoIf(“SIP/5833-b6605d78”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
– Executing NoOp(“SIP/5833-b6605d78”, “TRUNK Dial failed due to CHANUNAVAIL - failing through to other trunks”) in new stack
– Executing Macro(“SIP/5833-b6605d78”, “outisbusy|”) in new stack
– Executing Playback(“SIP/5833-b6605d78”, “all-circuits-busy-now|noanswer”) in new stack
– Playing ‘all-circuits-busy-now’ (language ‘en’)
– Executing Playback(“SIP/5833-b6605d78”, “pls-try-call-later|noanswer”) in new stack
– Playing ‘pls-try-call-later’ (language ‘en’)
– Executing Macro(“SIP/5833-b6605d78”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/5833-b6605d78”, “w”) in new stack
– Executing NoCDR(“SIP/5833-b6605d78”, “”) in new stack
– Executing GotoIf(“SIP/5833-b6605d78”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing GotoIf(“SIP/5833-b6605d78”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing GotoIf(“SIP/5833-b6605d78”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing Hangup(“SIP/5833-b6605d78”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/5833-b6605d78’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/5833-b6605d78’ in macro ‘outisbusy’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/5833-b6605d78’
asterisk02
CLI>

Do you have g.729 license installed?

Also you have the allow before the deny, the deny will negate the allow.

more specifically you have

deny all

after

allow=g729&alaw

This will guarantee by the order of iprocessing (and inclusion if appropriate) that you have no valid codecs, even if you have installed g729 licenses.

just swap those two lines.