Calls not hanging up properly

We forward calls to outside numbers a lot from our PBX. The basic premise is Person A calls a number that belongs to us, our asterisk system forwards it to Person B, and plays a message to Person B before connecting the 2 calls together.

The problem is, if Person B hangs up before Person A, Person A keeps going down the dialplan until they eventually hit our “catchall” rule, at which point they end up somewhere very strange to them. What am I doing wrong to cause this?

I have sanitized the code a bit below, any help would be awesome.

; Call forwarding for for Kevin (ID# 7837) exten => 8775555555,1,Noop(for Kevin) exten => 8775555555,2,Dial(ZAP/g3/8665555555,,A(/var/lib/asterisk/glassnet/glassnet_whisper)) exten => 8775555555,3,Hangup()

You are not necessarily doing anything wrong. Public networks typically do not signal party B disconnects for landlines. One of the reasons for this is to allow someone to hangup on one phone and continue the call on a more convenient, parallel, extension.

(They may give you disconnect supervision after several minutes.)

How is what I’m doing different then just making a normal outbound call from my phone? The PBX gets enough of a disconnect info to send Person A through the rest of the dialplan, but can’t use that info to disconnect them?

I guess I can now kinda see part of the problem after looking at the CLI. After person B hangs up, the system Person A just like an incoming call with regular old callerid (their callerid) and doesn’t seem to care about the number dialed anymore? If it did care about the number dialed still, wouldn’t my “exten => 8775555555,3,Hangup()” disconnect the call?

This is difficult because you may have oversimplified your dialplan and because you haven’t provided the CLI output. Your simplified dialplan doesn’t really have a rest of the dialplan.

If the call were made to a BT landline in the UK, I am fairly certain you would never know that party B had cleared. However, if your country/network implement party B clearing, for landline calls, or party B is a mobile, Asterisk might treat a clear within the annoucement as a failed call, rather than an answer, but even then it shouldn’t go beyond a Hangup.

What is ${DIALSTATUS} when Asterisk returns from Dial?

Which version of Asterisk is this?

Which country are you in and who is the PSTN network operator for you and for party B?

Makes sense

I don’t know how to get you the ${DIALSTATUS}, but in the CLI, when Party B hangs up, you get this before it continues on through the rest of the dialplan.

 == Spawn extension (incoming, 8775935974, 2) exited non-zero on 'Zap/1-1'

Asterisk is version 1.2.17

I’m in the USA, and my T1 lines are Quest and ATT (some of each)

Even if there is a bug, that version wouldn’t be fixed; it is too old.

On current versions, exitted non-zero means that the call has cleared. For 1.4 onwards, that will cause party A to be hungup, by default. I have a feeling that the documentation for 1.4 says that 1.2 used to put you back to he “default, s” extension, which might be your problem.

If version 1.2 supports the g option on Dial, you may want to try using that.

edit: wrote this before your last post :stuck_out_tongue:

Gonna try g now.

hmm, sounds like thats my problem.

Thanks for your help man, much appreciated.

On a side note, is there a different way I could forward without the A(sound.gsm), like maybe just using the blind transfer function, that would work better?

THANKS AGAIN!

g didn’t solve it, dangit, heh.

From what i can tell, g keeps it in the context if the call disconnects, so I kinda think I need this whole file in its own context, unless that 1.2 bug you where talking about is really the culprit.

Let me explain my situation a little better

I am (unfortunately) using a Fonality box, which is why its still on 1.2. There UI has no place to do forwarding like this, so we just added it ourselves. I have an #include => “call_forwarding.conf” in the incoming.conf right after the [incoming] context. I tried making my conf file its own context (added [callfwd] to the top of the call_forwarding.conf) and it broke the whole dialplan, I think because of Fonality’s excessive use of contexts and macro layering, but I don’t know for sure, I’m not an expert.

So, currently, the way i understand it, becuase my include of the conf file is right below the [incoming] context, my conf file is considered under that same context, and thus “g” is letting it get to the bottom of that incoming.conf, which is a Goto to the rest of the dialplan.

Any ideas on how I could go about adding my call forwarding conf to the dialplan in its own context, so I could test “g”, without breaking the rest of the dialplan?

Thanks a million!