[asterisk-dev] Transfer cmd (PJSIP not sending Referred-By but chan_sip does)

Mark Michelson mmichelson at digium.com
Tue Aug 25 10:30:22 CDT 2015


The answer to this is actually pretty simple: adding Referred-By in 
outgoing SIP REFERs is simply not implemented in chan_pjsip's 
chan_pjsip_transfer() function.

As far as the syntax required for the Transfer() application, that's 
probably a case where that needs to be clarified in documentation. There 
are lots of places in PJSIP configuration where we require full SIP URIs 
rather than just IP addresses or bare URIs (user at domain).

On 08/25/2015 10:00 AM, Dan Cropp wrote:
>
> I asked the question on asterisk–users but did not receive a response, 
> so I am sending the question here.
>
> I am running Asterisk 13.5.0.
>
> A call comes in, Asterisk answers it. After some actions, the call 
> needs to be Transferred (SIP REFER) to another number.  The other 
> switch is responsible for accepting the Transfer and tromboning the 
> lines internally. It will also send a BYE so Asterisk no longer has 
> the call.
>
> The behavior works when I have the endpoint configured at chan_sip.  
> It does not work when the endpoint is configured as PJSIP.  I worked 
> with the other switch vendor and he determined chan_sip includes the 
> Referred-By header. PJSIP does not include the Referred-By header.  
> The other switch requires the Referred-By header to be present.
>
> I tried setting the channel’s SIPREFERREDBYHDR variable before the 
> Transfer command and that still did not force the Referred-By header 
> to be part of the REFER packet.
>
> I tried the PJSIP_HEADER add and it still did not add the Referred-By 
> header to the REFER packet.
>
> Is there a PJSIP setting to force the Referred-By to be part of the 
> REFER packet?
>
> chan_sip (succeeds)
>
> 19:27:32.512123 IP (tos 0x0, ttl 64, id 11492, offset 0, flags [none], 
> proto UDP (17), length 630)
>
>     192.168.xxx.xxx.sip > 192.168.yyy.yyy.sip: SIP, length: 602
>
>         REFER sip:3400 at 192.168.yyy.yyy:5060 SIP/2.0
>
>         Via: SIP/2.0/UDP 192.168.xxx.xxx:5060;branch=z9hG4bK58f4bd1d
>
>         Max-Forwards: 70
>
>         From: <sip:3344 at 192.168.xxx.xxx>;tag=as44000cf4
>
>         To: <sip:3400 at 192.168.yyy.yyy>;tag=7Iy0JkwDC
>
>         Contact: <sip:3344 at 192.168.xxx.xxx:5060>
>
>         Call-ID: jdEuqpAK-0002- at 192.168.yyy.yyy 
> <mailto:jdEuqpAK-0002- at 192.168.yyy.yyy>
>
>         CSeq: 102 REFER
>
>         User-Agent: Asterisk PBX 13.5.0
>
>         Date: Thu, 20 Aug 2015 19:27:32 GMT
>
>         Refer-To: <sip:370 at 192.168.yyy.yyy>
>
>         Referred-By: <sip:3344 at 192.168.xxx.xxx:5060>
>
>         Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, 
> NOTIFY, INFO, PUBLISH, MESSAGE
>
>         Supported: replaces, timer
>
>         Content-Length: 0
>
> Pjsip
>
> 18:46:58.386372 IP (tos 0x0, ttl 64, id 38690, offset 0, flags [DF], 
> proto UDP (17), length 654)
>
>     192.168.xxx.xxx.sip > 192.168.yyy.yyy.sip: SIP, length: 626
>
>         REFER sip:3400 at 192.168.yyy.yyy:5060 SIP/2.0
>
>         Via: SIP/2.0/UDP 
> 192.168.xxx.xxx:5060;rport;branch=z9hG4bKPjec41c3b9-d734-482d-82c1-2a6f8d9452a3
>
>         From: 
> <sip:3344 at 192.168.xxx.xxx>;tag=3c10f423-e468-42ea-87a1-658ae106581c
>
>         To: <sip:3400 at 192.168.yyy.yyy>;tag=WITKDakt
>
>         Contact: <sip:192.168.xxx.xxx:5060>
>
>         Call-ID: s6Wk6l6Q-0001- at 192.168.yyy.yyy 
> <mailto:s6Wk6l6Q-0001- at 192.168.yyy.yyy>
>
>         CSeq: 981 REFER
>
>         Event: refer
>
>         Expires: 600
>
>         Supported: 100rel, timer, replaces, norefersub
>
>         Accept: message/sipfrag;version=2.0
>
>         Allow-Events: message-summary, presence, dialog, refer
>
>         Refer-To: <sip:370 at 192.168.yyy.yyy>
>
>         Max-Forwards: 70
>
>         User-Agent: Asterisk PBX 13.5.0
>
>         Content-Length:  0
>
> One other slight oddity.
>
> To get chan_sip to Transfer
>
> 370 at 192.168.yyy.yyy <mailto:370 at 192.168.yyy.yyy>
>
> To get PJSIP to Transfer with the correct Refer-To header, I had to 
> include the <> and sip:
>
> <_sip:370 at 192.168.yyy.__yyy_>
>
> Have a great day!
>
> Dan
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150825/88d645a3/attachment-0001.html>


More information about the asterisk-dev mailing list