PJSIP - Dial Multiple Endpoint and get the endpoint who answered

Good morning,

I’m trying to be able to recover the endpoint that answered when I run a dial with several endpoints in it:

Dial(${PJSIP_DIAL_CONTACTS(111)}&${PJSIP_DIAL_CONTACTS(123)}&${PJSIP_DIAL_CONTACTS(122)}&${PJSIP_DIAL_CONTACTS(321)},30)

I think this can be done by a macro but I can’t seem to find what to call or search to find the endpoint that answered the call

Any ideas ?

Thanks

The dialplan variable “DIALEDPEERNAME” gets set on the calling party channel with the answered peer name.

How can I get it back?

I tried with option G in dial function but the call is completely redirected and communication between the two parties does not take place.

Get it back… when and where?

You’d need to call Bridge. Note that bridge continues after the other party clears, like with “g” on Dial. However, I think you have missed a step in explaining your configuraton.

I would like to store the endpoint which answered the call (in DB for example)

Use a hangup handler[1] on the calling channel, which then stores it however is needed at the end of the call. Unless you want to store it when the call is answered (you haven’t specified which is why I asked when), then I don’t know off the top of my head.

[1] Hangup Handlers - Asterisk Documentation

Sorry,

Indeed, recovering it with the h extensions remains the simplest option.

I would have liked to be able to retrieve it directly after the call was answered but I think I can get by with that

If you have an idea to recover it after answering and during the call, I’m always interested, it could be useful to me later

Thanks

A post was split to a new topic: Incoming calls fail (FreePBX)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.