how to config a specific DID to ring a specifi sipsorcery us

Catalog of dial plans
Post Reply
qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

how to config a specific DID to ring a specifi sipsorcery us

Post by qubo » Tue Sep 13, 2011 3:08 pm

I have several DIDs that arrive to my device inquss@sipsorcery.com

what I want is that a specific DID call use another specific user in sipsorcery instead of the General inquss@sipsorcery.com how I can achieve this ?

this is the DID i want to config with a specific user@sipsorcery.com so when gvsm is detected then it ring myotheruser@sipsorcery.com
case @trunk.to_s.downcase
when 'gvny', 'gvsm' # called at Google Voice DID
@cid = ('1' + @cid) if @cid =~ /^[2-9]\d\d[2-9]\d{6}$/ # Prepend 10-digit numbers with "1" (US country code)
my general default incoming calls are
# ******************** i n c o m i n g C a l l *************************

def incomingCall
sys.SetFromHeader(formatNum(@cname || @cid,true), nil, Host) # Set FromName & FromHost for sys.Dial

# Forward call to the bindings (ATA / softphone)
# Change FromURI when forwarding to @local, or else Bria won't find contact in its phonebook!

WhiteList = [
'10311702',
'15920766',
'38240083',
'10319999',
'36420040',
'38130134',
'10312255',
'31221070',
]

if !((100..700) === @t.hour*100 + @t.min) or WhiteList.map {|n| to_ENUM(n)}.include?(@cid)
callswitch("#{@user}@local&1777249xxxx@in.callcentric.com[dt=20][fu=#{@cid}]",45)
else
callswitch("1777249xxxx@in.callcentric.com[fu=#{@cid}]",45)
end

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: how to config a specific DID to ring a specifi sipsorcer

Post by MikeTelis » Fri Sep 23, 2011 2:18 pm

The other instance variable, @trunk, contains trunk name. Make sure that all your DIDs are forwarding calls to trunkname.incuss@sipsorcery.com (where trunkname is unique for each DID). Then you need to forward the call depending on @trunk, like this:

Code: Select all

case @trunk
  when "Trunk1" 
     callswitch("sipaccount1@sipsorcery.com")
  when "Trunk2" 
     callswitch("sipaccount2@sipsorcery.com")
  else
     callswitch("inquss@sipsorcery.com")
end

qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

Re: how to config a specific DID to ring a specifi sipsorcer

Post by qubo » Sat Sep 24, 2011 10:37 pm

thanks a lot i will try it

Post Reply