Hello Forum-
I am seeking guidance with a problem that I am running into in regards to SIP trunk configuration(s).
Currently, I have an Asterisk Box that is acting as a “routing PBX” inside my home.
asterisk*CLI> core show version
Asterisk 10.10.0 built by root @ jenkins6.schmoozecom.net on a x86_64 running Linux on 2012-11-19 22:01:37 UTC
FreePBX version is 2.11
The Asterisk Server is connected to a SIP provider, housing two external DID. Behind my Asterisk Server, I have a Cisco Call Manager that has a SIP trunk connected to my Asterisk Server. I have setup the configuration for the SIP trunk as follows through the GUI:
Trunk Name?: UCM
PEER Details?:
type=friend
host=192.168.22.100
context=from-internal
disallow=all
allow=ulaw&alaw
nat=no
canreinvite=yes
qualify=yes
User Context from-internal
I have some misc destination setup to map external number to some Extensions internally, and this is working quite well.
When I make a call from one of my internal extensions, the output sample is as follows:
– Executing [913306739811@from-internal:1] Macro(“SIP/UCM-0000000a”, “user-callerid,LIMIT,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/UCM-0000000a”, “TOUCH_MONITOR=1373386212.10”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/UCM-0000000a”, “AMPUSER=4001”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/UCM-0000000a”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/UCM-0000000a”, “1?Set(REALCALLERIDNUM=4001)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/UCM-0000000a”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:6] Set(“SIP/UCM-0000000a”, “AMPUSERCIDNAME=”) in new stack
– Executing [s@macro-user-callerid:7] GotoIf(“SIP/UCM-0000000a”, “1?report”) in new stack
– Goto (macro-user-callerid,s,15)
– Executing [s@macro-user-callerid:15] GotoIf(“SIP/UCM-0000000a”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,28)
– Executing [s@macro-user-callerid:28] Set(“SIP/UCM-0000000a”, “CALLERID(number)=4001”) in new stack
– Executing [s@macro-user-callerid:29] Set(“SIP/UCM-0000000a”, “CALLERID(name)=Matt Gear”) in new stack
– Executing [s@macro-user-callerid:30] Set(“SIP/UCM-0000000a”, “CDR(cnum)=4001”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/UCM-0000000a”, “CDR(cnam)=Matt Gear”) in new stack
– Executing [s@macro-user-callerid:32] Set(“SIP/UCM-0000000a”, “CHANNEL(language)=en”) in new stack
– Executing [913306739811@from-internal:2] Set(“SIP/UCM-0000000a”, “MOHCLASS=default”) in new stack
– Executing [913306739811@from-internal:3] Set(“SIP/UCM-0000000a”, “_NODEST=”) in new stack
– Executing [913306739811@from-internal:4] Gosub(“SIP/UCM-0000000a”, “sub-record-check,s,1(out,913306739811,)”) in new stack
– Executing [s@sub-record-check:1] Set(“SIP/UCM-0000000a”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:2] GotoIf(“SIP/UCM-0000000a”, “1?check”) in new stack
– Goto (sub-record-check,s,7)
– Executing [s@sub-record-check:7] Set(“SIP/UCM-0000000a”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:8] GotoIf(“SIP/UCM-0000000a”, “1?next”) in new stack
– Goto (sub-record-check,s,11)
– Executing [s@sub-record-check:11] ExecIf(“SIP/UCM-0000000a”, “0?Return()”) in new stack
– Executing [s@sub-record-check:12] ExecIf(“SIP/UCM-0000000a”, “0?Set(__REC_POLICY_MODE=)”) in new stack
– Executing [s@sub-record-check:13] GotoIf(“SIP/UCM-0000000a”, “0?out,1”) in new stack
– Executing [s@sub-record-check:14] Set(“SIP/UCM-0000000a”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:15] Set(“SIP/UCM-0000000a”, “NOW=1373386212”) in new stack
– Executing [s@sub-record-check:16] Set(“SIP/UCM-0000000a”, “__DAY=09”) in new stack
– Executing [s@sub-record-check:17] Set(“SIP/UCM-0000000a”, “__MONTH=07”) in new stack
– Executing [s@sub-record-check:18] Set(“SIP/UCM-0000000a”, “__YEAR=2013”) in new stack
– Executing [s@sub-record-check:19] Set(“SIP/UCM-0000000a”, “__TIMESTR=20130709-121012”) in new stack
– Executing [s@sub-record-check:20] Set(“SIP/UCM-0000000a”, “__FROMEXTEN=4001”) in new stack
– Executing [s@sub-record-check:21] Set(“SIP/UCM-0000000a”, “__CALLFILENAME=out-913306739811-4001-20130709-121012-1373386212.10”) in new stack
– Executing [s@sub-record-check:22] Goto(“SIP/UCM-0000000a”, “out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] ExecIf(“SIP/UCM-0000000a”, “1?Set(__REC_POLICY_MODE=)”) in new stack
– Executing [out@sub-record-check:2] GosubIf(“SIP/UCM-0000000a”, “0?record,1(exten,913306739811,4001)”) in new stack
– Executing [out@sub-record-check:3] Return(“SIP/UCM-0000000a”, “”) in new stack
– Executing [913306739811@from-internal:5] Macro(“SIP/UCM-0000000a”, “dialout-trunk,4,13306739811,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/UCM-0000000a”, “DIAL_TRUNK=4”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/UCM-0000000a”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/UCM-0000000a”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/UCM-0000000a”, “DIAL_NUMBER=13306739811”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/UCM-0000000a”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/UCM-0000000a”, “OUTBOUND_GROUP=OUT_4”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/UCM-0000000a”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/UCM-0000000a”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/UCM-0000000a”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/UCM-0000000a”, “outbound-callerid,4”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/UCM-0000000a”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/UCM-0000000a”, “0?Set(REALCALLERIDNUM=4001)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/UCM-0000000a”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/UCM-0000000a”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/UCM-0000000a”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/UCM-0000000a”, “TRUNKOUTCID=3305771220”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/UCM-0000000a”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,14)
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/UCM-0000000a”, “1?Set(CALLERID(all)=3305771220)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/UCM-0000000a”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“SIP/UCM-0000000a”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“SIP/UCM-0000000a”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:18] Set(“SIP/UCM-0000000a”, “CDR(outbound_cnum)=3305771220”) in new stack
– Executing [s@macro-outbound-callerid:19] Set(“SIP/UCM-0000000a”, “CDR(outbound_cnam)=”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/UCM-0000000a”, “0?sub-flp-4,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/UCM-0000000a”, “OUTNUM=13306739811”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/UCM-0000000a”, “custom=SIP/3305771220”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/UCM-0000000a”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/UCM-0000000a”, “0?Set(DIAL_TRUNK_OPTIONS=M(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/UCM-0000000a”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/UCM-0000000a”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/UCM-0000000a”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“SIP/UCM-0000000a”, “0?Set(CONNECTEDLINE(num,i)=13306739811)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“SIP/UCM-0000000a”, “0?Set(CONNECTEDLINE(name,i)=CID:3305771220)”) in new stack
– Executing [s@macro-dialout-trunk:21] GotoIf(“SIP/UCM-0000000a”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:22] Dial(“SIP/UCM-0000000a”, “SIP/3305771220/13306739811,300,”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/3305771220/13306739811
asterisk*CLI>
– SIP/3305771220-0000000b is ringing
– SIP/3305771220-0000000b is making progress passing it to SIP/UCM-0000000a
asterisk*CLI>
This is a complete call, and works correctly (as expected)
I am now trying to add another SIP trunk (for another Phone system) and what I did was “duplicted” the trunk, using the duplicate button from the UCM, to setup for the other trunk, as the setup is the same (minus the name, the dial pattern, and the ip address from above). Bear in mind this other phone system is a CallManager express.
After setting things up and validating the sip speer:
Express 192.168.22.99 5060 OK (18 ms)
UCM 192.168.22.100 5060 OK (1 ms)
I attempt to make a call.
This time, I get the following information:
– Executing [913306739811@from-sip-external:1] NoOp(“SIP/192.168.22.99-0000000d”, “Received incoming SIP connection from unknown peer to 913306739811”) in new stack
– Executing [913306739811@from-sip-external:2] Set(“SIP/192.168.22.99-0000000d”, “DID=913306739811”) in new stack
– Executing [913306739811@from-sip-external:3] Goto(“SIP/192.168.22.99-0000000d”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/192.168.22.99-0000000d”, “0?checklang:noanonymous”) in new stack
– Goto (from-sip-external,s,5)
– Executing [s@from-sip-external:5] Set(“SIP/192.168.22.99-0000000d”, “TIMEOUT(absolute)=15”) in new stack
Channel will hangup at 2013-07-09 12:16:19.124 EDT.
– Executing [s@from-sip-external:6] Answer(“SIP/192.168.22.99-0000000d”, “”) in new stack
– Executing [s@from-sip-external:7] Wait(“SIP/192.168.22.99-0000000d”, “2”) in new stack
– Executing [s@from-sip-external:8] Playback(“SIP/192.168.22.99-0000000d”, “ss-noservice”) in new stack
– <SIP/192.168.22.99-0000000d> Playing ‘ss-noservice.ulaw’ (language ‘en’)
– Executing [s@from-sip-external:9] PlayTones(“SIP/192.168.22.99-0000000d”, “congestion”) in new stack
– Executing [s@from-sip-external:10] Congestion(“SIP/192.168.22.99-0000000d”, “5”) in new stack
asterisk*CLI>
The thing I am confused by, is that after setting the trunk up with the same context as the original trunk, which is working fine, I notice this:
Executing [913306739811@from-sip-external:1]
Why is the system executing this trunk as from-sip-external, even though I stated otherwise in the setup of the trunk from a context level?
To further muddy the water (I’ll admit I’m not an Asterisk GURU)
In sip additional, I see the following:
[Express]
disallow=all
type=friend
host=192.168.22.99
context=from-internal
allow=ulaw
allow=alaw
nat=no
canreinvite=yes
qualify=yes
[from-internal]
context=from-trunk-sip-UCM
[UCM]
disallow=all
type=friend
host=192.168.22.100
context=from-internal
allow=ulaw
allow=alaw
nat=no
canreinvite=yes
qualify=yes
I have tried to add an additional statement in the [from-internal] with the name of my other sip trunk, but that makes no difference. Codecs are good, everything else looks good…and upon the re-order tone, I know I am at least getting the announcements from the Asterisk server.
I am really stumped at this point, and would appreciate anyone’s insight as to what I can do to get this second trunk to be processed from the “from-internal” context
Many Thanks,