[OpenSIPS-Users] How to manage REFER Packet

Donat Zenichev donat.zenichev at gmail.com
Thu Mar 11 07:57:14 EST 2021

Good day Vinayak.

Firstly you'd better take into account that a sequence for processing REFER
is much different from how the INVITE method is being processed.
So it's known that so called hand-shake consists of the following messages
exchange: INVITE - 100 - 180/183 (optionally) - 200OK/202 Accepted - ACK
There is no complexity here and the way how it works is clear.

Now getting to the REFER method.
The REFER method likely falls in the category of in-dialog requests.
And in the predominant majority of cases can only be used within the
existing dialog (to implement an attended/unattended transfer).

The superficial view/sequence of messages will be as follows:
- firstly A side (who makes a transfer) sends REFER (to local proxy/B2B)
and awaits the arrival of 202.
(and by doing this also subscribes for an event)
- secondly local proxy/B2B invites a third party into the call (the further
behavior depends on if this is an attended/unattended transfer)
- (let's say it's unattended) then as soon as third party takes a call,
local proxy/B2B notifies (with NOTIFY method) the A party about the
happened event.
So: NOTIFY - 200OK
Which begets in its turn a normal call clearing from the A side (BYE -
- while A side was processing the happened event, local proxy/B2B took
charge of re-invitation of the B party (with newer signaling/media
- a call between B and C side is now established (through the proxy/B2B)

You might as well read this RFC document:
which is dedicated to the REFER method in particular.

Personally I haven't ever faced such a scenario, which would require such a
conversion of REFER to INVITE.
Is there a good reason for doing that?

It sounds entirely quite tricky, since a normal logic for processing REFER
already entails usage of INVITE.
But not to convert REFER into INVITE, but to engage a third party into the
call. Meanwhile REFER method keeps on doing its job.

Even if you still want to do that,
you need to write an OpenSIPS logic, which would be capable of handling the
full sequence for the REFER method (your leg with FreeSWITCH).
Keep it proper all the way during the call.
And on the other hand would be capable of conversion and processing the
usual INVITE sequence (the leg with A side).
Which doesn't look to me like a simple thing to do.

Best regards

On Mon, Mar 8, 2021 at 9:13 AM Vinayak Makwana <vinayak.makwana at ecosmob.com>

> Hello Everyone,
>  I would like to manage REFER packet with opensips script
>  In my case i want manage REFER packet like whenever i opensips proxy
> getting REFER packet from freeswitch at that time i need to convert this
> REFER packet into INVITE packet from opensips script and send to the
> endpoint.
> Is their  any possibilities where I can manage this thing in opensips
> 3.1.x ?
> Please suggest me.
> My scenario like this:
> A                            opensips                B(Freswitch)
>   |   -----INVITE ------->    |   -------INVITE------>   |
>   |   <-----200OK -------    |  <-------200OK------    |
>   |  <-----INVITE -------   |   <-------REFER----    |
> *Disclaimer*
> In addition to generic Disclaimer which you have agreed on our website,
> any views or opinions presented in this email are solely those of the
> originator and do not necessarily represent those of the Company or its
> sister concerns. Any liability (in negligence, contract or otherwise)
> arising from any third party taking any action, or refraining from taking
> any action on the basis of any of the information contained in this email
> is hereby excluded.
> *Confidentiality*
> This communication (including any attachment/s) is intended only for the
> use of the addressee(s) and contains information that is PRIVILEGED AND
> CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying
> of this communication is prohibited. Please inform originator if you have
> received it in error.
> *Caution for viruses, malware etc.*
> This communication, including any attachments, may not be free of viruses,
> trojans, similar or new contaminants/malware, interceptions or
> interference, and may not be compatible with your systems. You shall carry
> out virus/malware scanning on your own before opening any attachment to
> this e-mail. The sender of this e-mail and Company including its sister
> concerns shall not be liable for any damage that may incur to you as a
> result of viruses, incompleteness of this message, a delay in receipt of
> this message or any other computer problems.
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Best regards,
Donat Zenichev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210311/cfcdaf4d/attachment.html>

More information about the Users mailing list