Pjsip fails to dial

Hi
I am using standard debian package, 13.14 - I’ve switched recently from chan_sip to pjsip (mostly for the HEP interface).
I am getting some occasional failure to dial (I see Everyone is busy/congested at this time), while “pjsip show aors” gives a status of Available.
I’ve added a trace of ${DEVICE_STATE(PJSIP/kamailio)} => when a regular call works, it shows INUSE. I havent yet manage to capture the value when the issue arises.

The pjsip.conf comes from the conversion with the contrib script, and is pretty bare to me (see at the end).

What could be wrong ?
Rgds
J.

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060

[kamailio]
type = aor
contact = sip:X.Y.Z.T
qualify_frequency = 60
default_expiration = 1800

[kamailio]
type = identify
endpoint = kamailio
match = X.Y.Z.T

[kamailio]
type = endpoint
context = from-kama
dtmf_mode = rfc4733
disallow = all
allow = alaw
allow = ulaw
direct_media = no
language = fr
aors = kamailio

We’d need to see the actual console output and any SIP signaling that does exist.

Here is the dialplan - it is called with Dial(local/${number}@kamaout,${dialoptions})

[kamaout]
exten => _X.,1,Verbose(1,${STRFTIME(${EPOCH},%C%y-%m-%d %H:%M:%S)} - Ctx: ${CONTEXT} - Exten: ${EXTEN} - Clid: ${CALLERID(all)}, options: ${dialoptions}, ${DEVICE_STATE(PJSIP/kamailio)})
same => n,Dial(pjsip/${EXTEN}@kamailio,${dialoptions})
same => n,Verbose(1,${STRFTIME(${EPOCH},%C%y-%m-%d %H:%M:%S)} - Ctx: ${CONTEXT} - Exten: ${EXTEN} - Clid: ${CALLERID(all)} ======= FAILED TO REACH KAMAILIO ===========${DIALSTATUS} )
same => n,Dial(pjsip/${EXTEN:2}@backuproute)

What is really weird is the console output:

2018-03-26 22:34:30 - Ctx: kamailioout - Exten: 99999999999 - Clid: “” <336666666666>, options: gA(/monitorasterisk/sounds/mastercall/general/vide), INUSE
2018-03-26 22:34:36 - Ctx: kamailioout - Exten: 99999999999 - Clid: “” <336666666666> ======= FAILED TO REACH KAMAILIO ===========ANSWER
callscenario / hangup - 2018-03-26 22:34:37 - “” <336666666666> - h ==>ANSWER

The DIALSTATUS is ANSWER, yet 1/no sip traces to host kamailio, 2/ the first route is not tried (no sip traces) 3/and indeed a call to the backup route while DIALSTATUS=ANSWER !

It is not so much the fact that DIALSTATUS is wrong, but that the Dial does not proceed - also, why is always DEVICE_STATE to INUSE !

J.

It is getting really weird. I have clear traces that show that dialplan execution continues, even if the first dial was successful. Yet, the documentation says “Dialplan execution will continue if no requested channels can be called, or if the timeout expires” - I would assume it does not continue if it succeeds

By default Dial does not continue if it does not succeed. Your output is verbose you’ve added, the normal dialplan execution logging is what is needed.

I’ve actually understood what was wrong - the option string contains a g which causes to continue when the called party hangs up

Thanks for the help