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 [[email protected]from-sip-external:1] NoOp(“PJSIP/anonymous-00000000”, "Re ceived incoming SIP connection from unknown peer to 2001") in new stack
– Executing [[email protected]:2] Set(“PJSIP/anonymous-00000000”, “DID =2001”) in new stack
– Executing [[email protected]:3] Goto(“PJSIP/anonymous-00000000”, “s, 1”) in new stack

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