Inbound and out bound routes?

I’m sorry yesterday i couldn’t get you the logs because they rushed my father to the Hosptial. but I’m back now here is the logs.

– Executing [6099541532@from-internal:1] Macro(“SIP/752-0000b27d”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/752-0000b27d”, “TOUCH_MONITOR=1472310370.50111”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/752-0000b27d”, “AMPUSER=752”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/752-0000b27d”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/752-0000b27d”, “1?Set(REALCALLERIDNUM=752)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/752-0000b27d”, “AMPUSER=752”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/752-0000b27d”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/752-0000b27d”, “AMPUSERCIDNAME=521 MHP NJ”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“SIP/752-0000b27d”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“SIP/752-0000b27d”, “AMPUSERCID=752”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/752-0000b27d”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/752-0000b27d”, “CALLERID(all)=“521 MHP NJ” <752>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“SIP/752-0000b27d”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“SIP/752-0000b27d”, “1?Set(GROUP(concurrency_limit)=752)”) in new stack
– Executing [s@macro-user-callerid:14] GosubIf(“SIP/752-0000b27d”, “7?sub-ccss,s,1(from-internal,6099541532)”) in new stack
– Executing [s@sub-ccss:1] ExecIf(“SIP/752-0000b27d”, “0?Return()”) in new stack
– Executing [s@sub-ccss:2] Set(“SIP/752-0000b27d”, “CCSS_SETUP=TRUE”) in new stack
– Executing [s@sub-ccss:3] GosubIf(“SIP/752-0000b27d”, “0?monitor_config,1(from-internal,6099541532):monitor_default,1(from-internal,6099541532)”) in new stack
– Executing [monitor_default@sub-ccss:1] GotoIf(“SIP/752-0000b27d”, “0?is_exten”) in new stack
– Executing [monitor_default@sub-ccss:2] StackPop(“SIP/752-0000b27d”, “”) in new stack
– Executing [monitor_default@sub-ccss:3] Return(“SIP/752-0000b27d”, “FALSE”) in new stack
– Executing [s@macro-user-callerid:15] ExecIf(“SIP/752-0000b27d”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“SIP/752-0000b27d”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,30)
– Executing [s@macro-user-callerid:30] Set(“SIP/752-0000b27d”, “CALLERID(number)=752”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/752-0000b27d”, “CALLERID(name)=521 MHP NJ”) in new stack
– Executing [s@macro-user-callerid:32] Set(“SIP/752-0000b27d”, “CDR(cnum)=752”) in new stack
– Executing [s@macro-user-callerid:33] Set(“SIP/752-0000b27d”, “CDR(cnam)=521 MHP NJ”) in new stack
– Executing [s@macro-user-callerid:34] Set(“SIP/752-0000b27d”, “CHANNEL(language)=en”) in new stack
– Executing [6099541532@from-internal:2] Gosub(“SIP/752-0000b27d”, “sub-record-check,s,1(out,6099541532,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/752-0000b27d”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“SIP/752-0000b27d”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“SIP/752-0000b27d”, “NOW=1472310370”) in new stack
– Executing [s@sub-record-check:4] Set(“SIP/752-0000b27d”, “__DAY=27”) in new stack
– Executing [s@sub-record-check:5] Set(“SIP/752-0000b27d”, “__MONTH=08”) in new stack
– Executing [s@sub-record-check:6] Set(“SIP/752-0000b27d”, “__YEAR=2016”) in new stack
– Executing [s@sub-record-check:7] Set(“SIP/752-0000b27d”, “__TIMESTR=20160827-110610”) in new stack
– Executing [s@sub-record-check:8] Set(“SIP/752-0000b27d”, “__FROMEXTEN=752”) in new stack
– Executing [s@sub-record-check:9] Set(“SIP/752-0000b27d”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“SIP/752-0000b27d”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“SIP/752-0000b27d”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/752-0000b27d”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/752-0000b27d”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“SIP/752-0000b27d”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“SIP/752-0000b27d”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“SIP/752-0000b27d”, “Outbound Recording Check from 752 to 6099541532”) in new stack
– Executing [out@sub-record-check:2] Set(“SIP/752-0000b27d”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“SIP/752-0000b27d”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“SIP/752-0000b27d”, “recordcheck,1(dontcare,out,6099541532)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“SIP/752-0000b27d”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“SIP/752-0000b27d”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“SIP/752-0000b27d”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“SIP/752-0000b27d”, “”) in new stack
– Executing [6099541532@from-internal:3] ExecIf(“SIP/752-0000b27d”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [6099541532@from-internal:4] Set(“SIP/752-0000b27d”, “MOHCLASS=default”) in new stack
– Executing [6099541532@from-internal:5] ExecIf(“SIP/752-0000b27d”, “1?Set(TRUNKCIDOVERRIDE=6097779207)”) in new stack
– Executing [6099541532@from-internal:6] Set(“SIP/752-0000b27d”, “_NODEST=”) in new stack
– Executing [6099541532@from-internal:7] Macro(“SIP/752-0000b27d”, “dialout-trunk,3,6099541532,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/752-0000b27d”, “DIAL_TRUNK=3”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/752-0000b27d”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/752-0000b27d”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/752-0000b27d”, “DIAL_NUMBER=6099541532”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/752-0000b27d”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/752-0000b27d”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/752-0000b27d”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/752-0000b27d”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/752-0000b27d”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/752-0000b27d”, “DIAL_TRUNK_OPTIONS=Tt”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/752-0000b27d”, “outbound-callerid,3”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/752-0000b27d”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/752-0000b27d”, “0?Set(REALCALLERIDNUM=752)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/752-0000b27d”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/752-0000b27d”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/752-0000b27d”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/752-0000b27d”, “TRUNKOUTCID=6097779207”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/752-0000b27d”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,14)

And

– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/752-0000b27d”, “1?Set(CALLERID(all)=6097779207)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/752-0000b27d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“SIP/752-0000b27d”, “1?Set(CALLERID(all)=6097779207)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“SIP/752-0000b27d”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:18] Set(“SIP/752-0000b27d”, “CDR(outbound_cnum)=6097779207”) in new stack
– Executing [s@macro-outbound-callerid:19] Set(“SIP/752-0000b27d”, “CDR(outbound_cnam)=”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/752-0000b27d”, “0?sub-flp-3,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/752-0000b27d”, “OUTNUM=6099541532”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/752-0000b27d”, “custom=SIP/GXW4108”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/752-0000b27d”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Tt)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/752-0000b27d”, “0?Set(DIAL_TRUNK_OPTIONS=TtM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/752-0000b27d”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/752-0000b27d”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/752-0000b27d”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“SIP/752-0000b27d”, “1?Set(CONNECTEDLINE(num,i)=6099541532)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“SIP/752-0000b27d”, “1?Set(CONNECTEDLINE(name,i)=CID:6097779207)”) in new stack
– Executing [s@macro-dialout-trunk:21] GotoIf(“SIP/752-0000b27d”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:22] Dial(“SIP/752-0000b27d”, “SIP/GXW4108/6099541532,300,Tt”) in new stack
[2016-08-27 11:06:10] WARNING[7649][C-000043bd]: app_dial.c:2437 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:23] NoOp(“SIP/752-0000b27d”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20”) in new stack
– Executing [s@macro-dialout-trunk:24] GotoIf(“SIP/752-0000b27d”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/752-0000b27d”, “RC=20”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/752-0000b27d”, “20,1”) in new stack
– Goto (macro-dialout-trunk,20,1)
– Executing [20@macro-dialout-trunk:1] Goto(“SIP/752-0000b27d”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“SIP/752-0000b27d”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] Set(“SIP/752-0000b27d”, “CALLERID(number)=752”) in new stack
– Executing [6099541532@from-internal:8] Macro(“SIP/752-0000b27d”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“SIP/752-0000b27d”, “”) in new stack
– Executing [s@macro-outisbusy:2] GotoIf(“SIP/752-0000b27d”, “0?emergency,1”) in new stack
– Executing [s@macro-outisbusy:3] GotoIf(“SIP/752-0000b27d”, “0?intracompany,1”) in new stack
– Executing [s@macro-outisbusy:4] Playback(“SIP/752-0000b27d”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– <SIP/752-0000b27d> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en’)
> 0x7fc5ac64ad20 – Probation passed - setting RTP source address to 10.1.10.204:10534
– <SIP/752-0000b27d> Playing ‘pls-try-call-later.gsm’ (language ‘en’)
== Spawn extension (macro-outisbusy, s, 4) exited non-zero on ‘SIP/752-0000b27d’ in macro ‘outisbusy’
== Spawn extension (from-internal, 6099541532, 8) exited non-zero on ‘SIP/752-0000b27d’
– Executing [h@from-internal:1] Hangup(“SIP/752-0000b27d”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/752-0000b27d’
localhost*CLI>

Same error.
I tried to replicate your scenario here with my PRI gateway, but it’s working here.
Could be the trunk settings on both Asterisk and the gateway.

Here is what I would do:
If you have 7[01234]X in the outbound route for phones from 700 to 749, then make a call from an extension in that range and see if call completes with the analog cards. If yes, then you know that the proposed solution works, just not with the gateway yet.

Then do a SIP debug from CLI. sip set debug on to get deeper debug. Then we will at the trunk settings and/or you can open a new thread regarding the "Unable to create channel of type ‘SIP’ error.

Do you see the gateway registered as a peer in sip show peers?
What do you have under peer details for the trunk to the gateway? (don’t paste password).

I can in and call out from the analog lines with no problem. even with the 7[01234]X i it. However the FXO grandstream gateway i cannot call out when there is 7[56789]X in it. And if i take it out the 7[56789]X and call from Ext 751 or 759 just saying it calls out from the analog lines.

Do you see the gateway registered as a peer in sip show peers?What do you have under peer details for the trunk to the gateway? (don’t paste password).

Do you see the gateway registered as a peer in sip show peers?
What do you have under peer details for the trunk to the gateway? (don’t paste password).
Do a SIP debug from CLI. sip set debug on

i get this in ship show peers

GXW4108/6097779207 xx.xxx.xx.xxxx Yes Yes 5060 UNREACHABLE
53 sip peers [Monitored: 19 online, 34 offline Unmonitored: 0 online, 0 offline]

So it is there is a IP address just says unreachable.

Would like to see your trunk peer details. Obfuscate username and passwd if there are any.

Trunk peer details

In your screenshot, did you remove the entry for host to obfuscate the IP or is there none?
I am assuming that you mask username and secret as well, correct?
Is there an entry for context=… in the peer details?

The username and password is the phone number the host name i masked it. that is all the details there.

I didn’t put it as the phone number one of the guys from the forum did that.

I think there is something wrong Either in the fxo gateway or the outbound calling.

You shouldn’t get an unreachable message for the gateway.
Are your gateway and your server on the same subnet?
Looks like you don’t have a context=from trunk in the peer settings. Try and put it in.

The whole username being a phone number I don’t understand.

How do i set the context=from part?

In there:

I forgot we have VPN to the other place so i put the internal address in and this is what i got the log peers

GXW4108/6097779207 10.1.11.148 Yes Yes 5060 OK (4 ms)

Now it’s working it won’t take the external address. Because it is VPN connected. Only takes the Internal address. Now i can call out and call in.

I wonder if it is because of Ports? Does the gateway need ports to be open?

Excuse me, the context should be context=from-trunk.
Forgot the “-”.
You can also experiment with context=from-internal, to see if that makes a difference. (But use from-trunk if it doesn’t make a difference).

You should have had this problem from the start, cause this can’t be related to the outbound route solution.
You are now experiencing a network issue, your calls should have failed regardless.
I am assuming your gateway is behind a firewall and as I have no idea how your VPN is configured, I can’t tell you if you need to open ports, etc.