Yes I known, I can change the number for inbound calls giving by the provider. Only if I ask him to do that. But normaly, I may be able to choose the number line with which I want to made my calls. By example:
If I want to use Selfone to make a call, because I have two providers (Selfone and Belgium Voip) registered on my Asterisk from scratch installation.
On selfone, I have 4 numbers lines for inbound/outbound calls. I want to use one of them for make my outbond call. How tell to Asterisk to use the number 028085449 by example who is a number giving by selfone, for make the call ?
I try this one on my dialplan but is out with belgium voip. Look my Dialplan:
[globals]
;incoming number defintion selfone
LIEGE = 042680871
BXL_IN1 = 028085449
BXL_IN2 = 028089982
BXL_IN3 = 025882060
[from-Internal]
;========================== Choose your CallerID =========================
exten => 300,1,NoOp(## Outgoing Call from Selfone ##)
same => n,NoOp(## Your CallerID is : ${CALLERID(all)} for ${EXTEN} ##)
same => n,Set(CALLERID(num)=028085449)
same => n,GotoIf(BXL_IN1=${CALLERID(num)}?selfone)
same => n(selfone),Playback(enter-ext-of-person)
same => n,WaitExten(30)
same => n,Dial(PJSIP/selfone-voip/${EXTEN}@outgoing-selfone-voip)
same => n,Hangup()
;========================= Include Context ============================
include => outgoing-belgium-voip
include => outgoing-selfone-voip
[outgoing-selfone-voip]
exten => _0XXX,1,Dial(PJSIP/${EXTEN}@selfone-voip)
same => n,Hangup()
exten => _0XXXXXXXX,1,Dial(PJSIP/${EXTEN}@selfone-voip)
same => n,Hangup()
exten => _0XXXXXXXXX,1,Dial(PJSIP/${EXTEN}@selfone-voip)
same => n,Hangup()
[outgoing-belgium-voip]
exten => _0XXX,1,NoOp(${EXTEN})
;same => n,Set(CALLERID(num)=042771412)
same => n,Ringing()
same => n,Dial(PJSIP/${EXTEN}@belgium-voip)
same => n,Hangup()
exten => _0XXXXXXXX,1,NoOp(${EXTEN})
;same => n,Set(CALLERID(num)=042771412)
same => n,Ringing()
same => n,Ringing()
same => n,Dial(PJSIP/${EXTEN}@belgium-voip)
same => n,Hangup()
exten => _0XXXXXXXXX,1,NoOp(${EXTEN})
; same => n,Set(CALLERID(num)=042771412)
same => n,Ringing()
same => n,Dial(PJSIP/${EXTEN}@belgium-voip)
same => n,Hangup()
;====================================== Incoming Calls =================================
[from-belgium-voip]
exten => _028992018,1,NoOp(### Incoming call from outside to 028992018 ###)
same => n,Ringing()
same => n,Dial(PJSIP/101,20)
same => n,Dial(PJSIP/102,20)
same => n,VoiceMail(101)
same => n,Hangup()
[from-selfone-voip]
exten = _028085449,1,(## Appel entrant sur les EXT. 106 et 107 ##)
same => n,Ringing()
same => n,Dial(PJSIP/101,20&PJSIP/102,20)
same => n,VoiceMail(101)
same => n,Hangup()
exten = _028089982,1,(## Appel entrant sur les EXT. 108 et 109 ##)
same => n,Ringing()
same => n,Dial(PJSIP/101,20&PJSIP/102,20)
same => n,VoiceMail(101)
same => n,Hangup()
exten = _025882060,1,(## Appel entrant sur les EXT. 110 et 111 ##)
same => n,Ringing()
same => n,Dial(PJSIP/101,20&PJSIP/102,20)
same => n,VoiceMail(101)
same => n,Hangup()
exten = _042681959,1,(## Appel entrant sur les EXT. 112 et 113 ##)
same => n,Ringing()
same => n,Dial(PJSIP/101,20&PJSIP/102,20)
same => n,VoiceMail(101)
same => n,Hangup()