[asterisk-bugs] [JIRA] (ASTERISK-26072) chan_sip: Asterisk 13 don't send INVITE with Replaces after accepted REFER

Jose Molina (JIRA) noreply at issues.asterisk.org
Mon Jun 20 06:52:57 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-26072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230842#comment-230842 ] 

Jose Molina edited comment on ASTERISK-26072 at 6/20/16 6:52 AM:
-----------------------------------------------------------------

This is the console output for Asterisk 13.9.1:
{noformat}
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [25988 at incoming:1] Macro("SIP/ISP_SIPtrunk-00000000", "llamadaEntranteUC,25988,37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:1] NoOp("SIP/ISP_SIPtrunk-00000000", "CallingPress --1-- caller id --"37233" <37233>--") in new stack
-- Executing [s at macro-llamadaEntranteUC:2] Set("SIP/ISP_SIPtrunk-00000000", "TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:3] Set("SIP/ISP_SIPtrunk-00000000", "TRANSFERCONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:4] Set("SIP/ISP_SIPtrunk-00000000", "_TRANSFERCONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:5] Set("SIP/ISP_SIPtrunk-00000000", "NUMCALLED=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:6] Set("SIP/ISP_SIPtrunk-00000000", "NUMCALLER=37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:7] GotoIf("SIP/ISP_SIPtrunk-00000000", "0?desconegut:conegut") in new stack
-- Goto (macro-llamadaEntranteUC,s,10)
-- Executing [s at macro-llamadaEntranteUC:10] GotoIf("SIP/ISP_SIPtrunk-00000000", "0?addZeroPrefix") in new stack
-- Executing [s at macro-llamadaEntranteUC:11] Goto("SIP/ISP_SIPtrunk-00000000", "s,nextZeroPrefix") in new stack
-- Goto (macro-llamadaEntranteUC,s,13)
-- Executing [s at macro-llamadaEntranteUC:13] Set("SIP/ISP_SIPtrunk-00000000", "_UCUSER=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:14] Set("SIP/ISP_SIPtrunk-00000000", "CDR(PRIVACY-ID)="Privacy: off"") in new stack
-- Executing [s at macro-llamadaEntranteUC:15] Set("SIP/ISP_SIPtrunk-00000000", "CALLERID(all)=37233 <37233>") in new stack
-- Executing [s at macro-llamadaEntranteUC:16] SIPAddHeader("SIP/ISP_SIPtrunk-00000000", "P-Asserted-Identity: 37233 sip:37233 at mydomain.com") in new stack
-- Executing [s at macro-llamadaEntranteUC:17] GotoIf("SIP/ISP_SIPtrunk-00000000", "0?privacy:privacyoff") in new stack
-- Goto (macro-llamadaEntranteUC,s,22)
-- Executing [s at macro-llamadaEntranteUC:22] SIPAddHeader("SIP/ISP_SIPtrunk-00000000", "Remote-Party-ID: 37233 sip:37233 at mydomain.com") in new stack
-- Executing [s at macro-llamadaEntranteUC:23] Dial("SIP/ISP_SIPtrunk-00000000", "SIP/PROXY-out/25988,,t") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/PROXY-out/25988
-- SIP/PROXY-out-00000001 is ringing
-- SIP/PROXY-out-00000001 answered SIP/ISP_SIPtrunk-00000000
-- Channel SIP/PROXY-out-00000001 joined 'simple_bridge' basic-bridge
-- Channel SIP/ISP_SIPtrunk-00000000 joined 'simple_bridge' basic-bridge

    0x7f747800b0b0 -- Probation passed - setting RTP source address to 10.0.0.9:10748
    0x7f746800adc0 -- Probation passed - setting RTP source address to 10.0.0.174:30122
    -- Started music on hold, class 'default', on channel 'SIP/ISP_SIPtrunk-00000000'
    [May 25 11:27:50] NOTICE[19960][C-00000000]: chan_sip.c:23978 handle_response_notify: Got OK on REFER Notify message
{noformat}

And this is the console output for Asterisk 11 where the transfer works fine. As you can see in this case the call enters in the station_transferUC context to do the attendant transfer after receives the REFER message.
{noformat}
-- Executing [25988 at incoming:1] Macro("SIP/ISP_SIPtrunk-0000000a", "llamadaEntranteUC,25988,37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:1] NoOp("SIP/ISP_SIPtrunk-0000000a", "CallingPress --1-- caller id --"37233" <37233>--") in new stack
-- Executing [s at macro-llamadaEntranteUC:2] Set("SIP/ISP_SIPtrunk-0000000a", "TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:3] Set("SIP/ISP_SIPtrunk-0000000a", "_TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:4] Set("SIP/ISP_SIPtrunk-0000000a", "__TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:5] Set("SIP/ISP_SIPtrunk-0000000a", "NUMCALLED=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:6] Set("SIP/ISP_SIPtrunk-0000000a", "NUMCALLER=37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:7] GotoIf("SIP/ISP_SIPtrunk-0000000a", "0?desconegut:conegut") in new stack
-- Goto (macro-llamadaEntranteUC,s,10)
-- Executing [s at macro-llamadaEntranteUC:10] GotoIf("SIP/ISP_SIPtrunk-0000000a", "0?addZeroPrefix") in new stack
-- Executing [s at macro-llamadaEntranteUC:11] Goto("SIP/ISP_SIPtrunk-0000000a", "s,nextZeroPrefix") in new stack
-- Goto (macro-llamadaEntranteUC,s,13)
-- Executing [s at macro-llamadaEntranteUC:13] Set("SIP/ISP_SIPtrunk-0000000a", "_UCUSER=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:14] Set("SIP/ISP_SIPtrunk-0000000a", "CDR(PRIVACY-ID)="Privacy: off"") in new stack
-- Executing [s at macro-llamadaEntranteUC:15] Set("SIP/ISP_SIPtrunk-0000000a", "CALLERID(all)=37233 <37233>") in new stack
-- Executing [s at macro-llamadaEntranteUC:16] SIPAddHeader("SIP/ISP_SIPtrunk-0000000a", "P-Asserted-Identity: 37233 <sip:37233 at mydomain.com>") in new stack
-- Executing [s at macro-llamadaEntranteUC:17] GotoIf("SIP/ISP_SIPtrunk-0000000a", "0?privacy:privacyoff") in new stack
-- Goto (macro-llamadaEntranteUC,s,22)
-- Executing [s at macro-llamadaEntranteUC:22] SIPAddHeader("SIP/ISP_SIPtrunk-0000000a", "Remote-Party-ID: 37233 <sip:37233 at mydomain.com>") in new stack
-- Executing [s at macro-llamadaEntranteUC:23] Dial("SIP/ISP_SIPtrunk-0000000a", "SIP/PROXY-out/25988,,t") in new stack

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/PROXY-out/25988
-- SIP/PROXY-out-0000000b is ringing
-- SIP/PROXY-out-0000000b answered SIP/ISP_SIPtrunk-0000000a

    0x7f2b3c006da0 -- Probation passed - setting RTP source address to 10.0.0.9:10742
    0x2c6cbf0 -- Probation passed - setting RTP source address to 10.0.0.174:35120
    -- Started music on hold, class 'default', on SIP/ISP_SIPtrunk-0000000a
    -- Stopped music on hold on SIP/ISP_SIPtrunk-0000000a
    == Spawn extension (station_transferUC, u6-676, 1) exited non-zero on 'SIP/ISP_SIPtrunk-0000000a' in macro 'llamadaEntranteUC'
    == Spawn extension (station_transferUC, u6-676, 1) exited non-zero on 'SIP/ISP_SIPtrunk-0000000a'
    -- Executing [u6-676 at station_transferUC:1] Macro("SIP/ISP_SIPtrunk-0000000a", "transferUCAAi,u6-676,37233,") in new stack
    -- Executing [s at macro-transferUCAAi:1] NoOp("SIP/ISP_SIPtrunk-0000000a", "Transfer call 37233 to u6-676. Prefix . GWFailover . --UCUser: 25988--") in new stack
    -- Executing [s at macro-transferUCAAi:2] Set("SIP/ISP_SIPtrunk-0000000a", "NUMDESTI=u6-676") in new stack
    -- Executing [s at macro-transferUCAAi:3] Set("SIP/ISP_SIPtrunk-0000000a", "NUMORIGEN=37233") in new stack
    -- Executing [s at macro-transferUCAAi:4] Set("SIP/ISP_SIPtrunk-0000000a", "CALLEDPREFIX=") in new stack
    -- Executing [s at macro-transferUCAAi:5] Set("SIP/ISP_SIPtrunk-0000000a", "GWFAILOVER=") in new stack
    -- Executing [s at macro-transferUCAAi:6] Dial("SIP/ISP_SIPtrunk-0000000a", "SIP/NB-out/u6-676,,t") in new stack
    == Using SIP RTP TOS bits 184
    == Using SIP RTP CoS mark 5
    -- Called SIP/NB-out/u6-676
    -- SIP/NB-out-0000000c answered SIP/ISP_SIPtrunk-0000000a
    0x2c79f50 -- Probation passed - setting RTP source address to 10.0.0.174:40104
{noformat}

Here you can see the dialplan. To summarize, I pasted the contexts involved in the transfer and I masqueraded the IP address for security
{noformat}
[general]
static=yes
writeprotect=yes
language=es

[globals]

DOMINI=mydomain.com

TRANSFER_CONTEXT=station_transferUC
_TRANSFER_CONTEXT=station_transferUC
__TRANSFER_CONTEXT=station_transferUC

[incoming]

exten => s,1,NoOp(OPTION ping)

exten => _[1235679]XXXX,1,Macro(llamadaEntranteUC,${EXTEN:-5},${CALLERID(num)})
exten => _4[45]XXX,1,Macro(llamadaEntranteUC,${EXTEN:-5},${CALLERID(num)})
exten => _0[67]XXXXXXXX,1,Macro(llamadaEntranteUC,${EXTEN},${CALLERID(num)})
exten => _0XX.,1,Macro(llamadaEntranteUC,${EXTEN},${CALLERID(num)})
;---[FI] e-Connect


[macro-llamadaEntranteUC]

exten => s,1,NoOp(CallingPress --${CALLINGPRES}-- caller id --${CALLERID(all)}--)
exten => s,n,Set(TRANSFER_CONTEXT=station_transferUC)
exten => s,n,Set(_TRANSFER_CONTEXT=station_transferUC)
exten => s,n,Set(__TRANSFER_CONTEXT=station_transferUC)
exten => s,n,Set(NUMCALLED=${ARG1})
exten => s,n,Set(NUMCALLER=${ARG2})

exten => s,n,GotoIf($["${NUMCALLER}" = ""]?desconegut:conegut)
exten => s,n(desconegut),Set(NUMCALLER=desconegut)
exten => s,n,Goto(s,nextZeroPrefix)
exten => s,n(conegut),GotoIf($[ $["${NUMCALLER:0:1}" != "0"] & $[${LEN(${NUMCALLER})} != 5] ]?addZeroPrefix)
exten => s,n,Goto(s,nextZeroPrefix)
exten => s,n(addZeroPrefix),Set(NUMCALLER=0${NUMCALLER})

exten => s,n(nextZeroPrefix),Set(_UCUSER=${NUMCALLED})
exten => s,n,Set(CDR(PRIVACY-ID)="Privacy: off")
exten => s,n,Set(CALLERID(all)=${CALLERID(name)} <${NUMCALLER}>)
exten => s,n,SIPAddHeader(P-Asserted-Identity: ${CALLERID(name)} <sip:${NUMCALLER}@${DOMINI}>)
exten => s,n,GotoIf($[${MATH(${CALLINGPRES}>30)}=TRUE]?privacy:privacyoff)
exten => s,n(privacy),SIPAddHeader(Remote-Party-ID: ${CALLERID(name)} <sip:${NUMCALLER}@${DOMINI}>\;privacy=full)
exten => s,n,SIPAddHeader(Privacy: Id)
exten => s,n,Set(CDR(PRIVACY-ID)="Privacy: full")
exten => s,n,GoTo(s,end-privacy)
exten => s,n(privacyoff),SIPAddHeader(Remote-Party-ID: ${CALLERID(name)} <sip:${NUMCALLER}@${DOMINI}>)
exten => s,n(end-privacy),Dial(SIP/PROXY-out/${NUMCALLED},,t);   ;t - Callee can transfer
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-CHANUNAVAIL,1,Congestion
exten => s-BUSY,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-VMNOEXIST,1,Goto(s-VMNO-${DIALSTATUS},1)
exten => s-VMNO-BUSY,1,Hangup
exten => s-VMNO-CONGESTION,1,Congestion
exten => s-CANCEL,1,Hangup
exten => s-CONGESTION,1,Congestion
exten => _s-.,1,Congestion
exten => s-.,1,Congestion


[station_transferUC]

; -- Masquerade NAT users
exten => _uX-X.,1,Macro(transferUCAAi,${EXTEN},${CALLERID(num)},${UCLID})

[macro-transferUCAAi]
; Transfer Active-Active, internal. Variable ${UCUSER} ve del INVITE original
exten => s,1,NoOp(Transfer call ${ARG2} to ${ARG1}. Prefix ${ARG3}. GWFailover ${ARG4}. --UCUser: ${UCUSER}--)
exten => s,n,Set(NUMDESTI=${ARG1})
exten => s,n,Set(NUMORIGEN=${ARG2})
exten => s,n,Set(CALLEDPREFIX=${ARG3})
exten => s,n,Set(GWFAILOVER=${ARG4})

exten => s,n(outDial),Dial(SIP/NB-out/${NUMDESTI},,t)
exten => s,n,Goto(s1-${DIALSTATUS},1)
;exten => s,n,Goto(s1-BUSY,1)

; Si la trucada dona un BUSY ho intentem per l'altre GW
exten => s1-BUSY,1,Goto(s2,1)
exten => s1-CHANUNAVAIL,1,Goto(s2,1)
exten => s1-CONGESTION,1,Goto(s2,1)

exten => s1-NOANSWER,1,Hangup
exten => s1-VMNOEXIST,1,Goto(s-VMNO-${DIALSTATUS},1)
exten => s1-VMNO-BUSY,1,Hangup
exten => s1-VMNO-CONGESTION,1,Congestion
exten => s1-CANCEL,1,Hangup
exten => _s1-.,1,Congestion

exten => s2,1(gwasterisk),Dial(SIP/PROXY-out/${CALLEDPREFIX}${NUMDESTI},,t)
exten => s2,n,Goto(s-${DIALSTATUS},1)

exten => s-CHANUNAVAIL,1,Congestion
exten => s-BUSY,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-VMNOEXIST,1,Goto(s-VMNO-${DIALSTATUS},1)
exten => s-VMNO-BUSY,1,Hangup
exten => s-VMNO-CONGESTION,1,Congestion
exten => s-CANCEL,1,Hangup
exten => s-CONGESTION,1,Congestion
exten => _s-.,1,Congestion
exten => s-.,1,Congestion
{noformat}
Thanks for your help



was (Author: jose.molina):
This is the console output for Asterisk 13.9.1:
{noformat}
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [25988 at incoming:1] Macro("SIP/ISP_SIPtrunk-00000000", "llamadaEntranteUC,25988,37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:1] NoOp("SIP/ISP_SIPtrunk-00000000", "CallingPress --1-- caller id --"37233" <37233>--") in new stack
-- Executing [s at macro-llamadaEntranteUC:2] Set("SIP/ISP_SIPtrunk-00000000", "TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:3] Set("SIP/ISP_SIPtrunk-00000000", "TRANSFERCONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:4] Set("SIP/ISP_SIPtrunk-00000000", "_TRANSFERCONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:5] Set("SIP/ISP_SIPtrunk-00000000", "NUMCALLED=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:6] Set("SIP/ISP_SIPtrunk-00000000", "NUMCALLER=37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:7] GotoIf("SIP/ISP_SIPtrunk-00000000", "0?desconegut:conegut") in new stack
-- Goto (macro-llamadaEntranteUC,s,10)
-- Executing [s at macro-llamadaEntranteUC:10] GotoIf("SIP/ISP_SIPtrunk-00000000", "0?addZeroPrefix") in new stack
-- Executing [s at macro-llamadaEntranteUC:11] Goto("SIP/ISP_SIPtrunk-00000000", "s,nextZeroPrefix") in new stack
-- Goto (macro-llamadaEntranteUC,s,13)
-- Executing [s at macro-llamadaEntranteUC:13] Set("SIP/ISP_SIPtrunk-00000000", "_UCUSER=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:14] Set("SIP/ISP_SIPtrunk-00000000", "CDR(PRIVACY-ID)="Privacy: off"") in new stack
-- Executing [s at macro-llamadaEntranteUC:15] Set("SIP/ISP_SIPtrunk-00000000", "CALLERID(all)=37233 <37233>") in new stack
-- Executing [s at macro-llamadaEntranteUC:16] SIPAddHeader("SIP/ISP_SIPtrunk-00000000", "P-Asserted-Identity: 37233 sip:37233 at mydomain.com") in new stack
-- Executing [s at macro-llamadaEntranteUC:17] GotoIf("SIP/ISP_SIPtrunk-00000000", "0?privacy:privacyoff") in new stack
-- Goto (macro-llamadaEntranteUC,s,22)
-- Executing [s at macro-llamadaEntranteUC:22] SIPAddHeader("SIP/ISP_SIPtrunk-00000000", "Remote-Party-ID: 37233 sip:37233 at mydomain.com") in new stack
-- Executing [s at macro-llamadaEntranteUC:23] Dial("SIP/ISP_SIPtrunk-00000000", "SIP/PROXY-out/25988,,t") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/PROXY-out/25988
-- SIP/PROXY-out-00000001 is ringing
-- SIP/PROXY-out-00000001 answered SIP/ISP_SIPtrunk-00000000
-- Channel SIP/PROXY-out-00000001 joined 'simple_bridge' basic-bridge
-- Channel SIP/ISP_SIPtrunk-00000000 joined 'simple_bridge' basic-bridge

    0x7f747800b0b0 -- Probation passed - setting RTP source address to 1.1.1.3:10748
    0x7f746800adc0 -- Probation passed - setting RTP source address to 1.1.1.1:30122
    -- Started music on hold, class 'default', on channel 'SIP/ISP_SIPtrunk-00000000'
    [May 25 11:27:50] NOTICE[19960][C-00000000]: chan_sip.c:23978 handle_response_notify: Got OK on REFER Notify message
{noformat}

And this is the console output for Asterisk 11 where the transfer works fine. As you can see in this case the call enters in the station_transferUC context to do the attendant transfer after receives the REFER message.
{noformat}
-- Executing [25988 at incoming:1] Macro("SIP/ISP_SIPtrunk-0000000a", "llamadaEntranteUC,25988,37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:1] NoOp("SIP/ISP_SIPtrunk-0000000a", "CallingPress --1-- caller id --"37233" <37233>--") in new stack
-- Executing [s at macro-llamadaEntranteUC:2] Set("SIP/ISP_SIPtrunk-0000000a", "TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:3] Set("SIP/ISP_SIPtrunk-0000000a", "_TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:4] Set("SIP/ISP_SIPtrunk-0000000a", "__TRANSFER_CONTEXT=station_transferUC") in new stack
-- Executing [s at macro-llamadaEntranteUC:5] Set("SIP/ISP_SIPtrunk-0000000a", "NUMCALLED=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:6] Set("SIP/ISP_SIPtrunk-0000000a", "NUMCALLER=37233") in new stack
-- Executing [s at macro-llamadaEntranteUC:7] GotoIf("SIP/ISP_SIPtrunk-0000000a", "0?desconegut:conegut") in new stack
-- Goto (macro-llamadaEntranteUC,s,10)
-- Executing [s at macro-llamadaEntranteUC:10] GotoIf("SIP/ISP_SIPtrunk-0000000a", "0?addZeroPrefix") in new stack
-- Executing [s at macro-llamadaEntranteUC:11] Goto("SIP/ISP_SIPtrunk-0000000a", "s,nextZeroPrefix") in new stack
-- Goto (macro-llamadaEntranteUC,s,13)
-- Executing [s at macro-llamadaEntranteUC:13] Set("SIP/ISP_SIPtrunk-0000000a", "_UCUSER=25988") in new stack
-- Executing [s at macro-llamadaEntranteUC:14] Set("SIP/ISP_SIPtrunk-0000000a", "CDR(PRIVACY-ID)="Privacy: off"") in new stack
-- Executing [s at macro-llamadaEntranteUC:15] Set("SIP/ISP_SIPtrunk-0000000a", "CALLERID(all)=37233 <37233>") in new stack
-- Executing [s at macro-llamadaEntranteUC:16] SIPAddHeader("SIP/ISP_SIPtrunk-0000000a", "P-Asserted-Identity: 37233 <sip:37233 at mydomain.com>") in new stack
-- Executing [s at macro-llamadaEntranteUC:17] GotoIf("SIP/ISP_SIPtrunk-0000000a", "0?privacy:privacyoff") in new stack
-- Goto (macro-llamadaEntranteUC,s,22)
-- Executing [s at macro-llamadaEntranteUC:22] SIPAddHeader("SIP/ISP_SIPtrunk-0000000a", "Remote-Party-ID: 37233 <sip:37233 at mydomain.com>") in new stack
-- Executing [s at macro-llamadaEntranteUC:23] Dial("SIP/ISP_SIPtrunk-0000000a", "SIP/PROXY-out/25988,,t") in new stack

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/PROXY-out/25988
-- SIP/PROXY-out-0000000b is ringing
-- SIP/PROXY-out-0000000b answered SIP/ISP_SIPtrunk-0000000a

    0x7f2b3c006da0 -- Probation passed - setting RTP source address to 1.1.1.3:10742
    0x2c6cbf0 -- Probation passed - setting RTP source address to 1.1.1.1:35120
    -- Started music on hold, class 'default', on SIP/ISP_SIPtrunk-0000000a
    -- Stopped music on hold on SIP/ISP_SIPtrunk-0000000a
    == Spawn extension (station_transferUC, u6-676, 1) exited non-zero on 'SIP/ISP_SIPtrunk-0000000a' in macro 'llamadaEntranteUC'
    == Spawn extension (station_transferUC, u6-676, 1) exited non-zero on 'SIP/ISP_SIPtrunk-0000000a'
    -- Executing [u6-676 at station_transferUC:1] Macro("SIP/ISP_SIPtrunk-0000000a", "transferUCAAi,u6-676,37233,") in new stack
    -- Executing [s at macro-transferUCAAi:1] NoOp("SIP/ISP_SIPtrunk-0000000a", "Transfer call 37233 to u6-676. Prefix . GWFailover . --UCUser: 25988--") in new stack
    -- Executing [s at macro-transferUCAAi:2] Set("SIP/ISP_SIPtrunk-0000000a", "NUMDESTI=u6-676") in new stack
    -- Executing [s at macro-transferUCAAi:3] Set("SIP/ISP_SIPtrunk-0000000a", "NUMORIGEN=37233") in new stack
    -- Executing [s at macro-transferUCAAi:4] Set("SIP/ISP_SIPtrunk-0000000a", "CALLEDPREFIX=") in new stack
    -- Executing [s at macro-transferUCAAi:5] Set("SIP/ISP_SIPtrunk-0000000a", "GWFAILOVER=") in new stack
    -- Executing [s at macro-transferUCAAi:6] Dial("SIP/ISP_SIPtrunk-0000000a", "SIP/NB-out/u6-676,,t") in new stack
    == Using SIP RTP TOS bits 184
    == Using SIP RTP CoS mark 5
    -- Called SIP/NB-out/u6-676
    -- SIP/NB-out-0000000c answered SIP/ISP_SIPtrunk-0000000a
    0x2c79f50 -- Probation passed - setting RTP source address to 1.1.1.1:40104
{noformat}

Here you can see the dialplan. To summarize, I pasted the contexts involved in the transfer and I masqueraded the IP address for security
{noformat}
[general]
static=yes
writeprotect=yes
language=es

[globals]

DOMINI=mydomain.com

TRANSFER_CONTEXT=station_transferUC
_TRANSFER_CONTEXT=station_transferUC
__TRANSFER_CONTEXT=station_transferUC

[incoming]

exten => s,1,NoOp(OPTION ping)

exten => _[1235679]XXXX,1,Macro(llamadaEntranteUC,${EXTEN:-5},${CALLERID(num)})
exten => _4[45]XXX,1,Macro(llamadaEntranteUC,${EXTEN:-5},${CALLERID(num)})
exten => _0[67]XXXXXXXX,1,Macro(llamadaEntranteUC,${EXTEN},${CALLERID(num)})
exten => _0XX.,1,Macro(llamadaEntranteUC,${EXTEN},${CALLERID(num)})
;---[FI] e-Connect


[macro-llamadaEntranteUC]

exten => s,1,NoOp(CallingPress --${CALLINGPRES}-- caller id --${CALLERID(all)}--)
exten => s,n,Set(TRANSFER_CONTEXT=station_transferUC)
exten => s,n,Set(_TRANSFER_CONTEXT=station_transferUC)
exten => s,n,Set(__TRANSFER_CONTEXT=station_transferUC)
exten => s,n,Set(NUMCALLED=${ARG1})
exten => s,n,Set(NUMCALLER=${ARG2})

exten => s,n,GotoIf($["${NUMCALLER}" = ""]?desconegut:conegut)
exten => s,n(desconegut),Set(NUMCALLER=desconegut)
exten => s,n,Goto(s,nextZeroPrefix)
exten => s,n(conegut),GotoIf($[ $["${NUMCALLER:0:1}" != "0"] & $[${LEN(${NUMCALLER})} != 5] ]?addZeroPrefix)
exten => s,n,Goto(s,nextZeroPrefix)
exten => s,n(addZeroPrefix),Set(NUMCALLER=0${NUMCALLER})

exten => s,n(nextZeroPrefix),Set(_UCUSER=${NUMCALLED})
exten => s,n,Set(CDR(PRIVACY-ID)="Privacy: off")
exten => s,n,Set(CALLERID(all)=${CALLERID(name)} <${NUMCALLER}>)
exten => s,n,SIPAddHeader(P-Asserted-Identity: ${CALLERID(name)} <sip:${NUMCALLER}@${DOMINI}>)
exten => s,n,GotoIf($[${MATH(${CALLINGPRES}>30)}=TRUE]?privacy:privacyoff)
exten => s,n(privacy),SIPAddHeader(Remote-Party-ID: ${CALLERID(name)} <sip:${NUMCALLER}@${DOMINI}>\;privacy=full)
exten => s,n,SIPAddHeader(Privacy: Id)
exten => s,n,Set(CDR(PRIVACY-ID)="Privacy: full")
exten => s,n,GoTo(s,end-privacy)
exten => s,n(privacyoff),SIPAddHeader(Remote-Party-ID: ${CALLERID(name)} <sip:${NUMCALLER}@${DOMINI}>)
exten => s,n(end-privacy),Dial(SIP/PROXY-out/${NUMCALLED},,t);   ;t - Callee can transfer
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-CHANUNAVAIL,1,Congestion
exten => s-BUSY,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-VMNOEXIST,1,Goto(s-VMNO-${DIALSTATUS},1)
exten => s-VMNO-BUSY,1,Hangup
exten => s-VMNO-CONGESTION,1,Congestion
exten => s-CANCEL,1,Hangup
exten => s-CONGESTION,1,Congestion
exten => _s-.,1,Congestion
exten => s-.,1,Congestion


[station_transferUC]

; -- Masquerade NAT users
exten => _uX-X.,1,Macro(transferUCAAi,${EXTEN},${CALLERID(num)},${UCLID})

[macro-transferUCAAi]
; Transfer Active-Active, internal. Variable ${UCUSER} ve del INVITE original
exten => s,1,NoOp(Transfer call ${ARG2} to ${ARG1}. Prefix ${ARG3}. GWFailover ${ARG4}. --UCUser: ${UCUSER}--)
exten => s,n,Set(NUMDESTI=${ARG1})
exten => s,n,Set(NUMORIGEN=${ARG2})
exten => s,n,Set(CALLEDPREFIX=${ARG3})
exten => s,n,Set(GWFAILOVER=${ARG4})

exten => s,n(outDial),Dial(SIP/NB-out/${NUMDESTI},,t)
exten => s,n,Goto(s1-${DIALSTATUS},1)
;exten => s,n,Goto(s1-BUSY,1)

; Si la trucada dona un BUSY ho intentem per l'altre GW
exten => s1-BUSY,1,Goto(s2,1)
exten => s1-CHANUNAVAIL,1,Goto(s2,1)
exten => s1-CONGESTION,1,Goto(s2,1)

exten => s1-NOANSWER,1,Hangup
exten => s1-VMNOEXIST,1,Goto(s-VMNO-${DIALSTATUS},1)
exten => s1-VMNO-BUSY,1,Hangup
exten => s1-VMNO-CONGESTION,1,Congestion
exten => s1-CANCEL,1,Hangup
exten => _s1-.,1,Congestion

exten => s2,1(gwasterisk),Dial(SIP/PROXY-out/${CALLEDPREFIX}${NUMDESTI},,t)
exten => s2,n,Goto(s-${DIALSTATUS},1)

exten => s-CHANUNAVAIL,1,Congestion
exten => s-BUSY,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-VMNOEXIST,1,Goto(s-VMNO-${DIALSTATUS},1)
exten => s-VMNO-BUSY,1,Hangup
exten => s-VMNO-CONGESTION,1,Congestion
exten => s-CANCEL,1,Hangup
exten => s-CONGESTION,1,Congestion
exten => _s-.,1,Congestion
exten => s-.,1,Congestion
{noformat}
Thanks for your help


> chan_sip: Asterisk 13 don't send INVITE with Replaces after accepted REFER
> --------------------------------------------------------------------------
>
>                 Key: ASTERISK-26072
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26072
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/General
>    Affects Versions: 13.9.1
>         Environment: Ubuntu 12.04
>            Reporter: Jose Molina
>            Assignee: Jose Molina
>            Severity: Minor
>
> Hi;
> We use Asterisk as a gateway to connect PSTN with our SIP platform (an opensips proxy) with a SIP trunk. We upgraded our Asterisk gateway from version 11 to 13. After the migration, we have an issue with attended transfer with the chan_sip driver. This is the scenario:
> 1- PSTN number (user A) calls any extension of our SIP platform (user B). B answer the call
> 2- user B holds the incoming call and makes a second call to other SIP extension (user C) to initiate an attended transfer.
> 3- user B transfers the call for try to join A and C users but this transfer fails.
> Analyzing the signalling traffic, we can see that the REFER message arrives from B to the gateway Asterisk with the Replaces header. Asterisk accepts the REFER message with a 202 Accepted response but doesn't send the INVITE with the replaces message to do the transfer. Asterisk send a NOTIFY with a sipfrag reporting 503 Service Unavaiable.
> {noformat}
> U 2016/05/30 08:20:02.3871052  1.1.1.2:5070 --> 1.1.1.1:5100
> REFER sip:37233 at 1.1.1.1:5100 SIP/2.0.
> Record-Route: <sip:xuser at 1.1.1.2;lr=on;ftag=4FC4B456-84A45F87>.
> Via: SIP/2.0/UDP 1.1.1.2:5070;branch=z9hG4bKa4e7.68946b95.0.
> Via: SIP/2.0/UDP 1.1.1.2:5070;branch=z9hG4bKa4e7.58946b95.0.
> Via: SIP/2.0/UDP 1.1.1.2;branch=z9hG4bKa4e7.5a17f5d2.0.
> Via: SIP/2.0/UDP 1.1.1.3;rport=5060;branch=z9hG4bK3b060ecd72DB1B2E.
> From: "userB" <sip:25988 at mydomain.com:5070>;tag=4FC4B456-84A45F87.
> To: "userA" <sip:37233 at mydomian.com:5100>;tag=as04e841f5.
> CSeq: 2 REFER.
> Call-ID: 26fc844416113667695f1f3f06d22826 at mydomain.com.
> Contact: <sip:u8-3 at 1.1.1.2>.
> Accept-Language: pl-pl,pl;q=0.9,en;q=0.8.
> Refer-To: <sip:u6-676 at 1.1.1.2?Replaces=4827f2a1-e2ca8142-5416e633%401.1.1.3%3Bto-tag%3D1422695821%3Bfrom-tag%3D107F133D-7BEB429E>.
> Referred-By: <sip:userB at mydomain.com>.
> Max-Forwards: 11.
> Content-Length: 0.
> .
> U 2016/05/30 08:20:02.387120 1.1.1.1:5100 -> 1.1.1.2:5070
> SIP/2.0 202 Accepted.
> Via: SIP/2.0/UDP 1.1.1.2:5070;branch=z9hG4bKa4e7.68946b95.0;received=1.1.1.2;rport=5070.
> Via: SIP/2.0/UDP 1.1.1.2:5070;branch=z9hG4bKa4e7.58946b95.0.
> Via: SIP/2.0/UDP 1.1.1.2;branch=z9hG4bKa4e7.5a17f5d2.0.
> Via: SIP/2.0/UDP 1.1.1.3;rport=5060;branch=z9hG4bK3b060ecd72DB1B2E.
> Record-Route: <sip:xuser at 1.1.1.2;lr=on;ftag=4FC4B456-84A45F87>.
> From: "userB" <sip:25988 at mydomain.com:5070>;tag=4FC4B456-84A45F87.
> To: "userA" <sip:37233 at mydomain.com:5100>;tag=as04e841f5.
> Call-ID: 26fc844416113667695f1f3f06d22826 at mydomain.com.
> CSeq: 2 REFER.
> Server: Asterisk PBX 13.9.1.
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
> Supported: replaces, timer.
> Contact: <sip:37233 at 1.1.1.1:5100>.
> Content-Length: 0.
> .
> U 2016/05/30 08:20:02.387228 1.1.1.1:5100 -> 1.1.1.2:5070
> NOTIFY sip:u8-3 at 1.1.1.2 SIP/2.0.
> Via: SIP/2.0/UDP 1,1,1,1:5100;branch=z9hG4bK285dcfd6;rport.
> Route: <sip:1.1.1.2:5070;lr=on;ftag=as04e841f5>,<sip:1.1.1.2:5070;lr=on;ftag=as04e841f5>,<sip:xuser at 1.1.1.2;lr=on;ftag=as04e841f5>.
> Max-Forwards: 70.
> From: "userA" <sip:37233 at mydomain.com:5100>;tag=as04e841f5.
> To: "userB" <sip:25988 at mydomain.com:5070>;tag=4FC4B456-84A45F87.
> Contact: <sip:37233 at 1.1.1.1:5100>.
> Call-ID: 26fc844416113667695f1f3f06d22826 at mydomain.com.
> CSeq: 103 NOTIFY.
> User-Agent: Asterisk PBX 13.9.1.
> Event: refer;id=2.
> Subscription-state: terminated;reason=noresource.
> Content-Type: message/sipfrag;version=2.0.
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
> Supported: replaces, timer.
> Content-Length: 33.
> .
> SIP/2.0 503 Service Unavailable.
> {noformat}
> The TRANSFER_CONTEXT variable is defined but the call no execute any line of code defined in the dialplan from this context.
> This same scenario works fine with Asterisk 11 and with the same config files. Asterisk sends a NOTIFY with a sifrag 200 OK and sent and INVITE with Replaces and the trasnfer is performed.
> Any idea why Asterisk 13 don't execute the TRASNFER_CONTEXT code and send the INVITE with Replaces? Is a possible bug in this release?
> Thanks for your help.
> Jose



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list