Asterisk 1.8.3
It used to be working fine until we switched to a new SIP truck service provider. So I guess it probably is a configuration issue.Anyway, outgoing calls work fine, all incoming calls go direction fall to extension ‘s’.
Here’s the log from CLI:
[quote=“david55”]Yes, although that isn’t the only way of doing it. The optional last parameter is what you want to appear in the INVITE. It defaults to “s”.
I’ve never tried, but I suspect that the To header will be presented as ${CALLERID(dnid)}.[/quote]
I tried adding /desired_ext to register, but the invite message still shows as
INVITE sip:s@192.168.3.2:5060 SIP/2.0
Also, this is a SIP trunk connection, there will be a bunch of DIDs associated with it. With previous provider, I didn’t add anything to the register clause.
To be sure of the problem, I’d need a SIP trace of the REGISTER, and to check the RFC (I don’t have time for the latter now). However, I suspect both providers are violating the RFC in different ways.
[quote=“david55”]To be sure of the problem, I’d need a SIP trace of the REGISTER, and to check the RFC (I don’t have time for the latter now). However, I suspect both providers are violating the RFC in different ways.
Howeve you tried CALLERID(dnid)?[/quote]
unfortunately, CALLERID(dnid) returns nothing.
I am not getting any useful support from the provider, it’s really frustrating.
What register string are you using? If you have purchased multiple DIDs from one provider then you may have to create multiple registration strings having"/DID Number" at last of the registration string. That may solve the issue.
I tried that, but it is not making any difference.
Could somebody verify the INVITE message is supposed to contain valid extension?
My only has an ‘s’ in it: INVITE sip:s@192.168.3.2:5060 SIP/2.0
I hate to do it this way, but the provider doesn’t help at all.
So I hacked chan_sip.c, when incoming call has extension ‘s’, I just overwrite it with the number in “To” field.
Ugly, but it’s working for now.
[quote=“hongfeng”]I hate to do it this way, but the provider doesn’t help at all.
So I hacked chan_sip.c, when incoming call has extension ‘s’, I just overwrite it with the number in “To” field.
Ugly, but it’s working for now.[/quote]
It should be easier to do this in the dialplan. Handle everything as s, initially, then get the To header and extract the user part. Sorry, you have to work out the details for yourself.