Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Asterisk Inbound calls, multiple SIP accounts, calledID


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
andrew.galdes at agix....
Guest





PostPosted: Wed Apr 01, 2015 6:50 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew
Back to top
johnkiniston at gmail.com
Guest





PostPosted: Wed Apr 01, 2015 7:23 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

Can you show us the CDR record for that call?


And maybe what your s priority of your incoming context is?


It should be easy to get what number was dialed, Try:

${CUT(PASSTHRU(${SIP_HEADER(TO):5}),@,1)}


Normally I display the callers number on my phones, Not the number they dialed?


On Wed, Apr 1, 2015 at 4:50 PM, Andrew Galdes <andrew.galdes@agix.com.au (andrew.galdes@agix.com.au)> wrote:
Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew







--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein
Back to top
andres at telesip.net
Guest





PostPosted: Wed Apr 01, 2015 8:00 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

On 4/1/15 7:50 PM, Andrew Galdes wrote:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 



It looks like all incoming calls are all being matched against the same entry in sip.conf.   A 'set set debug on' should clearly indicate this.  Look for the line that says :  Found peer '<insert peer name here' for '0811111111'
Quote:
So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew








--
Technical Support
http://www.cellroute.net
Back to top
serov.d.p at gmail.com
Guest





PostPosted: Thu Apr 02, 2015 12:17 am    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

This is one of the chronic problems. Try this option in sip.conf:
match_auth_username=yes

Carefully read the description, it is better to test in "after hours".

02.04.2015 2:50, Andrew Galdes пишет:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew








Back to top
andrew.galdes at agix....
Guest





PostPosted: Tue Apr 07, 2015 6:48 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

Hi Dmitriy and others and thanks for your help so far.


The option "match_auth_username=yes" seems to have had no effect. From my reading, this option will try to match the username of the incoming SIP account to a section heading. If that is how it must work then i can see a big problem. I'm trying to present the receptionist with a nice display of which line the call came in on. For example, the receptionist answers calls for 8 different companies and would like the phone to display the company name that she should announce to the caller. 


Here is a more complete output of an incoming call. I've changed the SIP numbers to "Company1', etc, to hide the numbers. 


Quote:
Connected to Asterisk 10.12.4 currently running on asterisk (pid = 32267)
Verbosity is at least 12
asterisk*CLI> 
asterisk*CLI> 
asterisk*CLI> 
  == Using SIP RTP CoS mark 5
    -- Executing [s@incoming:1] Set("SIP/Company1-00000797", "thedid=""NodePhone"<sip:Company2@sip.internode.on.net ([email]sip%3ACompany2@sip.internode.on.net[/email])>"") in new stack
    -- Executing [s@incoming:2] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2@sip.internode.on.net>") in new stack
    -- Executing [s@incoming:3] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2") in new stack
    -- Executing [s@incoming:4] Set("SIP/Company1-00000797", "pseudodid= sip:Company2") in new stack
    -- Executing [s@incoming:5] GotoIf("SIP/Company1-00000797", "0?internal,33,1:6") in new stack
    -- Goto (incoming,s,6)
    -- Executing [s@incoming:6] GotoIf("SIP/Company1-00000797", "0?internal,88,1:7") in new stack
    -- Goto (incoming,s,7)
    -- Executing [s@incoming:7] GotoIf("SIP/Company1-00000797", "0?internal,36,1:8") in new stack
    -- Goto (incoming,s,Cool
    -- Executing [s@incoming:8] GotoIf("SIP/Company1-00000797", "1?internal,36,1:9") in new stack
    -- Goto (internal,36,1)
    -- Executing [36@internal:1] Set("SIP/Company1-00000797", "CALLERID(name)=SIP/Company1-00000797") in new stack
    -- Executing [36@internal:2] Dial("SIP/Company1-00000797", "SIP/36,20") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/36
    -- SIP/36-00000798 is ringing
  == Spawn extension (internal, 36, 2) exited non-zero on 'SIP/Company1-00000797'
asterisk*CLI> exit



And here is the "sip.conf":


Quote:
[general]
match_auth_username=yes
register=081...:...@sip.internode.on.net/s
register=082...:...@sip.internode.on.net/s
register=083...:...@sip.internode.on.net:/s
register=084...:...@sip.internode.on.net:/s
register=085...:...@sip.internode.on.net/s
register=086...:...@sip.internode.on.net/s
register=087...:...@sip.internode.on.net/s
register=088...:...@sip.internode.on.net/s

[Company1]
username=081...
fromuser=081...
secret=...
canreinvite=no
qualify=yes
context=incoming
type=friend
insecure=invite,port
fromdomain=sip.internode.on.net
host=sip.internode.on.net
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
allow=g729
bindport=5060
bindaddr=0.0.0.0
nat=yes
registertimeout=5
allowoverlap=no
srvlookup=no
ubscribecontext=from-sip
callcounter=yes [Company2]
...
[Company3]
...
[Company4]
...





And here is some of the "extensions.conf" file:


Quote:
[incoming]
; Get the DID number from the TO header.
exten => s,1,Set(thedid="${SIP_HEADER(TO)}")
exten => s,2,Set(pseudodid=${SIP_HEADER(To)})
exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})
; Direct the DID accordingly.
exten => s,5,GotoIf($["${pseudodid}" = "081"]?internal,33,1:6)
exten => s,6,GotoIf($["${pseudodid}" = "082"]?internal,88,1:7) 
exten => s,7,GotoIf($["${pseudodid}" = "083"]?internal,36,1:Cool
exten => s,8,GotoIf($["${pseudodid}" = "084"]?internal,36,1:9)
exten => s,9,GotoIf($["${pseudodid}" = "085"]?internal,36,1:10)
exten => s,10,GotoIf($["${pseudodid}" = "086"]?internal,89,1:11)
exten => s,11,GotoIf($["${pseudodid}" = "087"]?internal,36,1:12)
exten => s,12,GotoIf($["${pseudodid}" = "088"]?internal,13,1:13)











-Andrew Galdes







On Thu, Apr 2, 2015 at 3:46 PM, Dmitriy Serov <serov.d.p@gmail.com (serov.d.p@gmail.com)> wrote:
Quote:

This is one of the chronic problems. Try this option in sip.conf:
match_auth_username=yes

Carefully read the description, it is better to test in "after hours".

02.04.2015 2:50, Andrew Galdes пишет:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew











--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
andrew.galdes at agix....
Guest





PostPosted: Tue Apr 07, 2015 8:06 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

Solved it, kinda. It's not cute. I'm sure this is the way NOT to do it but it does work. For prosperity, the SIP service is through Internode. 


Here is my "extensions.conf" file:

exten => s,1,Set(thedid="${SIP_HEADER(TO)}"); ignore this one
exten => s,2,Set(pseudodid=${SIP_HEADER(To)})
exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})

exten => s,5,Set(callersname=${IF($[ ${pseudodid} = 081...]?Company1:${callersname})})
exten => s,6,Set(callersname=${IF($[ ${pseudodid} = 082...]?Company2:${callersname})})
exten => s,7,Set(callersname=${IF($[ ${pseudodid} = 083...]?Company3:${callersname})})
exten => s,8,Set(callersname=${IF($[ ${pseudodid} = 084...]?Company4:${callersname})})
exten => s,9,Set(callersname=${IF($[ ${pseudodid} = 085...]?Company5:${callersname})})
exten => s,10,Set(callersname=${IF($[ ${pseudodid} = 086...]?Company6:${callersname})})
exten => s,11,Set(callersname=${IF($[ ${pseudodid} = 087...]?Company7:${callersname})})
exten => s,12,Set(callersname=${IF($[ ${pseudodid} = 088...]?Company8:${callersname})})


exten => s,13,GotoIf($["${callersname}" = "Company1"]?internal,36,1:14); to reception
exten => s,14,GotoIf($["${callersname}" = "Company2"]?internal,88,1:15); to department1
exten => s,15,GotoIf($["${callersname}" = "Company3"]?internal,36,1:16); to reception
exten => s,16,GotoIf($["${callersname}" = "Company4"]?internal,36,1:17); to reception
exten => s,17,GotoIf($["${callersname}" = "Company5"]?internal,36,1:1Cool; to reception
exten => s,18,GotoIf($["${callersname}" = "Company6"]?internal,89,1:19); to department2
exten => s,19,GotoIf($["${callersname}" = "Company7"]?internal,36,1:20); to reception
exten => s,20,GotoIf($["${callersname}" = "Company8"]?internal,13,1:21); to department3

And later in same file:


Quote:
; Phone 36 reception
exten => 36,1,Set(CALLERID(name)=${callersname})
exten => 36,n,Dial(SIP/36,20)
exten => 36,n,VoiceMail(36,u)
exten => 36,n,Hangup
 
Ta,



-Andrew Galdes
Managing Director

RHCE, LPI, CCENT

AGIX Linux

Ph: 08 7324 4429
Mb: 0422 927 598

Find us: Website | LinkedIn | Blog | YouTube | Google+




Platform Architects for High Demand Web Applications.







On Wed, Apr 8, 2015 at 9:18 AM, Andrew Galdes <andrew.galdes@agix.com.au (andrew.galdes@agix.com.au)> wrote:
Quote:
Hi Dmitriy and others and thanks for your help so far.


The option "match_auth_username=yes" seems to have had no effect. From my reading, this option will try to match the username of the incoming SIP account to a section heading. If that is how it must work then i can see a big problem. I'm trying to present the receptionist with a nice display of which line the call came in on. For example, the receptionist answers calls for 8 different companies and would like the phone to display the company name that she should announce to the caller. 


Here is a more complete output of an incoming call. I've changed the SIP numbers to "Company1', etc, to hide the numbers. 


Quote:
Connected to Asterisk 10.12.4 currently running on asterisk (pid = 32267)
Verbosity is at least 12
asterisk*CLI> 
asterisk*CLI> 
asterisk*CLI> 
  == Using SIP RTP CoS mark 5
    -- Executing [s@incoming:1] Set("SIP/Company1-00000797", "thedid=""NodePhone"<sip:Company2@sip.internode.on.net ([email]sip%3ACompany2@sip.internode.on.net[/email])>"") in new stack
    -- Executing [s@incoming:2] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2@sip.internode.on.net>") in new stack
    -- Executing [s@incoming:3] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2") in new stack
    -- Executing [s@incoming:4] Set("SIP/Company1-00000797", "pseudodid= sip:Company2") in new stack
    -- Executing [s@incoming:5] GotoIf("SIP/Company1-00000797", "0?internal,33,1:6") in new stack
    -- Goto (incoming,s,6)
    -- Executing [s@incoming:6] GotoIf("SIP/Company1-00000797", "0?internal,88,1:7") in new stack
    -- Goto (incoming,s,7)
    -- Executing [s@incoming:7] GotoIf("SIP/Company1-00000797", "0?internal,36,1:8") in new stack
    -- Goto (incoming,s,Cool
    -- Executing [s@incoming:8] GotoIf("SIP/Company1-00000797", "1?internal,36,1:9") in new stack
    -- Goto (internal,36,1)
    -- Executing [36@internal:1] Set("SIP/Company1-00000797", "CALLERID(name)=SIP/Company1-00000797") in new stack
    -- Executing [36@internal:2] Dial("SIP/Company1-00000797", "SIP/36,20") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/36
    -- SIP/36-00000798 is ringing
  == Spawn extension (internal, 36, 2) exited non-zero on 'SIP/Company1-00000797'
asterisk*CLI> exit



And here is the "sip.conf":


Quote:
[general]
match_auth_username=yes
register=081...:...@sip.internode.on.net/s
register=082...:...@sip.internode.on.net/s
register=083...:...@sip.internode.on.net:/s
register=084...:...@sip.internode.on.net:/s
register=085...:...@sip.internode.on.net/s
register=086...:...@sip.internode.on.net/s
register=087...:...@sip.internode.on.net/s
register=088...:...@sip.internode.on.net/s

[Company1]
username=081...
fromuser=081...
secret=...
canreinvite=no
qualify=yes
context=incoming
type=friend
insecure=invite,port
fromdomain=sip.internode.on.net
host=sip.internode.on.net
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
allow=g729
bindport=5060
bindaddr=0.0.0.0
nat=yes
registertimeout=5
allowoverlap=no
srvlookup=no
ubscribecontext=from-sip
callcounter=yes [Company2]
...
[Company3]
...
[Company4]
...





And here is some of the "extensions.conf" file:


Quote:
[incoming]
; Get the DID number from the TO header.
exten => s,1,Set(thedid="${SIP_HEADER(TO)}")
exten => s,2,Set(pseudodid=${SIP_HEADER(To)})
exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})
; Direct the DID accordingly.
exten => s,5,GotoIf($["${pseudodid}" = "081"]?internal,33,1:6)
exten => s,6,GotoIf($["${pseudodid}" = "082"]?internal,88,1:7) 
exten => s,7,GotoIf($["${pseudodid}" = "083"]?internal,36,1:Cool
exten => s,8,GotoIf($["${pseudodid}" = "084"]?internal,36,1:9)
exten => s,9,GotoIf($["${pseudodid}" = "085"]?internal,36,1:10)
exten => s,10,GotoIf($["${pseudodid}" = "086"]?internal,89,1:11)
exten => s,11,GotoIf($["${pseudodid}" = "087"]?internal,36,1:12)
exten => s,12,GotoIf($["${pseudodid}" = "088"]?internal,13,1:13)











-Andrew Galdes







On Thu, Apr 2, 2015 at 3:46 PM, Dmitriy Serov <serov.d.p@gmail.com (serov.d.p@gmail.com)> wrote:
Quote:

This is one of the chronic problems. Try this option in sip.conf:
match_auth_username=yes

Carefully read the description, it is better to test in "after hours".

02.04.2015 2:50, Andrew Galdes пишет:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew











--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




Back to top
andres at telesip.net
Guest





PostPosted: Tue Apr 07, 2015 9:35 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

On 4/7/15 7:48 PM, Andrew Galdes wrote:

Quote:
Hi Dmitriy and others and thanks for your help so far.


The option "match_auth_username=yes" seems to have had no effect. From my reading, this option will try to match the username of the incoming SIP account to a section heading. If that is how it must work then i can see a big problem. I'm trying to present the receptionist with a nice display of which line the call came in on. For example, the receptionist answers calls for 8 different companies and would like the phone to display the company name that she should announce to the caller. 


Here is a more complete output of an incoming call. I've changed the SIP numbers to "Company1', etc, to hide the numbers. 


Quote:
Connected to Asterisk 10.12.4 currently running on asterisk (pid = 32267)
Verbosity is at least 12
asterisk*CLI> 
asterisk*CLI> 
asterisk*CLI> 
  == Using SIP RTP CoS mark 5
    -- Executing [s@incoming:1] Set("SIP/Company1-00000797", "thedid=""NodePhone"<sip:Company2@sip.internode.on.net ([email]sip%3ACompany2@sip.internode.on.net[/email])>"") in new stack
    -- Executing [s@incoming:2] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2@sip.internode.on.net>") in new stack
    -- Executing [s@incoming:3] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2") in new stack
    -- Executing [s@incoming:4] Set("SIP/Company1-00000797", "pseudodid= sip:Company2") in new stack
    -- Executing [s@incoming:5] GotoIf("SIP/Company1-00000797", "0?internal,33,1:6") in new stack
    -- Goto (incoming,s,6)
    -- Executing [s@incoming:6] GotoIf("SIP/Company1-00000797", "0?internal,88,1:7") in new stack
    -- Goto (incoming,s,7)
    -- Executing [s@incoming:7] GotoIf("SIP/Company1-00000797", "0?internal,36,1:8") in new stack
    -- Goto (incoming,s,Cool
    -- Executing [s@incoming:8] GotoIf("SIP/Company1-00000797", "1?internal,36,1:9") in new stack
    -- Goto (internal,36,1)
    -- Executing [36@internal:1] Set("SIP/Company1-00000797", "CALLERID(name)=SIP/Company1-00000797") in new stack
    -- Executing [36@internal:2] Dial("SIP/Company1-00000797", "SIP/36,20") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/36
    -- SIP/36-00000798 is ringing
  == Spawn extension (internal, 36, 2) exited non-zero on 'SIP/Company1-00000797'
asterisk*CLI> exit



And here is the "sip.conf":


Quote:
[general]
match_auth_username=yes
register=081...:...@sip.internode.on.net/s
register=082...:...@sip.internode.on.net/s
register=083...:...@sip.internode.on.net:/s ([email]register=083...:...@sip.internode.on.net:/s[/email])
register=084...:...@sip.internode.on.net:/s ([email]register=084...:...@sip.internode.on.net:/s[/email])
register=085...:...@sip.internode.on.net/s
register=086...:...@sip.internode.on.net/s
register=087...:...@sip.internode.on.net/s
register=088...:...@sip.internode.on.net/s

[Company1]
username=081...
fromuser=081...
secret=...
canreinvite=no
qualify=yes
context=incoming
type=friend
insecure=invite,port
fromdomain=sip.internode.on.net
host=sip.internode.on.net
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
allow=g729
bindport=5060
bindaddr=0.0.0.0
nat=yes
registertimeout=5
allowoverlap=no
srvlookup=no
ubscribecontext=from-sip
callcounter=yes [Company2]
...
[Company3]
...
[Company4]
...





And here is some of the "extensions.conf" file:


Quote:
[incoming]
; Get the DID number from the TO header.
exten => s,1,Set(thedid="${SIP_HEADER(TO)}")
exten => s,2,Set(pseudodid=${SIP_HEADER(To)})
exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})
; Direct the DID accordingly.
exten => s,5,GotoIf($["${pseudodid}" = "081"]?internal,33,1:6)
exten => s,6,GotoIf($["${pseudodid}" = "082"]?internal,88,1:7) 
exten => s,7,GotoIf($["${pseudodid}" = "083"]?internal,36,1:Cool
exten => s,8,GotoIf($["${pseudodid}" = "084"]?internal,36,1:9)
exten => s,9,GotoIf($["${pseudodid}" = "085"]?internal,36,1:10)
exten => s,10,GotoIf($["${pseudodid}" = "086"]?internal,89,1:11)
exten => s,11,GotoIf($["${pseudodid}" = "087"]?internal,36,1:12)
exten => s,12,GotoIf($["${pseudodid}" = "088"]?internal,13,1:13)















Since your objective is to have the receptionist identify the company she should be answering to then might I suggest a simple workaround to your problem.  Since right here you are already sending the call to the expected internal context and extension, you could simply alter the Caller Name and put in the Company Name so she could see it on the screen.  Something like:

[internal]
exten => 33,1,Set(CALLERID(name)=Company1:${CALLERID})
...
exten => 88,1,Set(CALLERID(name)=Company2:${CALLERID})
...
exten => 36,1,Set(CALLERID(name)=Company3:${CALLERID})
...
etc...

That will display the Company Name you want to see followed by the caller ID #
Quote:


-Andrew Galdes







On Thu, Apr 2, 2015 at 3:46 PM, Dmitriy Serov <serov.d.p@gmail.com (serov.d.p@gmail.com)> wrote:
Quote:

This is one of the chronic problems. Try this option in sip.conf:
match_auth_username=yes

Carefully read the description, it is better to test in "after hours".

02.04.2015 2:50, Andrew Galdes пишет:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew











--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






--
Technical Support
http://www.cellroute.net
Back to top
serov.d.p at gmail.com
Guest





PostPosted: Wed Apr 08, 2015 12:45 am    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

Hi, Andrew.

You are trying to solve two tasks: definition through what line the call came and a beautiful display of this information.
1. definition through what line the call came. If the username and password for inbound and outbound registration the same, then try the following:
a) delete "register" lines.
b) add option "callbackextension=Company1" to Company1 friend section.. And in others with their names too.
or you can change "/s" to "/Company1" in register line.

2. beautiful display of this information
a) add option "setvar=fromCompany=Company1" to Company1 friend section..
b) In dialplan add
Set(CALLERID(name)=${fromCompany} ${CALLERID(name)})

Maybe this will help?

Dmitiy.

08.04.2015 2:48, Andrew Galdes пишет:

Quote:
Hi Dmitriy and others and thanks for your help so far.


The option "match_auth_username=yes" seems to have had no effect. From my reading, this option will try to match the username of the incoming SIP account to a section heading. If that is how it must work then i can see a big problem. I'm trying to present the receptionist with a nice display of which line the call came in on. For example, the receptionist answers calls for 8 different companies and would like the phone to display the company name that she should announce to the caller. 


Here is a more complete output of an incoming call. I've changed the SIP numbers to "Company1', etc, to hide the numbers. 


Quote:
Connected to Asterisk 10.12.4 currently running on asterisk (pid = 32267)
Verbosity is at least 12
asterisk*CLI> 
asterisk*CLI> 
asterisk*CLI> 
  == Using SIP RTP CoS mark 5
    -- Executing [s@incoming:1] Set("SIP/Company1-00000797", "thedid=""NodePhone"<sip:Company2@sip.internode.on.net ([email]sip%3ACompany2@sip.internode.on.net[/email])>"") in new stack
    -- Executing [s@incoming:2] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2@sip.internode.on.net>") in new stack
    -- Executing [s@incoming:3] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2") in new stack
    -- Executing [s@incoming:4] Set("SIP/Company1-00000797", "pseudodid= sip:Company2") in new stack
    -- Executing [s@incoming:5] GotoIf("SIP/Company1-00000797", "0?internal,33,1:6") in new stack
    -- Goto (incoming,s,6)
    -- Executing [s@incoming:6] GotoIf("SIP/Company1-00000797", "0?internal,88,1:7") in new stack
    -- Goto (incoming,s,7)
    -- Executing [s@incoming:7] GotoIf("SIP/Company1-00000797", "0?internal,36,1:8") in new stack
    -- Goto (incoming,s,Cool
    -- Executing [s@incoming:8] GotoIf("SIP/Company1-00000797", "1?internal,36,1:9") in new stack
    -- Goto (internal,36,1)
    -- Executing [36@internal:1] Set("SIP/Company1-00000797", "CALLERID(name)=SIP/Company1-00000797") in new stack
    -- Executing [36@internal:2] Dial("SIP/Company1-00000797", "SIP/36,20") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/36
    -- SIP/36-00000798 is ringing
  == Spawn extension (internal, 36, 2) exited non-zero on 'SIP/Company1-00000797'
asterisk*CLI> exit



And here is the "sip.conf":


Quote:
[general]
match_auth_username=yes
register=081...:...@sip.internode.on.net/s
register=082...:...@sip.internode.on.net/s
register=083...:...@sip.internode.on.net:/s ([email]register=083...:...@sip.internode.on.net:/s[/email])
register=084...:...@sip.internode.on.net:/s ([email]register=084...:...@sip.internode.on.net:/s[/email])
register=085...:...@sip.internode.on.net/s
register=086...:...@sip.internode.on.net/s
register=087...:...@sip.internode.on.net/s
register=088...:...@sip.internode.on.net/s

[Company1]
username=081...
fromuser=081...
secret=...
canreinvite=no
qualify=yes
context=incoming
type=friend
insecure=invite,port
fromdomain=sip.internode.on.net
host=sip.internode.on.net
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
allow=g729
bindport=5060
bindaddr=0.0.0.0
nat=yes
registertimeout=5
allowoverlap=no
srvlookup=no
ubscribecontext=from-sip
callcounter=yes [Company2]
...
[Company3]
...
[Company4]
...





And here is some of the "extensions.conf" file:


Quote:
[incoming]
; Get the DID number from the TO header.
exten => s,1,Set(thedid="${SIP_HEADER(TO)}")
exten => s,2,Set(pseudodid=${SIP_HEADER(To)})
exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})
; Direct the DID accordingly.
exten => s,5,GotoIf($["${pseudodid}" = "081"]?internal,33,1:6)
exten => s,6,GotoIf($["${pseudodid}" = "082"]?internal,88,1:7) 
exten => s,7,GotoIf($["${pseudodid}" = "083"]?internal,36,1:Cool
exten => s,8,GotoIf($["${pseudodid}" = "084"]?internal,36,1:9)
exten => s,9,GotoIf($["${pseudodid}" = "085"]?internal,36,1:10)
exten => s,10,GotoIf($["${pseudodid}" = "086"]?internal,89,1:11)
exten => s,11,GotoIf($["${pseudodid}" = "087"]?internal,36,1:12)
exten => s,12,GotoIf($["${pseudodid}" = "088"]?internal,13,1:13)











-Andrew Galdes







On Thu, Apr 2, 2015 at 3:46 PM, Dmitriy Serov <serov.d.p@gmail.com (serov.d.p@gmail.com)> wrote:
Quote:

This is one of the chronic problems. Try this option in sip.conf:
match_auth_username=yes

Carefully read the description, it is better to test in "after hours".

02.04.2015 2:50, Andrew Galdes пишет:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew











--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






Back to top
salah.elharit200 at gm...
Guest





PostPosted: Wed Apr 08, 2015 10:34 am    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

what about 

exten => s,1,Goto(from-trunk,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)



regards


2015-04-08 5:45 GMT+00:00 Dmitriy Serov <serov.d.p@gmail.com (serov.d.p@gmail.com)>:
Quote:
Hi, Andrew.

You are trying to solve two tasks: definition through what line the call came and a beautiful display of this information.
1. definition through what line the call came. If the username and password for inbound and outbound registration the same, then try the following:
a) delete "register" lines.
b) add option "callbackextension=Company1" to Company1 friend section.. And in others with their names too.
or you can change "/s" to "/Company1" in register line.

2. beautiful display of this information
a) add option "setvar=fromCompany=Company1" to Company1 friend section..
b) In dialplan add
Set(CALLERID(name)=${fromCompany} ${CALLERID(name)})

Maybe this will help?

Dmitiy.

08.04.2015 2:48, Andrew Galdes пишет:

Quote:
Hi Dmitriy and others and thanks for your help so far.


The option "match_auth_username=yes" seems to have had no effect. From my reading, this option will try to match the username of the incoming SIP account to a section heading. If that is how it must work then i can see a big problem. I'm trying to present the receptionist with a nice display of which line the call came in on. For example, the receptionist answers calls for 8 different companies and would like the phone to display the company name that she should announce to the caller. 


Here is a more complete output of an incoming call. I've changed the SIP numbers to "Company1', etc, to hide the numbers. 


Quote:
Connected to Asterisk 10.12.4 currently running on asterisk (pid = 32267)
Verbosity is at least 12
asterisk*CLI> 
asterisk*CLI> 
asterisk*CLI> 
  == Using SIP RTP CoS mark 5
    -- Executing [s@incoming:1] Set("SIP/Company1-00000797", "thedid=""NodePhone"<sip:Company2@sip.internode.on.net ([email]sip%3ACompany2@sip.internode.on.net[/email])>"") in new stack
    -- Executing [s@incoming:2] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2@sip.internode.on.net>") in new stack
    -- Executing [s@incoming:3] Set("SIP/Company1-00000797", "pseudodid="NodePhone"<sip: sip:Company2") in new stack
    -- Executing [s@incoming:4] Set("SIP/Company1-00000797", "pseudodid= sip:Company2") in new stack
    -- Executing [s@incoming:5] GotoIf("SIP/Company1-00000797", "0?internal,33,1:6") in new stack
    -- Goto (incoming,s,6)
    -- Executing [s@incoming:6] GotoIf("SIP/Company1-00000797", "0?internal,88,1:7") in new stack
    -- Goto (incoming,s,7)
    -- Executing [s@incoming:7] GotoIf("SIP/Company1-00000797", "0?internal,36,1:8") in new stack
    -- Goto (incoming,s,Cool
    -- Executing [s@incoming:8] GotoIf("SIP/Company1-00000797", "1?internal,36,1:9") in new stack
    -- Goto (internal,36,1)
    -- Executing [36@internal:1] Set("SIP/Company1-00000797", "CALLERID(name)=SIP/Company1-00000797") in new stack
    -- Executing [36@internal:2] Dial("SIP/Company1-00000797", "SIP/36,20") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/36
    -- SIP/36-00000798 is ringing
  == Spawn extension (internal, 36, 2) exited non-zero on 'SIP/Company1-00000797'
asterisk*CLI> exit



And here is the "sip.conf":


Quote:
[general]
match_auth_username=yes
register=081...:...@sip.internode.on.net/s
register=082...:...@sip.internode.on.net/s
register=083...:...@sip.internode.on.net:/s ([email]register=083...:...@sip.internode.on.net:/s[/email])
register=084...:...@sip.internode.on.net:/s ([email]register=084...:...@sip.internode.on.net:/s[/email])
register=085...:...@sip.internode.on.net/s
register=086...:...@sip.internode.on.net/s
register=087...:...@sip.internode.on.net/s
register=088...:...@sip.internode.on.net/s

[Company1]
username=081...
fromuser=081...
secret=...
canreinvite=no
qualify=yes
context=incoming
type=friend
insecure=invite,port
fromdomain=sip.internode.on.net
host=sip.internode.on.net
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
allow=g729
bindport=5060
bindaddr=0.0.0.0
nat=yes
registertimeout=5
allowoverlap=no
srvlookup=no
ubscribecontext=from-sip
callcounter=yes [Company2]
...
[Company3]
...
[Company4]
...





And here is some of the "extensions.conf" file:


Quote:
[incoming]
; Get the DID number from the TO header.
exten => s,1,Set(thedid="${SIP_HEADER(TO)}")
exten => s,2,Set(pseudodid=${SIP_HEADER(To)})
exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})
; Direct the DID accordingly.
exten => s,5,GotoIf($["${pseudodid}" = "081"]?internal,33,1:6)
exten => s,6,GotoIf($["${pseudodid}" = "082"]?internal,88,1:7) 
exten => s,7,GotoIf($["${pseudodid}" = "083"]?internal,36,1:Cool
exten => s,8,GotoIf($["${pseudodid}" = "084"]?internal,36,1:9)
exten => s,9,GotoIf($["${pseudodid}" = "085"]?internal,36,1:10)
exten => s,10,GotoIf($["${pseudodid}" = "086"]?internal,89,1:11)
exten => s,11,GotoIf($["${pseudodid}" = "087"]?internal,36,1:12)
exten => s,12,GotoIf($["${pseudodid}" = "088"]?internal,13,1:13)











-Andrew Galdes







On Thu, Apr 2, 2015 at 3:46 PM, Dmitriy Serov <serov.d.p@gmail.com (serov.d.p@gmail.com)> wrote:
Quote:

This is one of the chronic problems. Try this option in sip.conf:
match_auth_username=yes

Carefully read the description, it is better to test in "after hours".

02.04.2015 2:50, Andrew Galdes пишет:

Quote:
Hello all,

I have an Asterisk server (Asterisk 10.12.4) with multiple sip accounts with the same service provides. We have 8 phone numbers in total. 


Incoming calls from the public are all correctly directed to appropriate office handsets. However, the display on the reception phone (the only one i care about) is always showing the same "SIP/Account1_0843214321" rather than the account representing the number dialed. 


For-instance, if Sam on her mobile calls "0811111111", Asterisk will show a log entry like the following:


-- Executing [s@incoming:1] Set("SIP/Account1_0822222222", "thedid=""NodePhone"<sip:0811111111@sip.internode.on.net>"") in new stack
But "Account1_0822222222" (as the name suggests) has a phone number of "0822222222" and not "0811111111". 


So Sam's call will come through and be routed to the correct handset as the business needs, but it seems that all incoming calls are being labeled as though coming in on a different account. The effective problem is that the calledID is now wrong. 


I'm after some general advice on how to handle the problem. 


Ta,


-Andrew











--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users











--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
johnkiniston at gmail.com
Guest





PostPosted: Wed Apr 08, 2015 12:02 pm    Post subject: [asterisk-users] Asterisk Inbound calls, multiple SIP accoun Reply with quote

Andrew,


Instead of your SET and GOTO blocks I'd recommend using the Asterisk DB to make things easier to maintain.

You could make two database entries for each of your DID's

database put 4259981810 name JohnPersonal

database put 4259981810 target kiniston-extern,john-personal,1


Then you could do a single block that would do the lookup and call routing:

Set(DESTINATION=${CUT(PASSTHRU(${SIP_HEADER(TO):5}),@,1)})
Set(CALLERID(name)=${DB(${DESTINATION}/name)})
Goto(${DB(${DESTINATION}/target)})




On Tue, Apr 7, 2015 at 6:06 PM, Andrew Galdes <andrew.galdes@agix.com.au (andrew.galdes@agix.com.au)> wrote:
Quote:
Solved it, kinda. It's not cute. I'm sure this is the way NOT to do it but it does work. For prosperity, the SIP service is through Internode. 


Here is my "extensions.conf" file:

exten => s,5,Set(callersname=${IF($[ ${pseudodid} = 081...]?Company1:${callersname})})
exten => s,6,Set(callersname=${IF($[ ${pseudodid} = 082...]?Company2:${callersname})})


exten => s,13,GotoIf($["${callersname}" = "Company1"]?internal,36,1:14); to reception
exten => s,14,GotoIf($["${callersname}" = "Company2"]?internal,88,1:15); to department1

And later in same file:


Quote:
; Phone 36 reception
exten => 36,1,Set(CALLERID(name)=${callersname})
exten => 36,n,Dial(SIP/36,20)
exten => 36,n,VoiceMail(36,u)
exten => 36,n,Hangup



Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services