Incoming calls problem \ ovh provider

hello ,

i have one sip trunk and many DIDs numebrs in OVH , i afected every DID number to an extension by creating a trunk sip and inbound route for each number and in ovh interface i redirected all traffic to trunk. i have no problem with outbound calls but inbound calls sometimes works and sometimes not and sometimes an incoming call ring in different extensions in the same time .

what did i did wrong . thanks in advance; would be a great place to start. Right now, you’ve told us “my stuff is broke…

The answers to your questions are in the /var/log/asterisk/full file, so I’d start there.

You made a trunk per DID.

All you need is one trunk and then an inbound route for each DID that you want routed specifically.

1 Like

yes.i created a trunk for each DID with a sip configuration like this :



003********:[email protected]/003*****05 (change number in every trunk)

Asterisk will only use the first matching definition. Hopefully it will use a type=peer match, and type=peer is likely to be more secure, but there is nothing in your trunk definitions about the user part of the request URI, so Asterisk only has the IP address to go on and will use the “first” section that matches on that. First refers to the position in the internal data structures and may not reflect the order in the file.

That basically means you have to discriminate based on the Asterisk extension that appears in the incoming request.

In a traditional, analogue, or ISDN, system, you would have a single trunk that was shared across all your incoming numbers. (Although I doubt that direct in dialling is still offered on analogue connections.)

Note that username= was deprecated in favour of defaultuser=, a long time ago, probably because it was misleading people to think it had a role for incoming calls.

1 Like

so what should i do ?

Please explain why you can’t use a single trunk with all your DIDs. That is the simplest and most robust, if your provider supports it.

1 Like

because it didn"t work in first try with one single trunk . i will retry it right know .

after disabling all the trunks and keep one trunk running . incoming calls workd but they rings in all extensions in first try and after rebooting asterisk no incoming call works now

In Reports -> Asterisk Info -> Registries, does the trunk show as Registered?

If not, report status and any errors in the log regarding registration.

If yes, what (if anything) appears in the Asterisk log on an attempted incoming call? What does caller hear?

1 Like

Don’t use a sip trunk. Gods the horrible old documentation on the internet ……

Use pjsip and use the toheader context.

1 Like

yes , the trunk is registred . now it works when i add a DID number in the end of the Recording string but when calling all the other DIDs the all ring in the extension linked to the DID number add to the recording string

ok i will try using pjsip right now … thanks

As @sorvani said, change the context for the trunk to from-pstn-toheader

Set up an Inbound Route with DID and CID left blank (ANY/ANY). Call in and see what appears in the CDR DID field. Set up your Inbound Routes with DID in the same format.


Hello , i changed my conf to pjsip trunk as @sorvani and @Stewart1 saggested … in coming calls works but and if i calls the dids they rings in the disered extensions but this just works just for a while after that when you call the DIDs it rings but not in the extensions but when i reboot it work … outbond calls dont work … what can i do … thanks in advance .

If it works after a restart then quits after a while there is something in your config. Most likely lower the registration time of the the trunk In the advanced pjsip settings tab.

1 Like

hello sovrani … i lowred every setting but always the same problem it works for a while

Try setting Expiration to 120.


its wooooorks …thank you all so much …the PJSIP Trunk suggested by @sorvani and the setting experation from @Stewart1 saved the day … thank you guys

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