OVH configuration dialplan

Hello, I registered my OVH sip trunk in pjsip with the [from-external] context and my users with the [from-internal] context. I am looking for my users to be able to call each other with numbers as it only has names like user01, user02. Then I need them to make outgoing calls. Can you tell me what is wrong or give me a solution?

exten => 1001,1,Dial(PJSIP/${user01})
exten => 1001,2,Voicemail(1001@boite-vocale)
exten => 1001,3,hangup

exten => 1002,1,Dial(PJSIP/${user02})
exten => 1002,2,Voicemail(1002@boite-vocale)
exten => 1002,3,hangup

exten => 1003,1,Dial(PJSIP/${user03})
exten => 1003,2,Voicemail(1003@boite-vocale)
exten => 1003,3,hangup

exten => 1004,1,Dial(PJSIP/user04,15,tTr)
exten => 1004,2,Voicemail(1004@boite-vocale)
exten => 1004,3,hangup

exten => 888,1,VoiceMailMain(s${CALLERID(num)})

exten => _XXXXX.,1,Answer
same => n,MixMonitor(/var/spool/asterisk/monitor/${UNIQUEID}.wav,b)
same => n,Set(CDR(recordingpath)=/var/spool/asterisk/monitor/${UNIQUEID}.wav)
same => n,Dial(PJSIP/from-external/${EXTEN})
same => n,Hangup

exten => 10,1,Goto(agent-login,s,1)
exten => 20,1,Goto(agent-logout,s,1)

[from-external]
include => from-internal

exten => s,1,Ringing(1)
exten => s,2,Answer
exten => s,3,Goto(hotline,s,1)
exten => s,4,Hangup(16)

[agent-login]
exten => s,1,Answer()
exten => s,n,AddQueueMember(support)
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup()

[agent-logout]
exten => s,1,Answer()
exten => s,n,RemoveQueueMember(support)
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup()

[hotline]
exten => s,1,Answer()
same => n,Set(CHANNEL(tonezone)=fr)
same => n,Set(CHANNEL(language)=fr)
same => n,Set(TIMEOUT(digit)=5)
same => n,Set(TIMEOUT(response)=10)
same => n,MixMonitor(/var/spool/asterisk/monitor/${UNIQUEID}.wav,b)
same => n,Set(CDR(recordingpath)=/var/spool/asterisk/monitor/${UNIQUEID}.wav)
exten => s,3,Queue(support,tTwW)
;exten => s,4,Background(/var/lib/asterisk/sounds/fr/recorded)
:exten => s,5,WaitExten()

${user01}, etc., are unset, and are therefore replaced by empty strings, which is why you got the error about the missing resource field in your other posting. I suspect you actually wanted literal values which are the same as the variable names you are using.

Please don’t start multiple topics on the same issue, especially don’t so so without referencing the previous history, or including the relevant information from previous topics.

I rather suspect you are copy and paste coding without understanding what you are copying.

This is dangerous. External callers should not be able to make external, and therefore presumably chargeable calls.

You need an extension that matches the format of numbers that you intend to use for outgoing calls, and which dials the endpoint corresponding to OVH, passing it that part of the number that OVH requires to route the call. It should be in the from-internal context, but not in the from-external.

Unfortunately, although I’d like say look at the supplied examples in the sample configuration file, they all basically assume that simply stripping an access digit and calling to an ITSP is too obvious to detail, so, whilst there are examples, they all try to demonstrate additional features at the same time, but basically, you use one of the examples that uses the ${EXTEN:n} notation, to strip initial digits, matched by a pattern, and go directly to dialling the number via the endpoint. There is no fundamental need to use variables.

Actually, the fourth example in

https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels

is closer to meeting your minimum requirements, although you should note that the specifics of this example assume the North American numbering plan.

Note that, these days, you may have to consider caller ID handling as well, to avoid being rejected by the provider, but the precise details of that require specific knowledge about the provider.

I speak French when you write very long explanations. Translators are less and less efficient.
That’s why I don’t understand what I should do.

I need example.

I don’t understand what you mean? I can’t associate in extensions.conf a name with a number?

(This example doesn’t have to use the _. Also the use of DUNDi is not relevant to the general principle.)

I feel like no one wants to help me? Why is IP telephony at asterisk also closed to new users? We can’t even learn. The documentations are not up to date and the forum is a disaster. We are answered in the form of a riddle.

instead of looking for examples you can not tell me where I made a mistake by underlining it and explaining to me how to solve it. seems more educational to me. :frowning:

You got a great response from @david551
You didn’t take any time to try to understand it.
You’ve lashed out, and I’ve now had to delete something offensive that you’ve posted.