Dial() option -g implementation

Well, the environment is set to as such →
Trunk is PJSIP
Inbound route is set to Custom Destination and custom destination has the context as below :-

[context]
exten => _X.,1,Dial(PJSIP/[email protected],,g)
exten => _X.,2,Hangup

The trunk options are set by overriding options in the trunk settings.

Now the problem is, when somebody(party A) calls my DID number and the calls come in, the system dials out to 123456790(party B) via my trunk and then if the called party(123456789 - Party B) hangs up the call my system still does not hang up the call initiated by Party-A(towards my DID number).

g isn’t a valid number; you have put it in the timeout field, not the options field.

g as an option doesn’t do anything useful in this dialplan, as there is an implied hangup when it is not used.

I think this is probably actually due to a lack of disconnect supervision from party B. This is likely to happen if party B is on a simple analogue line. Traditionally hanging up an analogue phone doesn’t result in an immediate network release. This was done to allow a householder to put one phone down, walk to another part of the house, and pick up a second phone, connected to the same line, without losing the call.

There is a trend towards reducing this time from minutes to seconds, as the result of the take up of cordless phones, and the abuse of the original system by scammers.

Although ISDN networks will signal the hangup, most SIP providers won’t, and if they do, they are likely to signal it as hold, rather than release.

See Hardware for telephone exchange - Asterisk Hardware - Asterisk Community for a side discussion on this behaviour of analogue lines.

sorry my apology! I meant ,,g mistakenly i typed here ,g

Instead of the Custom Destination, try a Misc Destination specifying 123456789 and retest.
If you still have trouble, make a failing call with pjsip logger on, paste the Asterisk log for the call at pastebin.freepbx.org and post the link here. Also post the time when B hangs up.

1 Like

What is your end-goal here that you are trying to achieve?

In particular, why is A unable to detect that B is no longer talking?