Attended transfers use hostname instead IP

Hi everyone!

I have the follow issue:

When I try make an attended transfer using “external_replaces” with V16, the result is

  • DNS search failed for hostname

  • Executing [external_replaces@from-internal:1] NoOp (" PJSIP/EXT-0000001e ", “”) in new stack

  • Executing [external_replaces@from-internal:2] Dial (" PJSIP/EXT-0000001e ", " *PJSIP/outgoing/sip:EXT2@hostname ") in new stack

channel ‘PJSIP/EXT-00000017’ status is ‘CONGESTION’

can you help me ?


The use of that special extension is a new one on me. but that isn’t a valid attended transfer URI (ReferTo: header content), as it contains no Replaces parameter. If the URI reflects the replacing leg, it is going to be busy with its connection to the referer, and some statuses for busy might well be reported as CONGESTION.

I think we need the source code for the dialplan, and the pjsip set logger on output for at least the REFER transaction and the resulting INVITE/Replaces.

This is my dialplan example

exten => _X.,1,NoOp(${EXTEN})
exten => _X.,n,Dial(PJSIP/${EXTEN},60,Ttw)
exten => external_replaces,1,NoOp()
same => n,Dial(PJSIP/outgoing/${SIPREFERTOHDR})

and this is the article I reviewed

There are many logs, but I considere these the most important

-- Executing [external_replaces@from-internal:1] NoOp("PJSIP/11719-0000001e", "") in new stack
[Oct 28 19:33:19] DEBUG[2047][C-0000000d]: pbx.c:2938 pbx_extension_helper: Launching 'Dial'
    -- Executing [external_replaces@from-internal:2] Dial("PJSIP/11719-0000001e", "PJSIP/outgoing/sip:1061@asteriskpbx-sandbox") in new stack

No provider found, checking channel drivers for PJSIP - 11719

Performing SIP DNS resolution of target 'asteriskpbx-sandbox'
Transport type for target 'asteriskpbx-sandbox' is 'Unspecified'

DNS search failed for asteriskpbx-sandbox
DNS search failed for query: 'asteriskpbx-sandbox
 PJSIP/outgoing-0000001f: Source of transaction state change is TRANSPORT_ERROR

    -- Auto fallthrough, channel 'PJSIP/11719-0000001e' status is 'CONGESTION'

I hope this works

The most important is the one that shows the actual SIP protocol exchanges. I don’t see it.

That would kill it. It seems to me that you must have modified this from what the referring party sent.

If this is being used, the referer isn’t doing an attended transfer. In any case the referrer chooses the URI, and if they send it in domain name form Asterisk has to be able to resolve it, in order to direct the transferred leg to the right machine.

I have a solution with WEBRTC and PJSIP with asterisk 16, everything works fine, incoming, outgoing, normal transfers, IVR menu, queues, etc. But now I have been trying to do attended transfers using external_replaces but it doesn’t work

here my dialplan

exten => _5590359777,1,Dial(PJSIP/1060)

exten => _XXXXXXXXXX,1,Dial(PJSIP/${EXTEN}@enlace_mcm)
exten => _X.,1,NoOp(${EXTEN})
exten => _X.,n,Dial(PJSIP/${EXTEN},60,Ttw)
exten => external_replaces,1,NoOp()
same => n,Dial(PJSIP/outgoing/${SIPREFERTOHDR})

and this is the result with pjsip logger off and “core set debug off”

   -- Executing [1060@from-internal:1] NoOp("PJSIP/1061-00000021", "1060") in new stack
    -- Executing [1060@from-internal:2] Dial("PJSIP/1061-00000021", "PJSIP/1060,60,Ttw") in new stack
    -- Called PJSIP/1060
  == DTLS ECDH initialized (automatic), faster PFS enabled
    -- PJSIP/1060-00000022 is ringing
    -- PJSIP/1060-00000022 answered PJSIP/1061-00000021
    -- Channel PJSIP/1060-00000022 joined 'simple_bridge' basic-bridge <850b4e1a-a720-43e3-bf9d-f17aa1e13c3b>
    -- Channel PJSIP/1061-00000021 joined 'simple_bridge' basic-bridge <850b4e1a-a720-43e3-bf9d-f17aa1e13c3b>
    -- Started music on hold, class 'default', on channel 'PJSIP/1061-00000021'
  == DTLS ECDH initialized (automatic), faster PFS enabled
    -- Executing [11719@from-internal:1] NoOp("PJSIP/1060-00000023", "11719") in new stack
    -- Executing [11719@from-internal:2] Dial("PJSIP/1060-00000023", "PJSIP/11719,60,Ttw") in new stack
    -- Called PJSIP/11719
  == DTLS ECDH initialized (automatic), faster PFS enabled
    -- PJSIP/11719-00000024 is ringing
    -- PJSIP/11719-00000024 answered PJSIP/1060-00000023
    -- Channel PJSIP/11719-00000024 joined 'simple_bridge' basic-bridge <14afeb69-bcf0-474a-a71e-ee023bff14f6>
    -- Channel PJSIP/1060-00000023 joined 'simple_bridge' basic-bridge <14afeb69-bcf0-474a-a71e-ee023bff14f6>
    -- Channel PJSIP/1060-00000023 left 'simple_bridge' basic-bridge <14afeb69-bcf0-474a-a71e-ee023bff14f6>
    -- Channel PJSIP/11719-00000024 left 'simple_bridge' basic-bridge <14afeb69-bcf0-474a-a71e-ee023bff14f6>
  == Spawn extension (from-internal, 11719, 2) exited non-zero on 'PJSIP/1060-00000023'
    -- Executing [external_replaces@from-internal:1] NoOp("PJSIP/11719-00000024", "") in new stack
    -- Executing [external_replaces@from-internal:2] Dial("PJSIP/11719-00000024", "PJSIP/outgoing/sip:1061@asteriskpbx-sandbox") in new stack
    -- Called PJSIP/outgoing/sip:1061@asteriskpbx-sandbox
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Auto fallthrough, channel 'PJSIP/11719-00000024' status is 'CONGESTION'

Why are you using external_replaces in the first place? It’s not required except for extremely narrow circumstances. If the SIP packet is constructed properly, then Asterisk will just do the required operations to complete the attended transfer with the channels in Asterisk.

I use this reference

Right, that’s if Asterisk is passing through the attended transfer to an upstream. Are you doing that? Are the channels inside of Asterisk?

the channels are inside of Asterisk but, JsSIP send the REFER and asterisk ask for the external_replaces. For the outbound/outgoing transfers works fine, I mean If I call a DID number or an extension, and the same origin extension transfer to other, works fine but If I receive the call and I do the transfer, It doesn’t work. And in the RTCSession variable, sent by the WebPhone is the same in both, except the direction (in or out).

EXT 1000 calls to EXT 1001 → EXT 1000 transfer the call to EXT 1002 it’s ok (out)
EXT 1000 calls to EXT 1001 → EXT 1001 transfer the call to EXT 1002 doesn’t work (in)

Then the SIP request is not being constructed with the proper information in order to complete the attended transfer locally.

Yes, I guess so, that’s why my question … then is it necessary to use external_replaces or not ? Because for both directions is the same code :confused:

If all channels are inside Asterisk and the SIP request is correct, then external_replaces is not necessary. I’d say barely anyone has even heard of the functionality or touched it. It’s only executed if we’re told to complete an attended transfer and we don’t have the channel.

Ok I understand. Then I will try to make changes to the webRTC library and let you know if I could fix it

Thanks !

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