internal call between sipsorcery subaccounts

Getting started with the SIP Sorcery
ito
Posts: 3
Joined: Sat Jul 25, 2009 8:29 pm

internal call between sipsorcery subaccounts

Post by ito » Fri Mar 05, 2010 11:20 pm

Hello,

I have one sip provider/did configured.
Several sip accounts ( subaccounts ) with phones attached.
When I call to my did every phone rings, this works perfect.

I tried to make a shortcut to one certain local subaccount I have.
like this: when '200' then sys.Dial("123@local")
But when I call 200 all my phones ring not only 123@local

I know this is because all of my sipaccount use the same incoming dialplan What is ringing all of my phones.

But how to create a simple dialplan what also would allow these internal calls?

any hint appreciated ...

Thanks in advance
Joost

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Sat Mar 06, 2010 6:45 am

please post your dialplan so we can see what you did

Maybe an idea from my site

In your Dialplan Replace 123 with #{req.URI.User}

ito
Posts: 3
Joined: Sat Jul 25, 2009 8:29 pm

Post by ito » Sat Mar 06, 2010 12:42 pm

for incoming dialplan I have

Code: Select all

sys.Dial("123@local&456@local&789@local",60)   # ring your phone for 60 seconds
sys.Respond(480, "(#{sys.Username}) Not Available") # response if not answered.
Outgoing

Code: Select all

sys.SetFromHeader("joost", nil, nil)

case req.URI.User
    when '200' then sys.Dial("123@local")
end

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Sat Mar 06, 2010 1:29 pm

I don't think you can have both

if you make a dialplan like this

Code: Select all

sys.Dial("123@local&456@local&789@local",60)   # ring your phone for 60 seconds 
sys.Respond(480, "(#{sys.Username}) Not Available") # response if not answered.
Then all your phones will ring

If you only want to ring 1 phone

you must do something like this

Code: Select all

sys.Dial("123@local",60)   # ring your phone for 60 seconds 
sys.Respond(480, "(#{sys.Username}) Not Available") # response if not answered.
You could make a primary account with an in dialplan attached

Code: Select all

sys.Dial("123@local&456@local&789@local",60)   # ring your phone for 60 seconds 
sys.Respond(480, "(#{sys.Username}) Not Available") # response if not answered.
and 2 subaccounts with no dialplan attached

mnipp
Posts: 192
Joined: Sat Oct 03, 2009 9:48 am
Location: NSW Australia

Post by mnipp » Sat Mar 06, 2010 1:32 pm

Code: Select all

sys.Dial("123@local&456@local&789@local",60)
This line rings all three phones no matter which phone is called because they share the same dialplan.

maybe this will be the answer as a shared incoming dialplan were a call from outside rings all three phones and a call from another sipsorcery account rings only the phone called.

inplan

Code: Select all

if req.Header.From.FromURI.host.to_s == "sipsorcery.com"
     sys.Dial("#{req.URI.User}@local",60) # ring the phone called.
else
     sys.Dial("123@local&456@local&789@local",60) # ring all three
end
billion 7404VGP
dialplan (<9*:*>[0-9*][0-9*].T<:@sipbroker>|[0-9*].T)

ito
Posts: 3
Joined: Sat Jul 25, 2009 8:29 pm

Post by ito » Sat Mar 06, 2010 6:18 pm

Thanks for all the tips.
mnipp: your code example was exact what I was looking for

All works perfect now.

beaver
Posts: 241
Joined: Tue Feb 09, 2010 5:32 am
Location: Beaverton USA (PST, GMT - 8)

Re: internal call between sipsorcery subaccounts

Post by beaver » Tue May 18, 2010 2:41 am

Added my note. If you use number "12345" instead of char "abcde" as your sub-account name, you can dial it directly (voxlaot has a similar feature). I remember someone at the forums mentioned this point (possibly by mnipp :roll: ).
Anyway, my primary account is still using complex char because when I created my account I didn't know this. I created sub-account all in this way "98765". and "98765" can dial another sub "43210" directly. cannot be easier. :lol:

Aaron doesn't allow less than than 5-digital as account name. "12", "89" could NOT be used as sub-account name. but for speed-dial is still ok. that' what I did for dialing among primary accounts.

AviMarcus
Posts: 153
Joined: Sun May 16, 2010 7:07 am

Re: internal call between sipsorcery subaccounts

Post by AviMarcus » Fri May 21, 2010 2:46 pm

Of course, you can also set up speed dials..

Code: Select all

case req.URI.User
  when /^6$/ then sys.Dial("xx@local")
  end
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.

davidnewton
Posts: 179
Joined: Thu Aug 27, 2009 3:00 am

Re: internal call between sipsorcery subaccounts

Post by davidnewton » Thu May 27, 2010 2:53 pm

beaver wrote:Added my note. If you use number "12345" instead of char "abcde" as your sub-account name, you can dial it directly (voxlaot has a similar feature). I remember someone at the forums mentioned this point (possibly by mnipp :roll: ).
Anyway, my primary account is still using complex char because when I created my account I didn't know this. I created sub-account all in this way "98765". and "98765" can dial another sub "43210" directly. cannot be easier. :lol:

Aaron doesn't allow less than than 5-digital as account name. "12", "89" could NOT be used as sub-account name. but for speed-dial is still ok. that' what I did for dialing among primary accounts.
Thanks for sharing this information. As for the 5-digit dialing, do you mean you can do it without dialplan, or still need dialplan to dial the subaccount? Thanks.

beaver
Posts: 241
Joined: Tue Feb 09, 2010 5:32 am
Location: Beaverton USA (PST, GMT - 8)

Re: internal call between sipsorcery subaccounts

Post by beaver » Thu May 27, 2010 10:21 pm

Add this line in dial-out plan. it works for me. I take my zip-code as my account number (easy to remember).
when /^\d{5}$/ then sys.Dial("${dst}@local")

I didn't use 7-dig, standard USA dial number in some areas. 6-dig has been used by voxalot. 5-dig is my only choice. As said, I use 2-dig speed-dial for
'99' => 'client1@local',
'98' => 'client2@local',
...
primary member call (some of them already use digits as account name). I really wish I cut my long speed-dial table.

Post Reply