Forward call from sip trunk to dahdi (zap) trunk

Hi all,

This is my setup

Centos 5.5
FreePBX 2.8.0 beta 2.4
Nortel Opt. 10

PSTN E1 <–> Nortel Opt. 10 (E1) <–> (E1) E100P (Dahdi) Asterisk FreePBX —> Internet <–> SIP Trunk
Ext: 2XXX - 3XXX Ext: 5XXX

I can make calls from the Nortel to the FreePBX and vise-versa. (2XXX - 3XXX to 5XXX) & (5XXX to 2XXX - 3XXX)

Everything is working fine, what I try to do now is the forward all incoming SIP Trunk call to the nortel Ext: 2000
thats the receptionist of my company, then she can trasnfer it to any other Ext.

With my Sip Device if I call Ext: 2000 she will pickup the call.

So I did an Incoming Route with my DID number: 305 XXX XXXX and set the Ext: 5000 (SIP FreePBX) as destination works fine,

My receptionist is the Ext 2000 in the Nortel, so I did a Misc. destination: 2000 and setup the Incoming Route to this Misc destinacion but is given me an error.

I tray FollowMe the same, another this is when I pickup an Incoming Sip Truck Call with my SIP Device and try to trasfer it to the Nortel won’t work the call hangs

I have 2 Incoming routes 1. Sip Trunk 2. E1 dahdi trunk (zap) for al incomming calls from the PSTN, for example at nigth the operator fowards all PSTN incoming calls to the EXT 5090 is our Support IVR that eventually makes a followme to our cell phones that work fine.

Please advise:
regards
Jorge

this is my log

pbxCLI>
<— SIP read from UDP:209.213.178.252:1041 —>
jaK
<------------->
pbx
CLI>
<— SIP read from UDP:208.77.4.13:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Record-Route: sip:208.77.4.13;r2=on;ftag=as72c81dda;lr
Record-Route: sip:10.20.8.18;r2=on;ftag=as72c81dda;lr
Record-Route: sip:10.20.8.29:5080;ftag=as72c81dda;lr
Via: SIP/2.0/UDP 208.77.4.13;branch=z9hG4bK4b8f.6aefc4a7.0
Via: SIP/2.0/UDP 10.20.8.29:5080;branch=z9hG4bK4b8f.8c93b561.0
Via: SIP/2.0/UDP 10.20.8.118:6060;branch=z9hG4bK7b348bdc;rport=6060
From: “SECC” sip:[email protected];tag=as72c81dda
To: sip:[email protected]:5080
Contact: sip:[email protected]:6060
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: WsMServer PBX
Max-Forwards: 15
Date: Mon, 21 Jun 2010 20:19:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 259
Remote-Party-ID: “SECC” sip:[email protected]:5060

v=0p8.wspbx.com
o=root 3415 3415 IN IP4 208.77.4.18
s=session
c=IN IP4 208.77.4.18
t=0 0
m=audio 15498 RTP/AVP 18 0 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -

<------------->
— (19 headers 12 lines) —
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Sending to 208.77.4.13 : 5060 (NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘telcentric’ for ‘7864227310’ from 208.77.4.13:5060
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 101
Found audio description format G729 for ID 18
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x50c (ulaw|alaw|g729|ilbc), peer - audio=0x104 (ulaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x104 (ulaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 208.77.4.18:15498
Looking for 305XXXXXXX in from-trunk-sip-telcentric (domain 216.XXX.XXX.XXX)
list_route: hop: sip:208.77.4.13;r2=on;ftag=as72c81dda;lr
list_route: hop: sip:10.20.8.18;r2=on;ftag=as72c81dda;lr
list_route: hop: sip:10.20.8.29:5080;ftag=as72c81dda;lr
pbx*CLI>
<— Transmitting (NAT) to 208.77.4.13:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 208.77.4.13;branch=z9hG4bK4b8f.6aefc4a7.0;received=208.77.4.13
Via: SIP/2.0/UDP 10.20.8.29:5080;branch=z9hG4bK4b8f.8c93b561.0
Via: SIP/2.0/UDP 10.20.8.118:6060;branch=z9hG4bK7b348bdc;rport=6060
Record-Route: sip:208.77.4.13;r2=on;ftag=as72c81dda;lr
Record-Route: sip:10.20.8.18;r2=on;ftag=as72c81dda;lr
Record-Route: sip:10.20.8.29:5080;ftag=as72c81dda;lr
From: “SECC” sip:[email protected];tag=as72c81dda
To: sip:[email protected]:5080
Call-ID: [email protected]
CSeq: 102 INVITE
Server: Asterisk PBX 1.6.2.7
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:[email protected]
Content-Length: 0

<------------>
– Executing [[email protected]:1] Set(“SIP/telcentric-00000040”, “GROUP()=OUT_2”) in new stack
– Executing [[email protected]:2] Goto(“SIP/telcentric-00000040”, “from-trunk,305XXXXXXX,1”) in new stack
– Goto (from-trunk,305XXXXXXX,1)
– Executing [[email protected]:1] Set(“SIP/telcentric-00000040”, “__FROM_DID=305XXXXXXX”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/telcentric-00000040”, “app-blacklist-check,s,1”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/telcentric-00000040”, “0?blacklisted”) in new stack
– Executing [[email protected]:2] Set(“SIP/telcentric-00000040”, “CALLED_BLACKLIST=1”) in new stack
– Executing [[email protected]:3] Return(“SIP/telcentric-00000040”, “”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/telcentric-00000040”, “0 ?Set(CALLERID(name)=7864227310)”) in new stack
– Executing [[email protected]:4] SetMusicOnHold(“SIP/telcentric-00000040”, “WorldcomMSG”) in new stack
– Executing [[email protected]:5] Set(“SIP/telcentric-00000040”, “__MOHCLASS=WorldcomMSG”) in new stack
– Executing [[email protected]:6] Set(“SIP/telcentric-00000040”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:7] Set(“SIP/telcentric-00000040”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [[email protected]:8] Goto(“SIP/telcentric-00000040”, “ext-miscdests,4,1”) in new stack
– Goto (ext-miscdests,4,1)
– Executing [[email protected]:1] NoOp(“SIP/telcentric-00000040”, “MiscDest: Operadora”) in new stack
– Executing [[email protected]:2] Goto(“SIP/telcentric-00000040”, “from-internal,2000,1”) in new stack
– Goto (from-internal,2000,1)
– Executing [[email protected]:1] Macro(“SIP/telcentric-00000040”, “user-callerid,SKIPTTL,”) in new stack
– Executing [[email protected]:1] Set(“SIP/telcentric-00000040”, “AMPUSER=7864227310”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/telcentric-00000040”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/telcentric-00000040”, “1?Set(REALCALLERIDNUM=7864227310)”) in new stack
– Executing [[email protected]:4] Set(“SIP/telcentric-00000040”, “AMPUSER=”) in new stack
– Executing [[email protected]:5] Set(“SIP/telcentric-00000040”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/telcentric-00000040”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [[email protected]:10] GotoIf(“SIP/telcentric-00000040”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] NoOp(“SIP/telcentric-00000040”, “Using CallerID “SECC” <7864227310>”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/telcentric-00000040”, “Calling Out Route: 9_outside”) in new stack
– Executing [[email protected]:3] Set(“SIP/telcentric-00000040”, “_NODEST=”) in new stack
– Executing [[email protected]:4] Macro(“SIP/telcentric-00000040”, “record-enable,OUT,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/telcentric-00000040”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“SIP/telcentric-00000040”, “1?MacroExit()”) in new stack
– Executing [[email protected]:5] Macro(“SIP/telcentric-00000040”, “dialout-trunk,1,2000,”) in new stack
– Executing [[email protected]:1] Set(“SIP/telcentric-00000040”, “DIAL_TRUNK=1”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/telcentric-00000040”, “0?sub-pincheck,s,1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/telcentric-00000040”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:4] Set(“SIP/telcentric-00000040”, “DIAL_NUMBER=2000”) in new stack
– Executing [[email protected]k:5] Set(“SIP/telcentric-00000040”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [[email protected]:6] Set(“SIP/telcentric-00000040”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/telcentric-00000040”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/telcentric-00000040”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“SIP/telcentric-00000040”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [[email protected]:11] Macro(“SIP/telcentric-00000040”, “outbound-callerid,1”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/telcentric-00000040”, “1?Set(CALLERPRES()=allowed_not_screened)”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/telcentric-00000040”, “0?Set(REALCALLERIDNUM=7864227310)”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/telcentric-00000040”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [[email protected]:6] Set(“SIP/telcentric-00000040”, “USEROUTCID=”) in new stack
– Executing [[email protected]:7] Set(“SIP/telcentric-00000040”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:8] Set(“SIP/telcentric-00000040”, “TRUNKOUTCID=”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/telcentric-00000040”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] ExecIf(“SIP/telcentric-00000040”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/telcentric-00000040”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/telcentric-00000040”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/telcentric-00000040”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [[email protected]:12] GosubIf(“SIP/telcentric-00000040”, “1?sub-flp-1,s,1”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/telcentric-00000040”, “0?Return()”) in new stack
– Executing [[email protected]:2] Return(“SIP/telcentric-00000040”, “”) in new stack
– Executing [[email protected]:13] Set(“SIP/telcentric-00000040”, “OUTNUM=2000”) in new stack
– Executing [[email protected]:14] Set(“SIP/telcentric-00000040”, “custom=DAHDI/g0”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/telcentric-00000040”, “1?Set(DIAL_TRUNK_OPTIONS=M(setmusic^WorldcomMSG))”) in new stack
– Executing [[email protected]:16] Macro(“SIP/telcentric-00000040”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/telcentric-00000040”, “”) in new stack
– Executing [[email protected]:17] GotoIf(“SIP/telcentric-00000040”, “0?bypass,1”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/telcentric-00000040”, “0?customtrunk”) in new stack
– Executing [[email protected]:19] Dial(“SIP/telcentric-00000040”, “DAHDI/g0/2000,300,M(setmusic^WorldcomMSG)”) in new stack
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:20] NoOp(“SIP/telcentric-00000040”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 58”) in new stack
– Executing [[email protected]:21] Goto(“SIP/telcentric-00000040”, “s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] Set(“SIP/telcentric-00000040”, “RC=58”) in new stack
– Executing [[email protected]:2] Goto(“SIP/telcentric-00000040”, “58,1”) in new stack
– Goto (macro-dialout-trunk,58,1)
– Executing [[email protected]:1] Goto(“SIP/telcentric-00000040”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] GotoIf(“SIP/telcentric-00000040”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [[email protected]:3] NoOp(“SIP/telcentric-00000040”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 58 - failing through to other trunks”) in new stack
– Executing [[email protected]:4] Set(“SIP/telcentric-00000040”, “CALLERID(number)=”) in new stack
– Executing [[email protected]:6] Macro(“SIP/telcentric-00000040”, “outisbusy,”) in new stack
– Executing [[email protected]:1] Progress(“SIP/telcentric-00000040”, “”) in new stack
Audio is at 216.XXX.XXX.XXX port 16226
Adding codec 0x100 (g729) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
pbx*CLI>
<— Transmitting (NAT) to 208.77.4.13:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 208.77.4.13;branch=z9hG4bK4b8f.6aefc4a7.0;received=208.77.4.13
Via: SIP/2.0/UDP 10.20.8.29:5080;branch=z9hG4bK4b8f.8c93b561.0
Via: SIP/2.0/UDP 10.20.8.118:6060;branch=z9hG4bK7b348bdc;rport=6060
Record-Route: sip:208.77.4.13;r2=on;ftag=as72c81dda;lr
Record-Route: sip:10.20.8.18;r2=on;ftag=as72c81dda;lr
Record-Route: sip:10.20.8.29:5080;ftag=as72c81dda;lr
From: “SECC” sip:[email protected];tag=as72c81dda
To: sip:[email protected]:5080;tag=as66a0d73d
Call-ID: [email protected]
CSeq: 102 INVITE
Server: Asterisk PBX 1.6.2.7
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:[email protected]
Content-Type: application/sdp
Content-Length: 310

v=0
o=root 174358416 174358416 IN IP4 216.XXX.XXX.XXX
s=Asterisk PBX 1.6.2.7
c=IN IP4 216.XXX.XXX.XXX
t=0 0
m=audio 16226 RTP/AVP 18 0 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>
– Executing [[email protected]:2] GotoIf(“SIP/telcentric-00000040”, “0?emergency,1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/telcentric-00000040”, “0?intracompany,1”) in new stack
– Executing [[email protected]:4] Playback(“SIP/telcentric-00000040”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– Executing [[email protected]:5] Congestion(“SIP/telcentric-00000040”, “20”) in new stack
pbx*CLI>
<— Reliably Transmitting (NAT) to 208.77.4.13:5060 —>
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 208.77.4.13;branch=z9hG4bK4b8f.6aefc4a7.0;received=208.77.4.13
Via: SIP/2.0/UDP 10.20.8.29:5080;branch=z9hG4bK4b8f.8c93b561.0
Via: SIP/2.0/UDP 10.20.8.118:6060;branch=z9hG4bK7b348bdc;rport=6060
From: “SECC” sip:[email protected];tag=as72c81dda
To: sip:[email protected]:5080;tag=as66a0d73d
Call-ID: [email protected]
CSeq: 102 INVITE
Server: Asterisk PBX 1.6.2.7
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0
X-Asterisk-HangupCause: Bearer capability not available
X-Asterisk-HangupCauseCode: 58

<------------>
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/telcentric-00000040’ in macro ‘outisbusy’
== Spawn extension (from-internal, 2000, 6) exited non-zero on ‘SIP/telcentric-00000040’
– Executing [[email protected]:1] Macro(“SIP/telcentric-00000040”, “hangupcall”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/telcentric-00000040”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“SIP/telcentric-00000040”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] GotoIf(“SIP/telcentric-00000040”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] Hangup(“SIP/telcentric-00000040”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/telcentric-00000040’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/telcentric-00000040’
pbx*CLI>
<— SIP read from UDP:208.77.4.13:5060 —>
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 208.77.4.13;branch=z9hG4bK4b8f.6aefc4a7.0
From: “SECC” sip:[email protected];tag=as72c81dda
Call-ID: [email protected]
To: sip:[email protected]:5080;tag=as66a0d73d
CSeq: 102 ACK
User-Agent: Worksmart Router(0.9.6 (i386/linux))
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Really destroying SIP dialog ‘[email protected]’ Method: ACK
pbxCLI>
<— SIP read from UDP:209.213.178.252:1041 —>
jaK
<------------->
Really destroying SIP dialog ‘[email protected]’ Method: REGISTER
pbx
CLI> sip set debug off