Extension caller ID

Getting started with the SIP Sorcery
Post Reply
florinfr
Posts: 11
Joined: Thu Jun 27, 2013 8:39 am

Extension caller ID

Post by florinfr » Thu Jun 27, 2013 8:48 am

I have 4 SIP accounts defined under my SS account called:
ext100
ext200
ext300
ext400

Is it possible to set the caller ID for calls between those accounts only to the numeric part?
Example:
Call from ext100 to ext200, ext200 gets CID 100.
Call from ext200 to ext400, ext400 gets CID 200.

Thank you.

PS: I'm new to sipsorcery so maybe I got things wrong.

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: Extension caller ID

Post by Aaron » Thu Jun 27, 2013 9:45 am

Try something like this:

Code: Select all

callerID = req.Header.From.FromURI.User[3..5]
sys.Log("callerID=#{callerID}.")

case req.URI.User
  when "100" then sys.Dial("ext100@local[fd=#{callerID}]")
  when "200" then sys.Dial("ext200@local[fd=#{callerID}]")
  when "300" then sys.Dial("ext300@local[fd=#{callerID}]")
  when "400" then sys.Dial("ext400@local[fd=#{callerID}]")
end

florinfr
Posts: 11
Joined: Thu Jun 27, 2013 8:39 am

Re: Extension caller ID

Post by florinfr » Thu Jun 27, 2013 10:12 am

Hi Aaron,

Thank you for your quick reply. I tried using fd with no luck.
Using fu solved the problem. The code is shown below for ext200 dial plan.

Code: Select all

  when "100" then sys.Dial("ext100@local[fu=200]") 
F

Post Reply