Trigger an event when callee returns 180 ringing?

649 Views Asked by At

The situation as follows : User A Dials User B User B returns 180 Ringing

Both of them in the same PBX (Asterisk 11.5) and registered.

I would like to know if it is possible to trigger an action when User B returns 180 Ringing (and before the we gets 200 OK)

What I'v tried to do is send the call to a label before the call connects with option "B" of Dial() command and get the SIP status with:

${HASH(SIP_CAUSE,${CDR(dstchannel)}) 

and

${DEVICE_STATE(SIP/${CALLEE})}

Update:

The problem is the macro launched by Dial()'s "B" option is launched before the invite is sent, so the actions I'v preformed are useless.

I'm aware it's possible to get a state of ringing with AMI (with Newstate event) but in this point I don't to add another complexity for the task.

1

There are 1 best solutions below

2
On

No, it is not posible. Becuase pbx structures of outgoing channels will be no initialized.

You have go with external AMI script or have do complex rewrite of asterisk core.