App Dial in Macro - PJSIP

Hello Asterisk Forum,

I configured PJSIP endpoints and PJSIP trunks, and these are OK. The line ‘exten => _9XXXXXXXX,1,Dial(PJSIP/${EXTEN}@ASTERISK,60)’ is working. But, the line in a Macro: ‘exten => s,n,Dial(PJSIP/${EXTEN}@ASTERISK,60)’ isn’t working. The error is ‘Unable to create PJSIP channel - endpoint ‘9XXXXXXXX’ was not found’.

I think that is because the character ‘@’ isn’t recognized.

Please, any suggestions to fix it?

Regards,
Mauro

The first one shouldn’t work, as it is missing a $.

You should not have been using Macro in any designs created in about the last 10 years, and they will stop working, when you upgrade to Asterisk 21, or higher.

There is no such thing as a SIP or PJSIP trunk. What FreePBX calls extension (not enpoints) and trunks are both endpoints, but with some differences in how they are used.

You haven’t shown how your Macro is invoked and you haven’t shown the definition of your Asterisk endpoint.

It is not clear, as a result, whether X is literal, or a pattern character in each case. It should be literal in the error message

Thanks for your reply, David. The Asterisk Server is version 16, can I use GoSub?

In SIP, obviously, the line Dial is different, and it in that Macro works well.

PREFIJOCELU=56
GATEWAYPJSIP=ASTERISK

[salida-manual]
exten => _9XXXXXXXX,1,Macro(llamadas-manual,${CALLERID(num)},PJSIP,${PREFIJOCELU1},${EXTEN},${GATEWAYPJSIP},80,tT,${CDR(START)},${EXTEN})

[macro-llamadas-manual]

exten => s,1,NoOp
exten => s,n,Set(SRC=${ARG1})
exten => s,n,Set(TRO1=${ARG2})
exten => s,n,Set(PRF1=${ARG3})
exten => s,n,Set(DST=${ARG4})
exten => s,n,Set(GW=${ARG5})
exten => s,n,Set(TIM=${ARG6})
exten => s,n,Set(OPC=${ARG7})
exten => s,n,Set(ANS=${ARG8})
exten => s,n,Set(TEL=${ARG9})
exten => s,n,AGI(blacklist.php,${DST})
exten => s,n,NoOp(blacklisk=${enblacklist})
exten => s,n,GotoIf($[“${enblacklist}” = “1”]?hang:next)
exten => s,n(next),NoOp(CDR(START)=${CDR(START)})
exten => s,n,AGI(GenerateUniqueID.php,${DST},${SRC})
exten => s,n,NoOp(uniqueidmp=${uniqueidmp})
exten => s,n,NoOp(CDR(ANSWER)=${CDR(ANSWER)})
exten => s,n,Set(CDR(agente)=${DB(Manual/Anexo/Agente/${SRC})})
exten => s,n,Set(pref=“M”)
exten => s,n,Set(CALLERID(num)=$[${pref}${CALLERID(name)}])
exten => s,n,NoOp(CALLERID(num)=$[${pref}
${CALLERID(name)}])
exten => s,n,Dial(${TRO1}/${PRF1}${DST}@${GW},${TIM})
exten => s,n(hang),Hangup()

– Executing [s@macro-llamadas-manual:22] Dial(“PJSIP/5001-00000013”, “PJSIP/56987654321,ASTERISK,80”) in new stack
The error:
ERROR[347279]: chan_pjsip.c:2588 request: Unable to create PJSIP channel - endpoint ‘56987654321’ was not found

Regards,
Mauro

Hi,

I configured the same dialplan with the same Asterisk version (16) but different Operative System (in this case Debian), and it works well.

The ‘problem’ is in Ubuntu 20.04. The app ‘Dial’ doesn’t recognize the character ‘@’.

Regards,
Mauro

On Saturday 13 July 2024 at 04:18:38, voip_inatelso via Asterisk Community
wrote:

Hi,

I configured the same dialplan with the same Asterisk version (16) but
different Operative System (in this case Debian), and it works well.

The ‘problem’ is in Ubuntu 20.04. The app ‘Dial’ doesn’t recognize the
character ‘@’.

I find that quite remarkable, given that Ubuntu is essentially derived from
Debian.

Which precise versions of Asterisk did you get (16.xx,yy…?) when
installed under Debian, and under Ubuntu?

Antony.


I conclude that there are two ways of constructing a software design: One way
is to make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies.

  • C A R Hoare

                                                Please reply to the list;
                                                      please *don't* CC me.
    

Debian 11, Ubuntu 20.04.2

On Saturday 13 July 2024 at 18:19:45, voip_inatelso via Asterisk Community
wrote:

Debian 11, Ubuntu 20.04.2

If this is supposed to be an answer to my question “Which precise versions of
Asterisk did you get (16.xx,yy…?) when installed under Debian, and under
Ubuntu?” please note that I was asking about the versions of Asterisk, not the
Operating System.

Antony.


APL [is a language], in which you can write a program to simulate shuffling a
deck of cards and then dealing them out to several players, in four
characters, none of which appear on a standard keyboard.

  • David Given

                                                Please reply to the list;
                                                      please *don't* CC me.
    

Sorry. The information:

  • Ubuntu 20.04.2 - Asterisk 16.16.2
  • Debian 11 - Asterisk 16.30.1

Regards,
Mauro

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