Caller ID wrong on internal calls

Hello Everyone,

We have just reinstalled all of our phone systems with the FPBX distro.
Everything is working fin except for one issue with internal caller ID.

Each of our phone systems have a different range of extension numbers & an IAX trunk to each other. We have configured outbound routes for each site & ticked the box to select it as an Intra-Office route.

Now when an extension number at one site calls an extension at a different site, the caller ID show at the receiving end is not the one of the calling phone, it is a random local extensions caller id.

As an example from this morning: Ext 2305 from Site A called Ext 2001 at Site B, Ext 2001 saw the caller ID for Ext 2098 which is also in Site B.

Does anyone know why this might be happening?

Regards,
Josh

I suspect you’ve configured your interoffice trunks incorrectly.

We used the same configuration that we used on our previous distribution that worked fine.

Trunk Config:
Outbound CallerID: Blank
CID Options: Allow Any CID

type=friend
secret=password
qualify=yes
host=Host
disallow=all
context=from-internal
allow=ulaw

Outbound Route:
Route CID: Blank
Route Type: Intra-Office
Call patterns & trunk configured

Try this:

type=friend
qualify=yes
host=192.168.x.x
dtmfmode=rfc2833
context=from-internal
secret=password

How are your Trunk CID options set?

Mine is set to Allow Any CID.

As I mentioned in my second post, it is set to Allow Any CID.

Adding the dtmfmode setting didn’t make a difference.
I also added a Caller ID setting for each trunk, didnt help.

What do the Asterisk logs say?

Sorry for the delay.

Here are the logs for a test call.
Call was made from SIP extension 2299 at one site to SIP extension 2099 at the other. Call was made over IAX trunk.

Dialling End:

[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [2099@from-internal:1] Macro("SIP/2299-0000015f", "user-callerid,LIMIT,") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:1] Set("SIP/2299-0000015f", "AMPUSER=2299") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:2] GotoIf("SIP/2299-0000015f", "0?report") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:3] ExecIf("SIP/2299-0000015f", "1?Set(REALCALLERIDNUM=2299)") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:4] Set("SIP/2299-0000015f", "AMPUSER=2299") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:5] Set("SIP/2299-0000015f", "AMPUSERCIDNAME=Test SIP") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:6] GotoIf("SIP/2299-0000015f", "0?report") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:7] Set("SIP/2299-0000015f", "AMPUSERCID=2299") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:8] Set("SIP/2299-0000015f", "CALLERID(all)="Test SIP" <2299>") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:9] GotoIf("SIP/2299-0000015f", "0?limit") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:10] ExecIf("SIP/2299-0000015f", "1?Set(GROUP(concurrency_limit)=2299)") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:11] GosubIf("SIP/2299-0000015f", "7?sub-ccss,s,1(from-internal,2099)") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@sub-ccss:1] ExecIf("SIP/2299-0000015f", "0?Return()") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@sub-ccss:2] Set("SIP/2299-0000015f", "CCSS_SETUP=TRUE") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@sub-ccss:3] GosubIf("SIP/2299-0000015f", "0?monitor_config,1(from-internal,2099):monitor_default,1(from-internal,2099)") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [monitor_default@sub-ccss:1] GotoIf("SIP/2299-0000015f", "0?is_exten") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [monitor_default@sub-ccss:2] StackPop("SIP/2299-0000015f", "") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [monitor_default@sub-ccss:3] Return("SIP/2299-0000015f", "FALSE") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:12] ExecIf("SIP/2299-0000015f", "0?Set(CHANNEL(language)=)") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:13] GotoIf("SIP/2299-0000015f", "1?continue") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Goto (macro-user-callerid,s,26)
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:26] Set("SIP/2299-0000015f", "CALLERID(number)=2299") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:27] Set("SIP/2299-0000015f", "CALLERID(name)=Test SIP") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-user-callerid:28] Set("SIP/2299-0000015f", "CHANNEL(language)=en") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [2099@from-internal:2] Set("SIP/2299-0000015f", "INTRACOMPANYROUTE=YES") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [2099@from-internal:3] Set("SIP/2299-0000015f", "MOHCLASS=default") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [2099@from-internal:5] Set("SIP/2299-0000015f", "_NODEST=") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [2099@from-internal:6] Macro("SIP/2299-0000015f", "record-enable,2299,OUT,") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-record-enable:1] GotoIf("SIP/2299-0000015f", "1?check") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Goto (macro-record-enable,s,4)
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-record-enable:4] ExecIf("SIP/2299-0000015f", "0?MacroExit()") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-record-enable:5] GotoIf("SIP/2299-0000015f", "0?Group:OUT") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Goto (macro-record-enable,s,14)
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-record-enable:14] GotoIf("SIP/2299-0000015f", "0?IN") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-record-enable:15] ExecIf("SIP/2299-0000015f", "1?MacroExit()") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [2099@from-internal:7] Macro("SIP/2299-0000015f", "dialout-trunk,5,2099,") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:1] Set("SIP/2299-0000015f", "DIAL_TRUNK=5") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/2299-0000015f", "0?sub-pincheck,s,1") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/2299-0000015f", "0?disabletrunk,1") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:4] Set("SIP/2299-0000015f", "DIAL_NUMBER=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:5] Set("SIP/2299-0000015f", "DIAL_TRUNK_OPTIONS=tTxX") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:6] Set("SIP/2299-0000015f", "OUTBOUND_GROUP=OUT_5") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/2299-0000015f", "1?nomax") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Goto (macro-dialout-trunk,s,9)
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/2299-0000015f", "1?skipoutcid") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Goto (macro-dialout-trunk,s,12)
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/2299-0000015f", "0?sub-flp-5,s,1") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:13] Set("SIP/2299-0000015f", "OUTNUM=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:14] Set("SIP/2299-0000015f", "custom=IAX2/CB-MEL") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/2299-0000015f", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)tTxX)") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/2299-0000015f", "0?Set(DIAL_TRUNK_OPTIONS=tTxXM(confirm))") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:17] Macro("SIP/2299-0000015f", "dialout-trunk-predial-hook,") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/2299-0000015f", "") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/2299-0000015f", "0?bypass,1") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/2299-0000015f", "0?customtrunk") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] pbx.c:     -- Executing [s@macro-dialout-trunk:20] Dial("SIP/2299-0000015f", "IAX2/CB-MEL/2099,300,tTxX") in new stack
[2011-10-27 15:05:03] VERBOSE[12959] app_dial.c:     -- Called IAX2/CB-MEL/2099
[2011-10-27 15:05:03] VERBOSE[3976] chan_iax2.c:     -- Call accepted by <IP REMOVED> (format ulaw)
[2011-10-27 15:05:03] VERBOSE[3976] chan_iax2.c:     -- Format for call is ulaw
[2011-10-27 15:05:04] VERBOSE[12959] app_dial.c:     -- IAX2/CB-MEL-8153 is ringing
[2011-10-27 15:05:07] VERBOSE[12959] app_dial.c:     -- IAX2/CB-MEL-8153 answered SIP/2299-0000015f
[2011-10-27 15:05:11] VERBOSE[12959] pbx.c:     -- Executing [h@macro-dialout-trunk:1] Macro("SIP/2299-0000015f", "hangupcall,") in new stack
[2011-10-27 15:05:11] VERBOSE[12959] pbx.c:     -- Executing [s@macro-hangupcall:1] GotoIf("SIP/2299-0000015f", "1?theend") in new stack
[2011-10-27 15:05:11] VERBOSE[12959] pbx.c:     -- Goto (macro-hangupcall,s,3)
[2011-10-27 15:05:11] VERBOSE[12959] pbx.c:     -- Executing [s@macro-hangupcall:3] Hangup("SIP/2299-0000015f", "") in new stack
[2011-10-27 15:05:11] VERBOSE[12959] app_macro.c:   == Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'SIP/2299-0000015f' in macro 'hangupcall'
[2011-10-27 15:05:11] VERBOSE[12959] features.c:   == Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on 'SIP/2299-0000015f'
[2011-10-27 15:05:11] VERBOSE[12959] chan_iax2.c:     -- Hungup 'IAX2/CB-MEL-8153'
[2011-10-27 15:05:11] VERBOSE[12959] app_macro.c:   == Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on 'SIP/2299-0000015f' in macro 'dialout-trunk'
[2011-10-27 15:05:11] VERBOSE[12959] pbx.c:   == Spawn extension (from-internal, 2099, 7) exited non-zero on 'SIP/2299-0000015f'

Receiving End:

[2011-10-27 15:05:03] VERBOSE[3224] chan_iax2.c:     -- Accepting AUTHENTICATED call from <IP REMOVED>:
       > requested format = ulaw,
       > requested prefs = (ulaw),
       > actual format = ulaw,
       > host prefs = (ulaw|alaw|gsm),
       > priority = mine
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [2099@from-internal:1] ExecIf("IAX2/2098-10210", "0?Set(__RINGTIMER=0)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [2099@from-internal:2] Macro("IAX2/2098-10210", "exten-vm,novm,2099,0,0,0") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:1] Macro("IAX2/2098-10210", "user-callerid,") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:1] Set("IAX2/2098-10210", "AMPUSER=2098") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:2] GotoIf("IAX2/2098-10210", "0?report") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:3] ExecIf("IAX2/2098-10210", "0?Set(REALCALLERIDNUM=2098)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:4] Set("IAX2/2098-10210", "AMPUSER=2098") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:5] Set("IAX2/2098-10210", "AMPUSERCIDNAME=Test IAX") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:6] GotoIf("IAX2/2098-10210", "0?report") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:7] Set("IAX2/2098-10210", "AMPUSERCID=2098") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:8] Set("IAX2/2098-10210", "CALLERID(all)="Test IAX" <2098>") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:9] GotoIf("IAX2/2098-10210", "0?limit") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:10] ExecIf("IAX2/2098-10210", "0?Set(GROUP(concurrency_limit)=2098)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:11] GosubIf("IAX2/2098-10210", "7?sub-ccss,s,1(macro-exten-vm,)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@sub-ccss:1] ExecIf("IAX2/2098-10210", "0?Return()") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@sub-ccss:2] Set("IAX2/2098-10210", "CCSS_SETUP=TRUE") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@sub-ccss:3] GosubIf("IAX2/2098-10210", "0?monitor_config,1(macro-exten-vm,):monitor_default,1(macro-exten-vm,)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [monitor_default@sub-ccss:1] GotoIf("IAX2/2098-10210", "0?is_exten") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [monitor_default@sub-ccss:2] StackPop("IAX2/2098-10210", "") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [monitor_default@sub-ccss:3] Return("IAX2/2098-10210", "FALSE") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:12] ExecIf("IAX2/2098-10210", "0?Set(CHANNEL(language)=)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:13] GotoIf("IAX2/2098-10210", "0?continue") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:14] Set("IAX2/2098-10210", "__TTL=64") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:15] GotoIf("IAX2/2098-10210", "1?continue") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-user-callerid,s,26)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:26] Set("IAX2/2098-10210", "CALLERID(number)=2098") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:27] Set("IAX2/2098-10210", "CALLERID(name)=Test IAX") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-user-callerid:28] Set("IAX2/2098-10210", "CHANNEL(language)=en") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:2] Set("IAX2/2098-10210", "RingGroupMethod=none") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:3] Set("IAX2/2098-10210", "__EXTTOCALL=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:4] Set("IAX2/2098-10210", "__PICKUPMARK=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:5] Set("IAX2/2098-10210", "RT=") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:6] Macro("IAX2/2098-10210", "record-enable,2099,IN") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-record-enable:1] GotoIf("IAX2/2098-10210", "1?check") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-record-enable,s,4)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-record-enable:4] ExecIf("IAX2/2098-10210", "0?MacroExit()") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-record-enable:5] GotoIf("IAX2/2098-10210", "0?Group:OUT") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-record-enable,s,14)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-record-enable:14] GotoIf("IAX2/2098-10210", "1?IN") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-record-enable,s,18)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-record-enable:18] ExecIf("IAX2/2098-10210", "1?MacroExit()") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:7] GotoIf("IAX2/2098-10210", "1?macrodial") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-exten-vm,s,13)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:13] GosubIf("IAX2/2098-10210", "0?clrheader,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-exten-vm:14] Macro("IAX2/2098-10210", "dial-one,,tTxX,2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:1] Set("IAX2/2098-10210", "DEXTEN=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:2] Set("IAX2/2098-10210", "DIALSTATUS_CW=") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:3] GosubIf("IAX2/2098-10210", "0?screen,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:4] GosubIf("IAX2/2098-10210", "0?cf,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:5] GotoIf("IAX2/2098-10210", "1?skip1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-dial-one,s,8)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:8] GotoIf("IAX2/2098-10210", "0?nodial") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:9] GotoIf("IAX2/2098-10210", "0?continue") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:10] Set("IAX2/2098-10210", "EXTHASCW=ENABLED") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:11] GotoIf("IAX2/2098-10210", "0?next1:cwinusebusy") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-dial-one,s,23)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:23] GotoIf("IAX2/2098-10210", "1?next3:continue") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-dial-one,s,24)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:24] ExecIf("IAX2/2098-10210", "0?Set(DIALSTATUS_CW=BUSY)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:25] GotoIf("IAX2/2098-10210", "0?nodial") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:26] GosubIf("IAX2/2098-10210", "1?dstring,1:dlocal,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:1] Set("IAX2/2098-10210", "DSTRING=") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:2] Set("IAX2/2098-10210", "DEVICES=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:3] ExecIf("IAX2/2098-10210", "0?Return()") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:4] ExecIf("IAX2/2098-10210", "0?Set(DEVICES=099)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:5] Set("IAX2/2098-10210", "LOOPCNT=1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:6] Set("IAX2/2098-10210", "ITER=1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:7] Set("IAX2/2098-10210", "THISDIAL=SIP/2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:8] GosubIf("IAX2/2098-10210", "1?zap2dahdi,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:1] ExecIf("IAX2/2098-10210", "0?Return()") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:2] Set("IAX2/2098-10210", "NEWDIAL=") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:3] Set("IAX2/2098-10210", "LOOPCNT2=1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:4] Set("IAX2/2098-10210", "ITER2=1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:5] Set("IAX2/2098-10210", "THISPART2=SIP/2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:6] ExecIf("IAX2/2098-10210", "0?Set(THISPART2=DAHDI/2099)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:7] Set("IAX2/2098-10210", "NEWDIAL=SIP/2099&") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:8] Set("IAX2/2098-10210", "ITER2=2") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:9] GotoIf("IAX2/2098-10210", "0?begin2") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:10] Set("IAX2/2098-10210", "THISDIAL=SIP/2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [zap2dahdi@macro-dial-one:11] Return("IAX2/2098-10210", "") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:9] Set("IAX2/2098-10210", "DSTRING=SIP/2099&") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:10] Set("IAX2/2098-10210", "ITER=2") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:11] GotoIf("IAX2/2098-10210", "0?begin") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:12] Set("IAX2/2098-10210", "DSTRING=SIP/2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [dstring@macro-dial-one:13] Return("IAX2/2098-10210", "") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:27] GotoIf("IAX2/2098-10210", "0?nodial") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:28] GotoIf("IAX2/2098-10210", "1?skiptrace") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Goto (macro-dial-one,s,30)
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:30] Set("IAX2/2098-10210", "D_OPTIONS=tTxX") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:31] ExecIf("IAX2/2098-10210", "0?SIPAddHeader(Alert-Info: )") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:32] ExecIf("IAX2/2098-10210", "0?SIPAddHeader()") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:33] ExecIf("IAX2/2098-10210", "0?Set(CHANNEL(musicclass)=)") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:34] GosubIf("IAX2/2098-10210", "0?qwait,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:35] Set("IAX2/2098-10210", "__CWIGNORE=") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:36] Set("IAX2/2098-10210", "__KEEPCID=TRUE") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:37] GotoIf("IAX2/2098-10210", "0?usegoto,1") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:38] GotoIf("IAX2/2098-10210", "0?godial") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:39] Set("IAX2/2098-10210", "CONNECTEDLINE(name,i)=Test SIP") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:40] Set("IAX2/2098-10210", "CONNECTEDLINE(num)=2099") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:41] Set("IAX2/2098-10210", "D_OPTIONS=tTxXI") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] pbx.c:     -- Executing [s@macro-dial-one:42] Dial("IAX2/2098-10210", "SIP/2099,,tTxXI") in new stack
[2011-10-27 15:05:03] VERBOSE[22606] netsock.c:   == Using UDPTL TOS bits 184
[2011-10-27 15:05:03] VERBOSE[22606] netsock.c:   == Using UDPTL CoS mark 5
[2011-10-27 15:05:03] VERBOSE[22606] netsock2.c:   == Using SIP RTP TOS bits 184
[2011-10-27 15:05:03] VERBOSE[22606] netsock2.c:   == Using SIP RTP CoS mark 5
[2011-10-27 15:05:03] VERBOSE[22606] app_dial.c:     -- Called 2099
[2011-10-27 15:05:03] VERBOSE[22606] app_dial.c:     -- SIP/2099-0000061f is ringing
[2011-10-27 15:05:03] VERBOSE[22606] app_dial.c:     -- SIP/2099-0000061f is ringing
[2011-10-27 15:05:07] VERBOSE[22606] app_dial.c:     -- Connected line update to IAX2/2098-10210 prevented.
[2011-10-27 15:05:07] VERBOSE[22606] app_dial.c:     -- SIP/2099-0000061f answered IAX2/2098-10210
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:     -- Executing [h@macro-dial-one:1] Macro("IAX2/2098-10210", "hangupcall,") in new stack
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:     -- Executing [s@macro-hangupcall:1] GotoIf("IAX2/2098-10210", "1?theend") in new stack
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:     -- Goto (macro-hangupcall,s,3)
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:     -- Executing [s@macro-hangupcall:3] Hangup("IAX2/2098-10210", "") in new stack
[2011-10-27 15:05:11] VERBOSE[22606] app_macro.c:   == Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'IAX2/2098-10210' in macro 'hangupcall'
[2011-10-27 15:05:11] VERBOSE[22606] features.c:   == Spawn extension (macro-dial-one, h, 1) exited non-zero on 'IAX2/2098-10210'
[2011-10-27 15:05:11] VERBOSE[22606] app_macro.c:   == Spawn extension (macro-dial-one, s, 42) exited non-zero on 'IAX2/2098-10210' in macro 'dial-one'
[2011-10-27 15:05:11] VERBOSE[22606] app_macro.c:   == Spawn extension (macro-exten-vm, s, 14) exited non-zero on 'IAX2/2098-10210' in macro 'exten-vm'
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:   == Spawn extension (from-internal, 2099, 2) exited non-zero on 'IAX2/2098-10210'
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:     -- Executing [h@from-internal:1] Hangup("IAX2/2098-10210", "") in new stack
[2011-10-27 15:05:11] VERBOSE[22606] pbx.c:   == Spawn extension (from-internal, h, 1) exited non-zero on 'IAX2/2098-10210'
[2011-10-27 15:05:11] VERBOSE[22606] chan_iax2.c:     -- Hungup 'IAX2/2098-10210'

Just tested using IAX extensions on each end, same result

Out of interest I setup an IAX2 trunk between a production system FPBX 2.9 Distro and test box FPBX 2.10 Distro and CID’s received in both directions were the internal extension numbers. If the Outbound CID was populated on the extension it was necessary to tick the Intra-Company box on the outbound route to get the internal extension number transferred.

Setup was as follows:

Trunk Name: BBBBBBBB
Peer Details:
username=AAAAAAAA
type=friend
secret=iaxtestsetup
qualify=yes
host=172.16.90.249
disallow=all
context=from-internal
allow=ulaw&h261&h263&h263p
dtmfmode=rfc2833

Trunk Name: AAAAAAAA
Peer Details:
username=BBBBBBBB
type=friend
secret=iaxtestsetup
qualify=yes
host=172.16.90.10
disallow=all
context=from-internal
allow=ulaw&h261&h263&h263p
dtmfmode=rfc2833

I have found that it is important that the username on PBX A is exactly identical to the trunk name on PBX B and vice versa.

Since the example you gave above & the asterisk CLI pasted above both show ‘2098’ as being selected for CLID, I’m wondering if your SiteB trunk has a callerid= entry in it set to 2098?