My "One for All" Ruby plan ** Updated 08-Oct-08
I'm using the X-Lite softphone and my caller ID pops up just fine (unless my SIP provider overrides it - for instance, I have a called ID from an Ohio cellphone in the US through Future Nine). So I think it depends on your provider.jvwelzen wrote: Do you have an idea why callerid is not always working
When I dial direct to a sip uri it isn't send also when I call with a EnumLookup it isn't send
Hi Myatus,
the way you handle URI calls is not completely correct, for two reasons:
1. You can't call a local user (e.g. 'myatus@sip.mysipswitch.com') and
2. Code won't work if domain is specified as 213.200.94.182 instead of sip.mysipswitch.com.
Here is my solution of these issues:
The code is a bit choppy because "Domains.include?(host)" trigger false alarm ("include statement in dialplan") but I hope this will be fixed in the future release of MSS. In the meantime I used 'find" as a workaround.
It's possible to call local users (use sip:myatus@local instead of sip:myatus@sip.mysipswitch.com) and the code is able to service several domains. Of course, it takes a bit more of editing during dialplan configuration, but every coin has two sides (that's what a man said when his mother-in-law died and he had to pay for the funeral)
the way you handle URI calls is not completely correct, for two reasons:
1. You can't call a local user (e.g. 'myatus@sip.mysipswitch.com') and
2. Code won't work if domain is specified as 213.200.94.182 instead of sip.mysipswitch.com.
Here is my solution of these issues:
Code: Select all
MyDomain = 'sip.mysipswitch.com'
Domains = [MyDomain,'213.200.94.182'] # Serviced domains, must be in lowercase!
...
# check if it's URI or phone number.
# If destination's host is in our domain, it's a phone call
num = req.URI.User.to_s; host = req.URI.Host.to_s.downcase
if host == 'local' # @local is special, callee is in our domain
num << '@' << MyDomain
else
num << '@' << host unless Domains.find {|x| x == host}
end
callswitch(num)
It's possible to call local users (use sip:myatus@local instead of sip:myatus@sip.mysipswitch.com) and the code is able to service several domains. Of course, it takes a bit more of editing during dialplan configuration, but every coin has two sides (that's what a man said when his mother-in-law died and he had to pay for the funeral)
Hi Mike,MikeTelis wrote:2. Code won't work if domain is specified as 213.200.94.182 instead of sip.mysipswitch.com.
As far as the mss server is concerned all the Dial strings below are equivalent and will result in the call being forwarded to a lcoal user with no additional dialplan processing required.
sys.Dial("user@local")
sys.Dial("user@sip.mysipswitch.com")
sys.Dial("user@213.200.94.182")
sys.Dial("user@213.200.94.182:5060")
sys.Dial("user@213.200.94.182:xxxx") where xxxx are the other ports that mss operates on and that I can't recall off the top of my head.
Regards,
Aaron
Hi Aaron,
probably we're talking about different things. Yes, incoming calls are processed as you described and invoke user's dialplan with sys.In == true.
I was talking about outbound calls. My softphone, Bria, would dial:
'number@sip.mysipswitch.com' or 'number@213.200.94.182 when I ask it to dial a phone number
URI, such as 'xxxxxx@us.voxalot.com', when I call a softphone
URI also maybe in form 'user@local'.
Within the dialplan, we need to distinguish between outbound phone call, call to URI and call to local user (user@sip.mysipswitch.com). We do it by checking the "host" portion of URI passed to dialplan.
Mike
probably we're talking about different things. Yes, incoming calls are processed as you described and invoke user's dialplan with sys.In == true.
I was talking about outbound calls. My softphone, Bria, would dial:
'number@sip.mysipswitch.com' or 'number@213.200.94.182 when I ask it to dial a phone number
URI, such as 'xxxxxx@us.voxalot.com', when I call a softphone
URI also maybe in form 'user@local'.
Within the dialplan, we need to distinguish between outbound phone call, call to URI and call to local user (user@sip.mysipswitch.com). We do it by checking the "host" portion of URI passed to dialplan.
Mike
Hi Mike
Yeah, I only check what the authorized user's hostname is and base on that I figure out if it's a regular phone call or URI call. But as you mentioned, it doesn't check against the IP or if it was really an MSS-to-MSS call.
At first I thought I'd simply dial the full "user@sip.mysipswitch.com", and let MSS figure out if its a local user or (if that user doesn't exist on MSS) a phone number.
But if someone at MSS uses all digits for the username (like me), then this user might be called by mistake if it happens to correspond with an actual phone number... What if I'd dial 5551212 and there's a user 5551212@sip.mysipswitch.com?
So yes, I think that your @local solution would be the best option
Thanks for the heads up and the code snippet!
Yeah, I only check what the authorized user's hostname is and base on that I figure out if it's a regular phone call or URI call. But as you mentioned, it doesn't check against the IP or if it was really an MSS-to-MSS call.
At first I thought I'd simply dial the full "user@sip.mysipswitch.com", and let MSS figure out if its a local user or (if that user doesn't exist on MSS) a phone number.
But if someone at MSS uses all digits for the username (like me), then this user might be called by mistake if it happens to correspond with an actual phone number... What if I'd dial 5551212 and there's a user 5551212@sip.mysipswitch.com?
So yes, I think that your @local solution would be the best option
Yeah, that's why I'm using the find as well. It wouldn't let me do it otherwise. A bit slower, but it works...The code is a bit choppy because "Domains.include?(host)" trigger false alarm ("include statement in dialplan") but I hope this will be fixed in the future release of MSS. In the meantime I used 'find" as a workaround.
LOL! That's a new one to me.but every coin has two sides (that's what a man said when his mother-in-law died and he had to pay for the funeral)
Thanks for the heads up and the code snippet!
Mike,
the probability of running into "all digits" user name @MSS is very high. I guess many people are using MSS provisioning and extension numbers are all digit. I'm not following that thread (waiting until it's finalized) but it seems that now extension numbers are 10-digit, not 8-digit and it corresponds to 10-digit US numbers.
So, '@local' was the only feasible option.
Checking on IP address is also mandatory. For example, PocketPC version of SJPhone doesn't work unless I put real IP address (not sip.mysipswitch.com) in its proxy profile.
Mike
the probability of running into "all digits" user name @MSS is very high. I guess many people are using MSS provisioning and extension numbers are all digit. I'm not following that thread (waiting until it's finalized) but it seems that now extension numbers are 10-digit, not 8-digit and it corresponds to 10-digit US numbers.
So, '@local' was the only feasible option.
Checking on IP address is also mandatory. For example, PocketPC version of SJPhone doesn't work unless I put real IP address (not sip.mysipswitch.com) in its proxy profile.
Mike
When an extension/SIP accoun is provisioned there is a check done to make sure there is no extension/SIP account with the same name. Both extensions and SIP usernames will be unique for each mss domain. The same username or extension could be used in different domains though.MikeTelis wrote:Mike,
the probability of running into "all digits" user name @MSS is very high. I guess many people are using MSS provisioning and extension numbers are all digit. I'm not following that thread (waiting until it's finalized) but it seems that now extension numbers are 10-digit, not 8-digit and it corresponds to 10-digit US numbers.
Regards,
Aaron
Hi Aaron,
it seems that all these complicated issues with ACK, doubled "outgoing call", Ruby's pop-up windows and betamax refund had a negative impact on your ability to understand simple things we're talking about here
Let me try to translate. We want to place both regular phone calls and URI calls. What happens if someone dials
1 212 555 1212
on a SIP telephone connected to MSS? Ruby dialplan is called with URI
12125551212@sip.mysipswitch.com
Now, what if I want to call a MSS user who has MSS username '12125551212' ? The dialplan will be called with exactly the same URI.
Now, we need to distinguish between calls to a telephone and to a local user. I suggested that we do it by using URIs in form:
12125551212@local
The dialplan will check on the "host" portion of URI and, if it's "local", place URI call to local domain.
Hope that everything's clear now.
Sincerely,
Mike
it seems that all these complicated issues with ACK, doubled "outgoing call", Ruby's pop-up windows and betamax refund had a negative impact on your ability to understand simple things we're talking about here
Let me try to translate. We want to place both regular phone calls and URI calls. What happens if someone dials
1 212 555 1212
on a SIP telephone connected to MSS? Ruby dialplan is called with URI
12125551212@sip.mysipswitch.com
Now, what if I want to call a MSS user who has MSS username '12125551212' ? The dialplan will be called with exactly the same URI.
Now, we need to distinguish between calls to a telephone and to a local user. I suggested that we do it by using URIs in form:
12125551212@local
The dialplan will check on the "host" portion of URI and, if it's "local", place URI call to local domain.
Hope that everything's clear now.
Sincerely,
Mike