FreePBX Integration Skype For Business

I configured sip trunk between Asterisk and Skype for Business (sfb).
Asterisk users 2XXX
SFB users 3XXX

Trunk properties

type=friend
qualify=yes
nat=no
insecure=invite,port
host=192.168.1.12
port=5060
transport=tcp
context=from-internal
disallow=all
allow=alaw&ulaw
promiscredir=yes
conreivite=yes

Сalls are in both directions successfully, but when the skype user call (3001) calls astrisk user (2001) call is defined as an anonymous.
On screen Asterisk User receive call from skype user 3001 “Bunney Honey”
Annotation%202020-05-29%20144955

  1. Why context is from-sip-external?
  2. Why system display “Re ceived incoming SIP connection from unknown peer to 2001” ?
  3. Why not see CallerId (From: “Unknown” sip:Unknown@192.168.1.10:5160;tag=as43c4f38b)

sip debug on Asterisk:

REGISTER
== Setting global variable ‘SIPDOMAIN’ to
– Executing [2001@from-sip-external:1] NoOp(“PJSIP/anonymous-00000000”, "Re ceived incoming SIP connection from unknown peer to 2001") in new stack
– Executing [2001@from-sip-external:2] Set(“PJSIP/anonymous-00000000”, “DID =2001”) in new stack
– Executing [2001@from-sip-external:3] Goto(“PJSIP/anonymous-00000000”, “s, 1”) in new stack

-- Jumping to priority 13
-- Executing [s@func-apply-sipheaders:14] Return("PJSIP/2001-00000001", "")                                                                                         in new stack

== Spawn extension (from-internal, 2001, 1) exited non-zero on ‘PJSIP/2001-000 00001’
– PJSIP/2001-00000001 Internal Gosub(func-apply-sipheaders,s,1) complete GO SUB_RETVAL=
– Called PJSIP/2001/sip:[email protected]:57087;ob
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
– PJSIP/2001-00000001 is ringing
– PJSIP/2001-00000001 is ringing
Reliably Transmitting (no NAT) to 192.168.1.12:5060:
OPTIONS sip:192.168.1.12 SIP/2.0
Via: SIP/2.0/TCP 192.168.1.10:5160;branch=z9hG4bK7e0dcb82
Max-Forwards: 70
From: "Unknown" sip:Unknown@192.168.1.10:5160;tag=as43c4f38b
To: sip:192.168.1.12
Contact: sip:Unknown@192.168.1.10:5160;transport=tcp
Call-ID: [email protected]:5160
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.49(16.6.2)
Date: Fri, 29 May 2020 11:39:01 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H, MESSAGE
Supported: replaces, timer
Content-Length: 0

You created a chan_sip trunk, but the call is arriving to the PBX on a port bound to PJSIP. Determine the chan_sip port and configure inbound calls to use that port.

Thank you very much for the reply.
I change trunk setting on Skype For Business to 5160 tcp

1. Trunk installed
Skype 192.168.1.12 No No 5060 OK (1 ms)

2. I see that used SIP and context (from-internal) but calls don’t work anymore
sip set debug on when Skype user (3001) calls Asterisk user (2001)

== Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
       > 0x7f1ce8010e30 -- Strict RTP learning after remote address set to: 192.168.1.12:57234
    -- Executing [2001@from-internal:1] GotoIf("SIP/Skype-00000006", "1?ext-local,2001,1:followme-check,2001,1") in new stack
    -- Goto (ext-local,2001,1)
    -- Executing [2001@ext-local:1] Set("SIP/Skype-00000006", "__RINGTIMER=15") in new stack
    -- Executing [2001@ext-local:2] ExecIf("SIP/Skype-00000006", "0?Set(__CWIGNORE=)") in new stack
    -- Executing [2001@ext-local:3] Macro("SIP/Skype-00000006", "exten-vm,novm,2001,0,0,0") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/Skype-00000006", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/Skype-00000006", "TOUCH_MONITOR=1590779779.8") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/Skype-00000006", "AMPUSER=3001") in new stack
    -- Executing [s@macro-user-callerid:3] Set("SIP/Skype-00000006", "HOTDESCKCHAN=Skype-00000006") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/Skype-00000006", "HOTDESKEXTEN=Skype") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/Skype-00000006", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:6] ExecIf("SIP/Skype-00000006", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:7] ExecIf("SIP/Skype-00000006", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/Skype-00000006", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] ExecIf("SIP/Skype-00000006", "1?Set(REALCALLERIDNUM=3001)") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/Skype-00000006", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/Skype-00000006", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:12] Set("SIP/Skype-00000006", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("SIP/Skype-00000006", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:14] GotoIf("SIP/Skype-00000006", "1?report") in new stack
    -- Goto (macro-user-callerid,s,22)
    -- Executing [s@macro-user-callerid:22] NoOp("SIP/Skype-00000006", "Macro Depth is 2") in new stack
    -- Executing [s@macro-user-callerid:23] GotoIf("SIP/Skype-00000006", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,24)
    -- Executing [s@macro-user-callerid:24] GotoIf("SIP/Skype-00000006", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:25] ExecIf("SIP/Skype-00000006", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
    -- Executing [s@macro-user-callerid:26] Set("SIP/Skype-00000006", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:27] GotoIf("SIP/Skype-00000006", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,43)
    -- Executing [s@macro-user-callerid:43] Set("SIP/Skype-00000006", "CALLERID(number)=3001") in new stack
    -- Executing [s@macro-user-callerid:44] Set("SIP/Skype-00000006", "CALLERID(name)=Bunny Honey") in new stack
    -- Executing [s@macro-user-callerid:45] GotoIf("SIP/Skype-00000006", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:46] Set("SIP/Skype-00000006", "CDR(cnam)=Bunny Honey") in new stack
    -- Executing [s@macro-user-callerid:47] Set("SIP/Skype-00000006", "CDR(cnum)=3001") in new stack
    -- Executing [s@macro-user-callerid:48] Set("SIP/Skype-00000006", "CHANNEL(language)=ru") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/Skype-00000006", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/Skype-00000006", "__EXTTOCALL=2001") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/Skype-00000006", "__PICKUPMARK=2001") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/Skype-00000006", "RT=") in new stack
    -- Executing [s@macro-exten-vm:6] ExecIf("SIP/Skype-00000006", "0?Macro(vm,novm,DIRECTDIAL,)") in new stack
    -- Executing [s@macro-exten-vm:7] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:8] ExecIf("SIP/Skype-00000006", "0?Gosub(ext-intercom,*802001,1())") in new stack
    -- Executing [s@macro-exten-vm:9] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:10] ExecIf("SIP/Skype-00000006", "0?ChanSpy(PJSIP/2001,q)") in new stack
    -- Executing [s@macro-exten-vm:11] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:12] ExecIf("SIP/Skype-00000006", "0?Macro(vm,novm,DIRECTDIAL,)") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:13] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:14] ExecIf("SIP/Skype-00000006", "0?Gosub(ext-intercom,*802001,1())") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:15] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:16] ExecIf("SIP/Skype-00000006", "0?ChanSpy(PJSIP/2001,q)") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:17] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
[2020-05-29 22:16:19] ERROR[17302][C-00000009]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
    -- Executing [s@macro-exten-vm:18] Gosub("SIP/Skype-00000006", "sub-record-check,s,1(exten,2001,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/Skype-00000006", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/Skype-00000006", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/Skype-00000006", "NOW=1590779779") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/Skype-00000006", "__DAY=29") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/Skype-00000006", "__MONTH=05") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/Skype-00000006", "__YEAR=2020") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/Skype-00000006", "__TIMESTR=20200529-221619") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/Skype-00000006", "__FROMEXTEN=3001") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/Skype-00000006", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/Skype-00000006", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/Skype-00000006", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/Skype-00000006", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/Skype-00000006", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/Skype-00000006", "5?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/Skype-00000006", "1?sub-record-check,exten,1") in new stack
    -- Goto (sub-record-check,exten,1)
    -- Executing [exten@sub-record-check:1] NoOp("SIP/Skype-00000006", "Exten Recording Check between 3001 and 2001") in new stack
    -- Executing [exten@sub-record-check:2] Set("SIP/Skype-00000006", "CALLTYPE=internal") in new stack
    -- Executing [exten@sub-record-check:3] ExecIf("SIP/Skype-00000006", "0?Set(CALLTYPE=)") in new stack
    -- Executing [exten@sub-record-check:4] Set("SIP/Skype-00000006", "CALLEE=dontcare") in new stack
    -- Executing [exten@sub-record-check:5] ExecIf("SIP/Skype-00000006", "0?Set(CALLEE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:6] GotoIf("SIP/Skype-00000006", "0?callee") in new stack
    -- Executing [exten@sub-record-check:7] GotoIf("SIP/Skype-00000006", "1?caller") in new stack
    -- Goto (sub-record-check,exten,13)
    -- Executing [exten@sub-record-check:13] Set("SIP/Skype-00000006", "RECMODE=") in new stack
    -- Executing [exten@sub-record-check:14] ExecIf("SIP/Skype-00000006", "1?Set(RECMODE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:15] ExecIf("SIP/Skype-00000006", "1?Set(RECMODE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:16] Gosub("SIP/Skype-00000006", "recordcheck,1(dontcare,internal,2001)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/Skype-00000006", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/Skype-00000006", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("SIP/Skype-00000006", "") in new stack
    -- Executing [exten@sub-record-check:17] Return("SIP/Skype-00000006", "") in new stack
    -- Executing [s@macro-exten-vm:19] GotoIf("SIP/Skype-00000006", "1?macrodial") in new stack
    -- Goto (macro-exten-vm,s,25)
    -- Executing [s@macro-exten-vm:25] GosubIf("SIP/Skype-00000006", "0?clrheader,1()") in new stack
    -- Executing [s@macro-exten-vm:26] Macro("SIP/Skype-00000006", "dial-one,,HhTtr,2001") in new stack
    -- Executing [s@macro-dial-one:1] Set("SIP/Skype-00000006", "DEXTEN=2001") in new stack
    -- Executing [s@macro-dial-one:2] Set("SIP/Skype-00000006", "__CRM_SOURCE=3001") in new stack
    -- Executing [s@macro-dial-one:3] ExecIf("SIP/Skype-00000006", "0?Set(__EXTTOCALL=2001)") in new stack
    -- Executing [s@macro-dial-one:4] Set("SIP/Skype-00000006", "DIALSTATUS_CW=") in new stack
    -- Executing [s@macro-dial-one:5] GosubIf("SIP/Skype-00000006", "0?screen,1()") in new stack
    -- Executing [s@macro-dial-one:6] GosubIf("SIP/Skype-00000006", "0?cf,1()") in new stack
    -- Executing [s@macro-dial-one:7] GotoIf("SIP/Skype-00000006", "1?skip1") in new stack
    -- Goto (macro-dial-one,s,10)
    -- Executing [s@macro-dial-one:10] GotoIf("SIP/Skype-00000006", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:11] GotoIf("SIP/Skype-00000006", "0?continue") in new stack
    -- Executing [s@macro-dial-one:12] Set("SIP/Skype-00000006", "EXTHASCW=ENABLED") in new stack
    -- Executing [s@macro-dial-one:13] GotoIf("SIP/Skype-00000006", "0?next1:cwinusebusy") in new stack
    -- Goto (macro-dial-one,s,25)
    -- Executing [s@macro-dial-one:25] GotoIf("SIP/Skype-00000006", "0?next3:continue") in new stack
    -- Goto (macro-dial-one,s,27)
    -- Executing [s@macro-dial-one:27] GotoIf("SIP/Skype-00000006", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:28] GosubIf("SIP/Skype-00000006", "1?dstring,1():dlocal,1()") in new stack
    -- Executing [dstring@macro-dial-one:1] Set("SIP/Skype-00000006", "DSTRING=") in new stack
    -- Executing [dstring@macro-dial-one:2] Set("SIP/Skype-00000006", "DEVICES=2001") in new stack
    -- Executing [dstring@macro-dial-one:3] ExecIf("SIP/Skype-00000006", "0?Return()") in new stack
    -- Executing [dstring@macro-dial-one:4] ExecIf("SIP/Skype-00000006", "0?Set(DEVICES=001)") in new stack
    -- Executing [dstring@macro-dial-one:5] Set("SIP/Skype-00000006", "LOOPCNT=1") in new stack
    -- Executing [dstring@macro-dial-one:6] Set("SIP/Skype-00000006", "ITER=1") in new stack
    -- Executing [dstring@macro-dial-one:7] Set("SIP/Skype-00000006", "THISDIAL=PJSIP/2001") in new stack
    -- Executing [dstring@macro-dial-one:8] GotoIf("SIP/Skype-00000006", "0?docheck") in new stack
    -- Executing [dstring@macro-dial-one:9] NoOp("SIP/Skype-00000006", "Debug: Found PJSIP Destination PJSIP/2001") in new stack
    -- Executing [dstring@macro-dial-one:10] GotoIf("SIP/Skype-00000006", "0?doset") in new stack
    -- Executing [dstring@macro-dial-one:11] NoOp("SIP/Skype-00000006", "Debug: Updating PJSIP Destination with PJSIP_DIAL_CONTACTS") in new stack
    -- Executing [dstring@macro-dial-one:12] Set("SIP/Skype-00000006", "THISDIAL=") in new stack
    -- Executing [dstring@macro-dial-one:13] ExecIf("SIP/Skype-00000006", "1?Set(DIALSTATUS=CHANUNAVAIL)") in new stack
    -- Executing [dstring@macro-dial-one:14] GotoIf("SIP/Skype-00000006", "1?skipset") in new stack
    -- Goto (macro-dial-one,dstring,16)
    -- Executing [dstring@macro-dial-one:16] Set("SIP/Skype-00000006", "ITER=2") in new stack
    -- Executing [dstring@macro-dial-one:17] GotoIf("SIP/Skype-00000006", "0?begin") in new stack
    -- Executing [dstring@macro-dial-one:18] ExecIf("SIP/Skype-00000006", "1?Return()") in new stack
    -- Executing [s@macro-dial-one:29] GotoIf("SIP/Skype-00000006", "1?nodial") in new stack
    -- Goto (macro-dial-one,s,61)
    -- Executing [s@macro-dial-one:61] NoOp("SIP/Skype-00000006", "") in new stack
    -- Executing [s@macro-dial-one:62] ExecIf("SIP/Skype-00000006", "0?Set(DIALSTATUS=NOANSWER)") in new stack
    -- Executing [s@macro-dial-one:63] NoOp("SIP/Skype-00000006", "Returned from dial-one with nothing to call and DIALSTATUS: CHANUNAVAIL") in new stack
    -- Executing [s@macro-dial-one:64] MacroExit("SIP/Skype-00000006", "") in new stack
    -- Executing [s@macro-exten-vm:27] Set("SIP/Skype-00000006", "SV_DIALSTATUS=CHANUNAVAIL") in new stack
    -- Executing [s@macro-exten-vm:28] GosubIf("SIP/Skype-00000006", "0?docfu,1()") in new stack
    -- Executing [s@macro-exten-vm:29] GosubIf("SIP/Skype-00000006", "0?docfb,1()") in new stack
    -- Executing [s@macro-exten-vm:30] Set("SIP/Skype-00000006", "DIALSTATUS=CHANUNAVAIL") in new stack
    -- Executing [s@macro-exten-vm:31] ExecIf("SIP/Skype-00000006", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:32] GotoIf("SIP/Skype-00000006", "1?s-CHANUNAVAIL,1") in new stack
    -- Goto (macro-exten-vm,s-CHANUNAVAIL,1)
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:1] GotoIf("SIP/Skype-00000006", "0?exit,1") in new stack
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:2] PlayTones("SIP/Skype-00000006", "congestion") in new stack
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:3] Congestion("SIP/Skype-00000006", "10") in new stack
  == Spawn extension (macro-exten-vm, s-CHANUNAVAIL, 3) exited non-zero on 'SIP/Skype-00000006' in macro 'exten-vm'
  == Spawn extension (ext-local, 2001, 3) exited non-zero on 'SIP/Skype-00000006'
    -- Executing [h@ext-local:1] Macro("SIP/Skype-00000006", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/Skype-00000006", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("SIP/Skype-00000006", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] NoOp("SIP/Skype-00000006", " montior file= ") in new stack
    -- Executing [s@macro-hangupcall:5] GotoIf("SIP/Skype-00000006", "1?skipagi") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] Hangup("SIP/Skype-00000006", "") in new stack
  == Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'SIP/Skype-00000006' in macro 'hangupcall'
  == Spawn extension (ext-local, h, 1) exited non-zero on 'SIP/Skype-00000006'

May I quickly tested. After 10 minutes calls worked.
Thanks for the help

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.