How to avoid S extension coming to asterisk

I have 2 asterisk when I dial the 123 from my first asterisk box which is configured on another asterisk box as an dialplan(extension) but on another box S is coming? So the URI is coming sip:s@
why it is happening

Insufficient information. Please provide the dialplans, the channel technology being used and the configuration for that technology.

Note that Asterisk replaces an empty extension by"s" internally.

Have created a sip trunk in the second server to receive calls from first one ? if so then
in your second server you add registry =>user:password@5060/123 in the sip.conf trunk registry.

then you will get 123 instead of s

The key missing information her was that you were using dynamic hosts. They are not generally necessary for internal trunks, as you normally know the IP address of both ends.

Hi @arunkoods,

I have tried it and it works but the problem is it will only work for one specific number and I am having multiple numbers so in this case it will not work

Why do you need to use dynamic hosts? If you use static hosts, Asterisk will use the user used in the dialstring, but if you use dynamic hosts, it will use the complete URI that it received in the register request, as SIP doesn’t have a mechanism to register just the domain part of the contact URI.

1 Like

Hi @david551,

I am not using any dynamic hosts, I have registered a peer as a outbound on 2nd box where I will receive any digits which will come from 1st box but instead of digits it is coming ‘S’ , may be I am missing something else

I have found something strange as when I am registering a peer in softphone to take calls then I am seeing the below message in 1st box
Dial(“PJSIP/mytrunk_IN-00001712”, “PJSIP/1001/sip:1001@myofficeIP:65248;ob,20,g,1”)

But If am registering the same peer on Asterisk 2nd box instead of softphone then the below message is coming
Dial(“PJSIP/mytrunk_IN-00001718”, “PJSIP/1001/sip:s@Asterisk2ndboxIP:5060,20,g,1”)

That difference is the result of what is in your dialplan.

Also, as what appears in your dialplan may involve the value of ${EXTEN}, the full log lines is needed to understand what is happening.

If you are using chan_pjsip for the outbound registration then the “contact_user” configuration option on the outbound registration can be changed to set the user portion in the Contact, which can be used for dialing. By default it is set to “s”.

Hi @jcolp,

My endpoint is on pjsip based on 1 box as server but i am doing outbound registration on 2nd box which is chan_sip based means no pjsip is installed …so is this possible that s is coming because of this

When you register, in SIP, you specify a full SIP URI, including user part, on which you can be contacted. This means that the user part is not available for calls to you. If, in the registration, you don’t specify a use part, Asterisk still completes the URI, by setting the user part to s.

You only need to register if the peer would otherwise not know how to contact you, so registration should not be a normal thing to do on private trunks. Also the reason that you can send user parts to ITSPs is that they don’t register with you.