Adding mobile phone as dynamic queue member

What sounds quite simple seems to be not. The problem is that most what I have found on the internet to that topic is mostly outdated and often related to SIP instead of PJSIP.

What I found so far seems that you have to add a local channel to get it work by AddQueueMember, however I’m new to local channels and still miss how to get the pieces together esp. handling device state. There seems to be the possibility to add a " stateinterface" parameter for AddQueueMember, but what to put in there?

Maybe someone could give me a hint how to put the different pieces together to get this working.

Thanks a lot.

You don’t have to use a local channel, but if you do, the ultimate channel technology becomes irrelevant, as that will be handled the same way as normal outgoing calls to the provider in question.

I’m assuming that mobile phone means a 2G, 3G, 4G, or 5G call, not a call to a VoIP app, using mobile data. In that case the only states that are available would be that of the endpoint used, but that is shared, so the state is not useful, or a custom state, maintained by a local channel. Without the state interface, all calls will be attempted and a busy condition only detected by the failure of the call.

1 Like

You don’t have to use a local channel, but if you do

But what to put in to AddQueueMember then? If I put in a dial string for the configured sip trunk to dial out to the mobile phone the state of the queue member is shown as (invalid).

I’m assuming that mobile phone means a 2G, 3G, 4G, or 5G call

More generally an external phone number is meant which could be dialed by the already configured and working sip trunk.

invalid suggests that either the dial string is malformed, or there is a bug in chan_pjsip.

Moreover, it only seems to be signficant if you have certain non-default, settings in the queue-empty setting. Otherwise the call will be attempted, and you should get a more specific error.

SIP and Asterisk do not have trunks. I assume you mean an endpoint associated with a provider. If you use a local channel, the queue application is dealing with an Asterisk extension number, and doesn’t care about the channel technology. That is addressed by the part of the dialplan that converts the extension into the arguments for Dial().

1 Like

SIP and Asterisk do not have trunks. I assume you mean an endpoint associated with a provider.

Your assumption is correct.

invalid suggests that either the dial string is malformed, or there is a bug in chan_pjsip.

Maybe you can give me a hint what is malformed. The member is added from the CLI via:

queue add member PJSIP/+4912345678@trunk-endpoint to central

Where “trunk-endpoint” is the working endpoint for the trunk and “central” is the queue name. If I use the same string with “Dial()” it is dialed out correctly.

CLI queue show then gives the following result:

Members:
PJSIP/+4912345678@trunk-endpoint (ringinuse disabled) (dynamic) (Invalid) …

Thanks again

I found the following thread dealing with a similar problem where you also posted a solution. :+1:

https://community.asterisk.org/t/hints-state-for-local-channel/89208

Think I will give this a try

Thanks for taking the time to help me.