PJSIP client receives a 503 Service unavailable


In the architecture, we have 1 asterisk communicating with AVAYA (our customer). The Avaya system (Avaya CM/R017x.01.0.532.0 AVAYA-SM- dispatch calls to our asterisk, and we can forward calls to this system afterwards based on the client communication (we provide an automatic system).

The automatic system that pick up calls and interact with phone callers are c++ library communicating with the asterisk via pjsip. At some point, the automatic system will ask the asterisk to forward the call, which works perfectly, the client is transferred to another extension.

The problem is: the c++ client communicating via pjsip receives a 503 Service unavailable, even though the call is correctly forwarded.

Here is the Dial plan for the forward:

exten => _X.,1,Log(NOTICE, Forward to human ${CALLERID(all)} -> ${EXTEN})
exten => _X.,n,Transfer(PJSIP/sip:${EXTEN}@
exten => _X.,n,Log(NOTICE, Transfer status : ${TRANSFERSTATUS} for ${CALLERID(all)} -> ${EXTEN})
exten => _X.,n,Wait(10)
exten => _X.,n,Log(ERROR, Transfer has not happened for ${CALLERID(all)} -> ${EXTEN})

Note: ‘customer’ and ‘city’ are placeholders for the real customer name / location.

Here is a log trace on pastebin, since I cannot upload a file as a new user : SIP 503 service unavailable - Pastebin.com (there is a lot of logs, you can search for 503 Service not available, or Forward to human)

Let me know if I need to provide other information

As a new comer in telephony, I don’t know what’s going on here.

Kind regards

In the eyes of the REFER NOTIFY code, the call was seemingly never answered (presumably because you transferred it away) which resulted in a 503 when the channel hung up. I don’t know if the code could be adjusted to work with this specific scenario, it’s not exactly a common scenario.

Hello jcolp, and thanks for your reply
When you say:

The call was seemingly never answered

Do you mean that from the asterisk point of view, the call was never answered in the first place? Which seems weird since we need to talk to the automatic system in order to be transferred afterwards. So I assume that the call is effectively picked up.
Or does it means that the 503 is sent because the extension where the user is being transferred has not picked up yet?
What would be the common scenario in that case?

The use of Transfer() in the dialplan is extremely uncommon. I don’t know the precise interaction it would have on things. The REFER NOTIFY code attempts to monitor where the channel is transferred in Asterisk, to determine what to send out in the NOTIFY. You are transferring to Transfer(). In a normal case the call would go elsewhere and stay in Asterisk.

Sorry about that, the dial plan was setup prior my arrival, and I’ve no idea it has been done this way.
Could it be that the customer AVAYA is already doing the same thing with the initial call? Which would explain the need to “re” transfer the call back to Avaya.
Otherwise, to move the call to another extension, the normal case would be using Dial?

Dial is what is generally used to place an outgoing call and connect to it. It keeps the call in Asterisk. I can’t comment on why your setup is the way it is and the decisions made.

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