Connecting Servers as trunk to extension

Thanks in advance for any help…

I have a home server that has been set up and working for a couple of years now with no problems!

I now want to add my home office to the server, but route my office numbers through the home server and via an IAX2 extension to the office server. The office server has a IAX2 trunk set up and registered.

If I leave the inbound route as any/any all is fine. However, I would like to be able to match different DIDs to different extensions.

The logs show the match issue.

How do I find out what my home server is sending as the DID to be able to match and route accordingly???

requested format = ulaw,
requested prefs = (ulaw|alaw|gsm),
actual format = ulaw,
host prefs = (ulaw|alaw|gsm),
priority = mine
[2011-12-31 09:19:34] VERBOSE[28302] pbx.c: – Executing [s@from-trunk:1] NoOp(“IAX2/ativerUSER-5858”, “No DID or CID Match”) in new stack
[2011-12-31 09:19:34] VERBOSE[28302] pbx.c: – Executing [s@from-trunk:2] Answer(“IAX2/ativerUSER-5858”, “”) in new stack
[2011-12-31 09:19:34] VERBOSE[28302] pbx.c: – Executing [s@from-trunk:3] Wait(“IAX2/ativerUSER-5858”, “2”) in new stack
[2011-12-31 09:19:36] VERBOSE[28302] pbx.c: – Executing [s@from-trunk:4] Playback(“IAX2/ativerUSER-5858”, “ss-noservice”) in new stack
[2011-12-31 09:19:36] VERBOSE[28302] file.c: – <IAX2/ativerUSER-5858> Playing ‘ss-noservice.gsm’ (language ‘en’)
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: == Spawn extension (from-trunk, s, 4) exited non-zero on ‘IAX2/ativerUSER-5858’
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Executing [h@from-trunk:1] Macro(“IAX2/ativerUSER-5858”, “hangupcall,”) in new stack
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Executing [s@macro-hangupcall:1] GotoIf(“IAX2/ativerUSER-5858”, “1?skiprg”) in new stack
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Goto (macro-hangupcall,s,4)
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Executing [s@macro-hangupcall:4] GotoIf(“IAX2/ativerUSER-5858”, “1?skipblkvm”) in new stack
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Goto (macro-hangupcall,s,7)
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Executing [s@macro-hangupcall:7] GotoIf(“IAX2/ativerUSER-5858”, “1?theend”) in new stack
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Goto (macro-hangupcall,s,9)
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: – Executing [s@macro-hangupcall:9] Hangup(“IAX2/ativerUSER-5858”, “”) in new stack
[2011-12-31 09:19:38] VERBOSE[28302] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘IAX2/ativerUSER-5858’ in macro ‘hangupcall’
[2011-12-31 09:19:38] VERBOSE[28302] pbx.c: == Spawn extension (from-trunk, h, 1) exited non-zero on ‘IAX2/ativerUSER-5858’
[2011-12-31 09:19:38] VERBOSE[28302] chan_iax2.c: – Hungup ‘IAX2/ativerUSER-5858’

you can use the Caller ID field in the inbound route for this purpose.

Thanks,

I have the inbound route setup as follows:

any DID/0203411xxxx

this then goes to my extension

I call the home server which forwards the call correctly to the second server which then has the ‘no match’ error in the logs.

For info the trunk is setup as follows:

PEER Details
allow=all
host=sip.xxxxx.co.uk
username=xxxx
secret=xxxxx
type=friend
context=from-trunk

USER Details
secret=xxxxx
type=user
context=from-trunk
requirecalltoken=no

Register string
xxxx:[email protected]

Is there a simple way to capture what exactly is being sent to the second server? It may simply be that I am not matching against the right number.

Thanks again

rlm