Search found 1582 matches

by MikeTelis
Thu Dec 15, 2011 5:25 pm
Forum: Use Cases
Topic: CNAM lookup alternative
Replies: 3
Views: 2884

Re: CNAM lookup alternative

Code: Select all

    if !(@cname = keys_to_ENUM(CNAM)[@cid]) && @cid =~ /^1([2-9]\d\d[2-9]\d{6})$/ && defined?(CNAM_key)
       url = "http://cnam.calleridservice.com/query?u=#{CNAM_User}&k=#{CNAM_Key}&t=html&n=#{$1}"
       @cname = sys.WebGet(url,4).to_s
    end
Haven't tried it, just a thought ;-)
by MikeTelis
Thu Dec 15, 2011 3:45 pm
Forum: Use Cases
Topic: CNAM lookup alternative
Replies: 3
Views: 2884

Re: CNAM lookup alternative

If you're referring to my Flexible dialplan Ver. 2, try: if !(@cname = keys_to_ENUM(CNAM)[@cid]) && @cid =~ /^1([2-9]\d\d[2-9]\d{6})$/ && defined?(WP_key) url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Fapi.whitepages.com%2Freverse_phone%2F1.0%...
by MikeTelis
Sat Dec 10, 2011 8:18 pm
Forum: Technical Support
Topic: Incomming goes wrong :(
Replies: 3
Views: 791

Re: Incomming goes wrong :(

Key word is "Register contact". When you add a new SIP provider, register contact is set to yourlogin@sipsorcery.com. Yourlogin is one of your SIP accounts (let's call it the main SIP account). All you need to do is change register contact so that it will point to your other SIP accounts. So, you ne...
by MikeTelis
Tue Dec 06, 2011 1:10 pm
Forum: Getting Started
Topic: Incoming Dial Plan
Replies: 10
Views: 5188

Re: Incoming Dial Plan

While it's logical to implement CID change depending on trunk (Service 1,2,3) it might be easier to do it based on 44 prefix and total length of CID string. Something like this: if sys.In # If incoming call... @cid = req.Header.from.FromURI.User.to_s # Get caller ID @cid = ('0' + $1) if @cid =~ /^44...
by MikeTelis
Mon Dec 05, 2011 6:57 am
Forum: Use Cases
Topic: Caller's name lookup
Replies: 95
Views: 40227

Re: Caller's name lookup

jeffdoubleyou wrote:By the way, this required a change on our end to get this working properly. It seems the Sys.WebGet is pretty strict about the data returned from the URL call.
As far as I understand, you added &t=html parameter, is that correct?
by MikeTelis
Tue Nov 22, 2011 6:32 am
Forum: Use Cases
Topic: Caller's name lookup
Replies: 95
Views: 40227

Re: Caller's name lookup

You're not getting anything because @cid is unassigned. This instance variable is supposed to receive Caller ID (caller's number), like it's done in my Flexible dialplan, Ver. 2. Something like this: @cid = req.Header.from.FromURI.User.to_s # Get caller ID Please refer to the dialplan code . The abo...
by MikeTelis
Sat Nov 19, 2011 6:08 pm
Forum: Use Cases
Topic: Caller's name lookup
Replies: 95
Views: 40227

Re: Caller's name lookup

You're trying to substitute #{name} in the url string and it fails since the 'name' is not defined in your script. I believe that the URL was correct but you changed url definition in my original script; that's why it failed. So, let's go back and change url string to: url = "http://cnam.calleridser...
by MikeTelis
Fri Nov 18, 2011 5:50 am
Forum: Technical Support
Topic: Conditionals based on SIP account
Replies: 2
Views: 723

Re: Conditionals based on SIP account

You can borrow from this chunk of my code: prs = req.URI.User.split('.') # parse User into chunks @trunk = prs[-2] # get trunk name @user = prs[-1] # called user name @user gets the name of SIP account, @trunk - prefix (if any). For example, if a call is to did1.acnt@sipsorcery.com, @user will get '...
by MikeTelis
Thu Nov 17, 2011 12:37 pm
Forum: Technical Support
Topic: Set Time in Dial Plan
Replies: 8
Views: 3825

Re: Set Time in Dial Plan

Thank you in advance! Don't forget to whistle when it's ready.
by MikeTelis
Thu Nov 17, 2011 3:37 am
Forum: Technical Support
Topic: Set Time in Dial Plan
Replies: 8
Views: 3825

Re: Set Time in Dial Plan

I believe (Time.now) in MikeTelis plan will follow US daylight saving time. That's correct, I deliberately made it follow DST. That was a temporary solution which (as it often happens) lived for years. (Aaron promised a sys.* function which would return local time, depending on a user profile setti...