PJSUA/PJSUA2: Immediately hangup on unreachable client

JJ
Jochen Jung
Fri, Sep 10, 2021 5:35 PM

Hello,

I'm using mostly PJSUA2. I have an userless account set up and want to do
direct calls. The call is started via pj::Call::makeCall() and hangup via
pj::Call::hangupCall(). This is working for clients that are reachable and
sending provisional responses.

However it is not working as I intended when calling clients that are not
reachable (SIP-Uri is valid though). The call is disconnected when using
hangupCall but the session still exists. Repeating this process too fast
will result in an "PJ_ETOOMANY" error. I want those sessions to end
immediately since sip cancel won't reach the client anyway. The session
timeout seems to have a minimal value of 90 seconds.

I tried pjsip_inv_terminate, pjsip_inv_end_session and pjsip_dlg_terminate
to no avail.

Is there a way to immediately hangup on an unreachable client and how can
it be done?

Regards
Jochen Jung

Hello, I'm using mostly PJSUA2. I have an userless account set up and want to do direct calls. The call is started via pj::Call::makeCall() and hangup via pj::Call::hangupCall(). This is working for clients that are reachable and sending provisional responses. However it is not working as I intended when calling clients that are not reachable (SIP-Uri is valid though). The call is disconnected when using hangupCall but the session still exists. Repeating this process too fast will result in an "PJ_ETOOMANY" error. I want those sessions to end immediately since sip cancel won't reach the client anyway. The session timeout seems to have a minimal value of 90 seconds. I tried pjsip_inv_terminate, pjsip_inv_end_session and pjsip_dlg_terminate to no avail. Is there a way to immediately hangup on an unreachable client and how can it be done? Regards Jochen Jung
SM
Sai Mukund Sagar Deshpande
Mon, Sep 13, 2021 10:29 AM

I think initially it will try to resolve DNS if it's URI. If no DNS
reply, it will wait till timeout. API: pj_gethostip

You could check if this is one of the reason for delay you are
observing.

On Fri, 2021-09-10 at 19:35 +0200, Jochen Jung wrote:

Hello,

I'm using mostly PJSUA2. I have an userless account set up and want
to do direct calls. The call is started via pj::Call::makeCall() and
hangup via pj::Call::hangupCall(). This is working for clients that
are reachable and sending provisional responses.

However it is not working as I intended when calling clients that are
not reachable (SIP-Uri is valid though). The call is disconnected
when using hangupCall but the session still exists. Repeating this
process too fast will result in an "PJ_ETOOMANY" error. I want those
sessions to end immediately since sip cancel won't reach the client
anyway. The session timeout seems to have a minimal value of 90
seconds.

I tried pjsip_inv_terminate, pjsip_inv_end_session and
pjsip_dlg_terminate to no avail.

Is there a way to immediately hangup on an unreachable client and how
can it be done?

Regards
Jochen Jung


Visit our blog: http://blog.pjsip.org

pjsip mailing list -- pjsip@lists.pjsip.org
To unsubscribe send an email to pjsip-leave@lists.pjsip.org

I think initially it will try to resolve DNS if it's URI. If no DNS reply, it will wait till timeout. API: pj_gethostip You could check if this is one of the reason for delay you are observing. On Fri, 2021-09-10 at 19:35 +0200, Jochen Jung wrote: > Hello, > > > I'm using mostly PJSUA2. I have an userless account set up and want > to do direct calls. The call is started via pj::Call::makeCall() and > hangup via pj::Call::hangupCall(). This is working for clients that > are reachable and sending provisional responses. > > However it is not working as I intended when calling clients that are > not reachable (SIP-Uri is valid though). The call is disconnected > when using hangupCall but the session still exists. Repeating this > process too fast will result in an "PJ_ETOOMANY" error. I want those > sessions to end immediately since sip cancel won't reach the client > anyway. The session timeout seems to have a minimal value of 90 > seconds. > > I tried pjsip_inv_terminate, pjsip_inv_end_session and > pjsip_dlg_terminate to no avail. > > Is there a way to immediately hangup on an unreachable client and how > can it be done? > > > Regards > Jochen Jung > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list -- pjsip@lists.pjsip.org > To unsubscribe send an email to pjsip-leave@lists.pjsip.org
JJ
Jochen Jung
Fri, Sep 17, 2021 4:02 PM

Hello Sai Mukund Sagar Deshpande,

i don't think that is my problem here. The SIP invite is sent to the
callee. At this point no resolving should take place anymore.

Regards
Jochen Jung

On Fri, Sep 10, 2021 at 7:35 PM Jochen Jung jochenmajjung@gmail.com wrote:

Hello,

I'm using mostly PJSUA2. I have an userless account set up and want to do
direct calls. The call is started via pj::Call::makeCall() and hangup via
pj::Call::hangupCall(). This is working for clients that are reachable and
sending provisional responses.

However it is not working as I intended when calling clients that are not
reachable (SIP-Uri is valid though). The call is disconnected when using
hangupCall but the session still exists. Repeating this process too fast
will result in an "PJ_ETOOMANY" error. I want those sessions to end
immediately since sip cancel won't reach the client anyway. The session
timeout seems to have a minimal value of 90 seconds.

I tried pjsip_inv_terminate, pjsip_inv_end_session and pjsip_dlg_terminate
to no avail.

Is there a way to immediately hangup on an unreachable client and how can
it be done?

Regards
Jochen Jung

Hello Sai Mukund Sagar Deshpande, i don't think that is my problem here. The SIP invite is sent to the callee. At this point no resolving should take place anymore. Regards Jochen Jung On Fri, Sep 10, 2021 at 7:35 PM Jochen Jung <jochenmajjung@gmail.com> wrote: > Hello, > > > I'm using mostly PJSUA2. I have an userless account set up and want to do > direct calls. The call is started via pj::Call::makeCall() and hangup via > pj::Call::hangupCall(). This is working for clients that are reachable and > sending provisional responses. > > However it is not working as I intended when calling clients that are not > reachable (SIP-Uri is valid though). The call is disconnected when using > hangupCall but the session still exists. Repeating this process too fast > will result in an "PJ_ETOOMANY" error. I want those sessions to end > immediately since sip cancel won't reach the client anyway. The session > timeout seems to have a minimal value of 90 seconds. > > I tried pjsip_inv_terminate, pjsip_inv_end_session and pjsip_dlg_terminate > to no avail. > > Is there a way to immediately hangup on an unreachable client and how can > it be done? > > > Regards > Jochen Jung >