[problem] all outgoing calls through one account

hi,
all outgoing calls go through one account (number), how to make outgoing calls using its own account and present/identifying its own number?

extensions.conf

[default]
exten => 123,1,Dial(SIP/123,25)
exten => 234,1,Dial(SIP/234,25)
exten => 345,1,Dial(SIP/345,25)
exten => 456,1,Dial(SIP/456,25)
exten => 567,1,Dial(SIP/567,25) 
exten => 678,1,Dial(SIP/678,25) 
exten => 789,1,Dial(SIP/789,25) 
exten => 890,1,Dial(SIP/890,25) 
exten => 901,1,Dial(SIP/901,25) 
exten => 012,1,Dial(SIP/012,25) 

[macro-phone]
;switch => Realtime
exten => s,1,Dial(SIP/${MACRO_EXTEN},25)
exten => s,n,Goto(${DIALSTATUS},1)
exten => ANSWER,1,Hangup
exten => CANCEL,1,Hangup
exten => NOANSWER,1,Voicemail(${MACRO_EXTEN}@default,u)
exten => BUSY,1,Voicemail(${MACRO_EXTEN}@default,b)
exten => CONGESTION,1,Voicemail(${MACRO_EXTEN}@default,b)
exten => CHANUNAVAIL,1,Voicemail(${MACRO_EXTEN}@default,u)
exten => a,1,VoicemailMain(${MACRO_EXTEN}@default)

[users]
;exten => _XXXX,1,Macro(phone)
exten => 123,1,Macro(phone)
exten => 234,1,Macro(phone)
exten => 345,1,Macro(phone)
exten => 456,1,Macro(phone)
exten => 567,1,Dial(SIP/567,25) ;conference room
exten => 678,1,Macro(phone)
exten => 789,1,Macro(phone)
exten => 890,1,Macro(phone)
exten => 901,1,Macro(phone)
exten => 012,1,Macro(phone)

;mobile and local (outgoing via konto010)
exten => _XXXXXXXXX,1,Dial(SIP/konto010/${EXTEN})

;international
exten => _00XXXXXXXXXX,1,Dial(SIP/konto010/${EXTEN})
exten => _00XXXXXXXXXXX,1,Dial(SIP/konto010/${EXTEN})
exten => _00XXXXXXXXXXXX,1,Dial(SIP/konto010/${EXTEN})
exten => _00XXXXXXXXXXXXX,1,Dial(SIP/konto010/${EXTEN})

;emergency
exten => _XXX,1,Dial(SIP/konto010/${EXTEN})

sip.conf

register => konto003:********@external.sip.server.com/123
register => konto004:********@external.sip.server.com/234
register => konto005:********@external.sip.server.com/345
register => konto007:********@external.sip.server.com/456
register => konto008:********@external.sip.server.com/567
register => konto009:********@external.sip.server.com/678
register => konto010:********@external.sip.server.com/789
register => konto013:********@external.sip.server.com/890
register => konto014:********@external.sip.server.com/901
register => konto015:********@external.sip.server.com/012

brgds

Outgoing is easy. Replace konto010 by different secton names according to the account you want to use. You may have to calculate it or look it up, according to ${CALLERID(num)}.

This assumes that they are distinguishable to the remote peer. I can’t tell whether that is true because you didn’t include the part of sip.conf that would have contained the fromuser parameter.

[quote=“david55”]Outgoing is easy. Replace konto010 by different secton names according to the account you want to use. You may have to calculate it or look it up, according to ${CALLERID(num)}.

This assumes that they are distinguishable to the remote peer. I can’t tell whether that is true because you didn’t include the part of sip.conf that would have contained the fromuser parameter.[/quote]

there is no fromuser parameter in my sip.conf
there is only:

[general]
context=default
allowguest=yes
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=alaw,ulaw,h264,h263
language=en
useragent=Asterisk
videosupport=yes
maxcallbitrate=2048
alwaysauthreject = yes 
rtpkeepalive=30 
nat=route
canreinvite=no 

and naturally my register => …

users are in mysql, but i would like to change it.

this is not my configuration, I inherited it from previous person.

That shouldn’t work at all, unless konto010 is also a valid relative domain name. Your use of allowguest=yes is questionable.

If konto010 is being used directly as a domain name, you are not passing anything to the service provider that would allow them to distinguish the accounts, as it is unlikely that they would examine the domain name to do that. The only likely way of distinguishing for outgoing calls would be if they used the from user to distinguish between accounts with the same address.

A better solution would be to use a proper PSTN type account, rather than lots of single user accounts.

[quote=“david55”]That shouldn’t work at all, unless konto010 is also a valid relative domain name. Your use of allowguest=yes is questionable.

If konto010 is being used directly as a domain name, you are not passing anything to the service provider that would allow them to distinguish the accounts, as it is unlikely that they would examine the domain name to do that. The only likely way of distinguishing for outgoing calls would be if they used the from user to distinguish between accounts with the same address.

A better solution would be to use a proper PSTN type account, rather than lots of single user accounts.[/quote]

konto010 is a username for sip account in my voip provider.

Not when you use it here:

In this context, it would normally be the section name in sip.conf, but could also be a partial domain name.

[quote=“david55”]Not when you use it here:

In this context, it would normally be the section name in sip.conf, but could also be a partial domain name.[/quote]

there is no extra section in sip.conf, and this works (all outgoing calls through this account).

I suppose it might be implied by the register, but that would be a strange way of doing things, certainly not one I have ever seen before. The prefered way is actually to not have the register.

What does sip show peer give for it?

In any case, if it works without an explicit fromuser, I think you can reasonably safely assume that the service provider can’t cope with multiple users at the same IP address.

[quote=“david55”]I suppose it might be implied by the register, but that would be a strange way of doing things, certainly not one I have ever seen before. The prefered way is actually to not have the register.

What does sip show peer give for it?
[/quote]

*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status Realtime
0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline]

[quote=“david55”]
In any case, if it works without an explicit fromuser, I think you can reasonably safely assume that the service provider can’t cope with multiple users at the same IP address.[/quote]

they claim that is no problem.

I don’t know how outgoing calls are working at all if you have no peers and konto010 is not a domain name.

Ask them how they distinguish between users at the same IP address.