SIP to FXO Routing- Need help please!

I am using the PIKA Warp appliance with free PBX on it as well as Asterisk.
Free PBX version is 2.8.0.3.

I am trying to get certain SIP extensions to be routed to certain FXO lines.
I have SIP extension 2001 and when it dials out I want it to go to FXO 1.
SIP Extension 2002 I want that to go to FXO 2.

I have the Inbound routes working the way I want but I cant seem to get outbound routing to work.

I have assigned CID’s to each extension I wanted routed and then programed the outbound routes for those CID’s. But when I test them they both go to FXO 1.

A interesting thing I noticed is that when I changed the outbound route order, both extensions go to FXO 2.
IE: CID 2001 set for FXO 1
CID 2002 Set for FXO 2

Changed it to:
CID 2002 set for FXO 2
CID 2001 set for FXO 1

Now both extensions go to FXO 2.

I changed it back to the way I had it before for this capture.
I am no expert on this so I am hoping someone will know how to do this. Thanks in advanced!

---------------Extension 2002 test----------------------
Connected to Asterisk 1.4.25.1 currently running on warp (pid = 1935)
Verbosity is at least 9
– <SIP/1013-4ca05018> Playing ‘digits/1’ (language ‘en’)
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
– <SIP/1013-4ca05018> Playing ‘digits/0’ (language ‘en’)
– <SIP/1013-4ca05018> Playing ‘digits/1’ (language ‘en’)
== Manager ‘admin’ logged off from 127.0.0.1
– <SIP/1013-4ca05018> Playing ‘digits/3’ (language ‘en’)
– <SIP/1013-4ca05018> Playing ‘vm-isunavail’ (language ‘en’)
– <SIP/1013-4ca05018> Playing ‘vm-intro’ (language ‘en’)
– Executing [[email protected]:1] Macro(“SIP/2002-4ca02e68”, “user-callerid|SKIPTTL|”) in new stack
– Executing [[email protected]:1] Set(“SIP/2002-4ca02e68”, “AMPUSER=2002”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/2002-4ca02e68”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/2002-4ca02e68”, “1|Set|REALCALLERIDNUM=2002”) in new stack
– Executing [[email protected]:4] Set(“SIP/2002-4ca02e68”, “AMPUSER=2002”) in new stack
– Executing [[email protected]:5] Set(“SIP/2002-4ca02e68”, “AMPUSERCIDNAME=LinkSys 2002”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/2002-4ca02e68”, “0?report”) in new stack
– Executing [[email protected]:7] Set(“SIP/2002-4ca02e68”, “AMPUSERCID=2002”) in new stack
– Executing [[email protected]:8] Set(“SIP/2002-4ca02e68”, “CALLERID(all)=“LinkSys 2002” <2002>”) in new stack
– Executing [[email protected]:9] ExecIf(“SIP/2002-4ca02e68”, “0|Set|CHANNEL(language)=”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/2002-4ca02e68”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] Set(“SIP/2002-4ca02e68”, “CALLERID(number)=2002”) in new stack
– Executing [[email protected]:20] Set(“SIP/2002-4ca02e68”, “CALLERID(name)=LinkSys 2002”) in new stack
– Executing [[email protected]:21] NoOp(“SIP/2002-4ca02e68”, “Using CallerID “LinkSys 2002” <2002>”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/2002-4ca02e68”, “Calling Out Route: extension2001”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/2002-4ca02e68”, “0|Set|TRUNKCIDOVERRIDE=2001”) in new stack
– Executing [[email protected]:4] Set(“SIP/2002-4ca02e68”, “_NODEST=”) in new stack
– Executing [[email protected]:5] Macro(“SIP/2002-4ca02e68”, “record-enable|2002|OUT|”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2002-4ca02e68”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“SIP/2002-4ca02e68”, “0|MacroExit|”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/2002-4ca02e68”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,15)
– Executing [[email protected]:15] GotoIf(“SIP/2002-4ca02e68”, “0?IN”) in new stack
– Executing [[email protected]:16] ExecIf(“SIP/2002-4ca02e68”, “1|MacroExit|”) in new stack
– Executing [[email protected]:6] Macro(“SIP/2002-4ca02e68”, “dialout-trunk|3|5551212|”) in new stack
– Executing [[email protected]:1] Set(“SIP/2002-4ca02e68”, “DIAL_TRUNK=3”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/2002-4ca02e68”, “0?sub-pincheck|s|1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/2002-4ca02e68”, “0?disabletrunk|1”) in new stack
– Executing [[email protected]:4] Set(“SIP/2002-4ca02e68”, “DIAL_NUMBER=5551212”) in new stack
– Executing [[email protected]:5] Set(“SIP/2002-4ca02e68”, “DIAL_TRUNK_OPTIONS=r”) in new stack
– Executing [[email protected]:6] Set(“SIP/2002-4ca02e68”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/2002-4ca02e68”, “0?nomax”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/2002-4ca02e68”, “0?chanfull”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/2002-4ca02e68”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“SIP/2002-4ca02e68”, “DIAL_TRUNK_OPTIONS=t”) in new stack
– Executing [[email protected]:11] Macro(“SIP/2002-4ca02e68”, “outbound-callerid|3”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/2002-4ca02e68”, “0|SetCallerPres|”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/2002-4ca02e68”, “0|Set|REALCALLERIDNUM=2002”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/2002-4ca02e68”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [[email protected]:6] Set(“SIP/2002-4ca02e68”, “USEROUTCID=2002”) in new stack
– Executing [[email protected]:7] Set(“SIP/2002-4ca02e68”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:8] Set(“SIP/2002-4ca02e68”, “TRUNKOUTCID=4024672001”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/2002-4ca02e68”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] ExecIf(“SIP/2002-4ca02e68”, “1|Set|CALLERID(all)=4024672001”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/2002-4ca02e68”, “1|Set|CALLERID(all)=2002”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/2002-4ca02e68”, “0|Set|CALLERID(all)=”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/2002-4ca02e68”, “0|SetCallerPres|prohib_passed_screen”) in new stack
– Executing [[email protected]:12] GosubIf(“SIP/2002-4ca02e68”, “1?sub-flp-3|s|1”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/2002-4ca02e68”, “1|Return|”) in new stack
– Executing [[email protected]:13] Set(“SIP/2002-4ca02e68”, “OUTNUM=5551212”) in new stack
– Executing [[email protected]:14] Set(“SIP/2002-4ca02e68”, “custom=AMP”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/2002-4ca02e68”, “0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^)t”) in new stack
– Executing [[email protected]:16] Macro(“SIP/2002-4ca02e68”, “dialout-trunk-predial-hook|”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/2002-4ca02e68”, “”) in new stack
– Executing [[email protected]:17] GotoIf(“SIP/2002-4ca02e68”, “0?bypass|1”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/2002-4ca02e68”, “1?customtrunk”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing [[email protected]:22] Set(“SIP/2002-4ca02e68”, “pre_num=AMP:PIKA/fxo/1/”) in new stack
– Executing [[email protected]:23] Set(“SIP/2002-4ca02e68”, “the_num=OUTNUM”) in new stack
– Executing [[email protected]:24] Set(“SIP/2002-4ca02e68”, “post_num=”) in new stack
– Executing [[email protected]:25] GotoIf(“SIP/2002-4ca02e68”, “1?outnum:skipoutnum”) in new stack
– Goto (macro-dialout-trunk,s,26)
– Executing [[email protected]:26] Set(“SIP/2002-4ca02e68”, “the_num=5551212”) in new stack
– Executing [[email protected]:27] Dial(“SIP/2002-4ca02e68”, “PIKA/fxo/1/5551212|300|t”) in new stack
– group 0/0 channel 0/0 type=4
– Called fxo/1/5551212
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Spawn extension (macro-dialout-trunk, s, 27) exited non-zero on ‘SIP/2002-4ca02e68’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 5551212, 6) exited non-zero on ‘SIP/2002-4ca02e68’
– Executing [[email protected]:1] Macro(“SIP/2002-4ca02e68”, “hangupcall|”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2002-4ca02e68”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“SIP/2002-4ca02e68”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] GotoIf(“SIP/2002-4ca02e68”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] Hangup(“SIP/2002-4ca02e68”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/2002-4ca02e68’ in macro ‘hangupcall’
== Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on ‘SIP/2002-4ca02e68’
== Manager ‘admin’ logged off from 127.0.0.1
– <SIP/1013-4ca05018> Playing ‘beep’ (language ‘en’)
– Recording the message
– x=0, open writing: /var/spool/asterisk/voicemail/default/1013/tmp/iGXTkr format: wav, 0x101986e8

---------------Extension 2001 test----------------------
Connected to Asterisk 1.4.25.1 currently running on warp (pid = 1935)
Verbosity is at least 9
– Executing [[email protected]:1] Macro(“SIP/2001-4ca0e6c8”, “user-callerid|SKIPTTL|”) in new stack
– Executing [[email protected]:1] Set(“SIP/2001-4ca0e6c8”, “AMPUSER=2001”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/2001-4ca0e6c8”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/2001-4ca0e6c8”, “1|Set|REALCALLERIDNUM=2001”) in new stack
– Executing [[email protected]:4] Set(“SIP/2001-4ca0e6c8”, “AMPUSER=2001”) in new stack
– Executing [[email protected]:5] Set(“SIP/2001-4ca0e6c8”, “AMPUSERCIDNAME=LinkSys 2001”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/2001-4ca0e6c8”, “0?report”) in new stack
– Executing [[email protected]:7] Set(“SIP/2001-4ca0e6c8”, “AMPUSERCID=2001”) in new stack
– Executing [[email protected]:8] Set(“SIP/2001-4ca0e6c8”, “CALLERID(all)=“LinkSys 2001” <2001>”) in new stack
– Executing [[email protected]:9] ExecIf(“SIP/2001-4ca0e6c8”, “0|Set|CHANNEL(language)=”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/2001-4ca0e6c8”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] Set(“SIP/2001-4ca0e6c8”, “CALLERID(number)=2001”) in new stack
– Executing [[email protected]:20] Set(“SIP/2001-4ca0e6c8”, “CALLERID(name)=LinkSys 2001”) in new stack
– Executing [[email protected]:21] NoOp(“SIP/2001-4ca0e6c8”, “Using CallerID “LinkSys 2001” <2001>”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/2001-4ca0e6c8”, “Calling Out Route: extension2001”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/2001-4ca0e6c8”, “0|Set|TRUNKCIDOVERRIDE=2001”) in new stack
– Executing [[email protected]:4] Set(“SIP/2001-4ca0e6c8”, “_NODEST=”) in new stack
– Executing [[email protected]:5] Macro(“SIP/2001-4ca0e6c8”, “record-enable|2001|OUT|”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2001-4ca0e6c8”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“SIP/2001-4ca0e6c8”, “0|MacroExit|”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/2001-4ca0e6c8”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,15)
– Executing [[email protected]:15] GotoIf(“SIP/2001-4ca0e6c8”, “0?IN”) in new stack
– Executing [[email protected]:16] ExecIf(“SIP/2001-4ca0e6c8”, “1|MacroExit|”) in new stack
– Executing [[email protected]:6] Macro(“SIP/2001-4ca0e6c8”, “dialout-trunk|3|5551212|”) in new stack
– Executing [[email protected]:1] Set(“SIP/2001-4ca0e6c8”, “DIAL_TRUNK=3”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/2001-4ca0e6c8”, “0?sub-pincheck|s|1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/2001-4ca0e6c8”, “0?disabletrunk|1”) in new stack
– Executing [[email protected]:4] Set(“SIP/2001-4ca0e6c8”, “DIAL_NUMBER=5551212”) in new stack
– Executing [[email protected]:5] Set(“SIP/2001-4ca0e6c8”, “DIAL_TRUNK_OPTIONS=r”) in new stack
– Executing [[email protected]:6] Set(“SIP/2001-4ca0e6c8”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/2001-4ca0e6c8”, “0?nomax”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/2001-4ca0e6c8”, “0?chanfull”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/2001-4ca0e6c8”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“SIP/2001-4ca0e6c8”, “DIAL_TRUNK_OPTIONS=t”) in new stack
– Executing [[email protected]:11] Macro(“SIP/2001-4ca0e6c8”, “outbound-callerid|3”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/2001-4ca0e6c8”, “0|SetCallerPres|”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/2001-4ca0e6c8”, “0|Set|REALCALLERIDNUM=2001”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/2001-4ca0e6c8”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [[email protected]:6] Set(“SIP/2001-4ca0e6c8”, “USEROUTCID=2001”) in new stack
– Executing [[email protected]:7] Set(“SIP/2001-4ca0e6c8”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:8] Set(“SIP/2001-4ca0e6c8”, “TRUNKOUTCID=4024672001”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/2001-4ca0e6c8”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] ExecIf(“SIP/2001-4ca0e6c8”, “1|Set|CALLERID(all)=4024672001”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/2001-4ca0e6c8”, “1|Set|CALLERID(all)=2001”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/2001-4ca0e6c8”, “0|Set|CALLERID(all)=”) in new stack
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
– Executing [[email protected]:15] ExecIf(“SIP/2001-4ca0e6c8”, “0|SetCallerPres|prohib_passed_screen”) in new stack
– Executing [[email protected]:12] GosubIf(“SIP/2001-4ca0e6c8”, “1?sub-flp-3|s|1”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/2001-4ca0e6c8”, “1|Return|”) in new stack
– Executing [[email protected]:13] Set(“SIP/2001-4ca0e6c8”, “OUTNUM=5551212”) in new stack
– Executing [[email protected]:14] Set(“SIP/2001-4ca0e6c8”, “custom=AMP”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/2001-4ca0e6c8”, “0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^)t”) in new stack
– Executing [[email protected]:16] Macro(“SIP/2001-4ca0e6c8”, “dialout-trunk-predial-hook|”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/2001-4ca0e6c8”, “”) in new stack
– Executing [[email protected]:17] GotoIf(“SIP/2001-4ca0e6c8”, “0?bypass|1”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/2001-4ca0e6c8”, “1?customtrunk”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing [[email protected]:22] Set(“SIP/2001-4ca0e6c8”, “pre_num=AMP:PIKA/fxo/1/”) in new stack
– Executing [[email protected]:23] Set(“SIP/2001-4ca0e6c8”, “the_num=OUTNUM”) in new stack
– Executing [[email protected]:24] Set(“SIP/2001-4ca0e6c8”, “post_num=”) in new stack
– Executing [[email protected]:25] GotoIf(“SIP/2001-4ca0e6c8”, “1?outnum:skipoutnum”) in new stack
– Goto (macro-dialout-trunk,s,26)
– Executing [[email protected]:26] Set(“SIP/2001-4ca0e6c8”, “the_num=5551212”) in new stack
– Executing [[email protected]:27] Dial(“SIP/2001-4ca0e6c8”, “PIKA/fxo/1/5551212|300|t”) in new stack
– group 0/0 channel 0/0 type=4
– Called fxo/1/5551212
– Executing [[email protected]:1] Macro(“SIP/1013-4ca08118”, “hangupcall”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/1013-4ca08118”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“SIP/1013-4ca08118”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] GotoIf(“SIP/1013-4ca08118”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] Hangup(“SIP/1013-4ca08118”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/1013-4ca08118’ in macro ‘hangupcall’
== Spawn h extension (macro-dial, h, 1) exited non-zero on ‘SIP/1013-4ca08118’
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/1013-4ca08118’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘SIP/1013-4ca08118’ in macro ‘exten-vm’
== Spawn extension (from-internal, 1012, 1) exited non-zero on ‘SIP/1013-4ca08118’
– Stopped music on hold on SIP/1013-4ca08118
== Manager ‘admin’ logged off from 127.0.0.1
== Spawn extension (macro-dialout-trunk, s, 27) exited non-zero on ‘SIP/2001-4ca0e6c8’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 5551212, 6) exited non-zero on ‘SIP/2001-4ca0e6c8’
– Executing [[email protected]:1] Macro(“SIP/2001-4ca0e6c8”, “hangupcall|”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2001-4ca0e6c8”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“SIP/2001-4ca0e6c8”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] GotoIf(“SIP/2001-4ca0e6c8”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] Hangup(“SIP/2001-4ca0e6c8”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/2001-4ca0e6c8’ in macro ‘hangupcall’
== Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on ‘SIP/2001-4ca0e6c8’