OBS: Användning av denna dokumentation sker på egen risk!
Denna text har skapats (filer bifogade) som ett självändamål för att spara in tid och hårbortfall vid eventuella framtida omkonfigurationer av Asterisk, om detta behov någon gång skulle uppstå. Det finns ingen egentlig support i bemärkelsen "Hej, hur gör man detta? Jag får inte rätt på det!" - allt som egentligen behövs är mycket tålamod och lite engelska kunskaper, eftersom grundhjälpen har inhämtats från http://www.voip-info.org/. Vill du ha riktig hjälp, läs förslagsvis där innan du börjar ställa frågor som saknar svar. Har du några frågar som jag KAN besvara, så gör jag givetvis det.
Om detta inlägg
Informationen i denna text bygger på att man har fler SIP-baserade abonnemang hos telefoni-operatören Megaphone. Hur din konfiguration kommer fungera hos någon annan operatör har jag ingen aning om. Ej heller har jag någon aning om den kommer att fungera hos dig om du tar del av den. Det grundläggande upplägget som bör räcka för att få flera telefonnummer (eller ett!) att fungera för både in- och utgående telefoni beskrivs dock, enligt nedan. Det är som tidigare skrivet, ej garanterat att detta fungerar för alla.
Konfigurationen öppnar möjligheten att ta emot ett samtal på flera telefoner, där den som svarar först tar samtalet. Utgående telefoni fungerar också, men skall man kunna ringa ut från två olika nummer måste också Asterisk anpassas efter möjligheterna, med lite fulkod. Jag kallar detta för "fusktrunk" även om benämningen troligen är helt felaktig (konfigurationen är inkluderad enligt nedan, vilket innebär att om man med denna konfiguration använder en extra nolla i början av riktnumret så används linje 2 för utgående samtal).
Operatörens egna forking-möjligheter rekommenderas starkt, eftersom operatören då tillhandahåller denna tjänst i stället för dig. Detta lär vara stabilare samt ger en del andra fördelar - såsom faktisk support. I Asterisk får du klara dig själv om telefonen plötsligt slutar fungera.Observera även att Asterisk i dessa exempel innehåller specialkonfiguration för andra ändamål också, främst intern röstbrevlåda. Detta kan medföra att allt inte kommer att fungera på önskat sätt för andra som installerat Asterisk då all konfigurering utöver dessa exempel är individuell och nedanstående har av oförklarlig anledning skrivits på engelska.
Övriga frågor och svar följer under dessa konfigurationer.
sip.conf
extensions.conf
Specialanpassningar
Jag har ju två nummer... men när det ringer in vet jag inte vilket av numren jag söks på!
I de fall då tester har utförts med Asterisk så visas inkommande telefonnummer i stil med
Detta leder givetvis till problem eftersom SIP_HEADER(TO) inte kan användas på det sätt som var tänkt (denna information kan med sökningsfunktioner återfinnas på voip-info, se länk ovan). Så vitt jag förstått det, så är det ”s@xxx” som ställer till det, då numret egentligen skulle visats där istället (i stil med ”0435xxxxx@”), vilket gör att man inte kan identifiera destinationen med sip-headern. Att destinationen omnämns på samma rad spelar heller ingen roll.
Därför skrev jag om några rader i konfigurationsfilerna. Dels så lade jag in följande exten-rad i extensions.conf, efter callerid-raden:
Detta gör att jag kan se till vilket nummer någon ringer, åtminstone I SIP-klienten (X-lite). Hur det blir i en vanlig nummerpresentatör kan jag faktiskt inte svara på (det är mycket troligt att resultatet dels är för långt och jag misstänker att alla nummerpresentatörer inte klarar av formateringen på numret). Resultatet blir nämligen, exempelvis:

I sip.conf har jag tidigare angett att mitt andra nummer skall gå direkt till en specifik extension:
Detta ändrar jag nu på, till:
Sedan lägger jag upp en ny extension under [allextensions]:
Nu kommer displayen, när det ringer på det andra numret visa upp till exempel:
Denna text har skapats (filer bifogade) som ett självändamål för att spara in tid och hårbortfall vid eventuella framtida omkonfigurationer av Asterisk, om detta behov någon gång skulle uppstå. Det finns ingen egentlig support i bemärkelsen "Hej, hur gör man detta? Jag får inte rätt på det!" - allt som egentligen behövs är mycket tålamod och lite engelska kunskaper, eftersom grundhjälpen har inhämtats från http://www.voip-info.org/. Vill du ha riktig hjälp, läs förslagsvis där innan du börjar ställa frågor som saknar svar. Har du några frågar som jag KAN besvara, så gör jag givetvis det.
Om detta inlägg
Informationen i denna text bygger på att man har fler SIP-baserade abonnemang hos telefoni-operatören Megaphone. Hur din konfiguration kommer fungera hos någon annan operatör har jag ingen aning om. Ej heller har jag någon aning om den kommer att fungera hos dig om du tar del av den. Det grundläggande upplägget som bör räcka för att få flera telefonnummer (eller ett!) att fungera för både in- och utgående telefoni beskrivs dock, enligt nedan. Det är som tidigare skrivet, ej garanterat att detta fungerar för alla.
Konfigurationen öppnar möjligheten att ta emot ett samtal på flera telefoner, där den som svarar först tar samtalet. Utgående telefoni fungerar också, men skall man kunna ringa ut från två olika nummer måste också Asterisk anpassas efter möjligheterna, med lite fulkod. Jag kallar detta för "fusktrunk" även om benämningen troligen är helt felaktig (konfigurationen är inkluderad enligt nedan, vilket innebär att om man med denna konfiguration använder en extra nolla i början av riktnumret så används linje 2 för utgående samtal).
Operatörens egna forking-möjligheter rekommenderas starkt, eftersom operatören då tillhandahåller denna tjänst i stället för dig. Detta lär vara stabilare samt ger en del andra fördelar - såsom faktisk support. I Asterisk får du klara dig själv om telefonen plötsligt slutar fungera.Observera även att Asterisk i dessa exempel innehåller specialkonfiguration för andra ändamål också, främst intern röstbrevlåda. Detta kan medföra att allt inte kommer att fungera på önskat sätt för andra som installerat Asterisk då all konfigurering utöver dessa exempel är individuell och nedanstående har av oförklarlig anledning skrivits på engelska.
Övriga frågor och svar följer under dessa konfigurationer.
sip.conf
Code:
[FONT=Times New Roman][SIZE=3][general][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=default ; Default context for incoming calls[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]allowoverlap=no ; Disable overlap dialing support. (Default is yes)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]srvlookup=yes ; Enable DNS SRV lookups on outbound calls[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]realm=asterisk[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]domain=my.sip.domain ; Set default domain for this host[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] ; If configured, Asterisk will only allow[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] ; INVITE and REFER to non-local domains[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] ; Use "sip show domains" to list local domains[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3];disallow=all ; First disallow all codecs[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]allow=ulaw ; Allow codecs in order of preference[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]allow=ulaw[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]allow=alaw[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]allow=g729[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Be careful with this[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]sipdebug = yes ; Turn on SIP debugging by default, from[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]recordhistory=yes ; Record SIP history by default [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]dumphistory=yes ; Dump SIP history at end of SIP dialogue[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3];; SIP Phone 1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]register => username.megaphone.se:password@sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3];; SIP Phone 2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; /1001 = Connect immediately to extension 1001 and pass by any automated messages...[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; (this seem to be linked to the extension-config)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]register => username.megaphone.se:password@sip.megaphone.se/1001[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]localnet=10.0.0.0/255.0.0.0[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]localnet=192.168.0.0/255.255.0.0[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]nat=yes ; Global NAT settings (Affects all peers and users)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]canreinvite=no ; Asterisk by default tries to redirect the[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][authentication][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Obviously not required (Dual stuff)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3];;;auth=username.megaphone.se:password@sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3];;;auth=username.megaphone.se:password@sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3];;;; USER CONFIGURATION[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Main extension for home[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][self][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=friend[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=me[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=mypassword[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=dynamic[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=myextension[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]regexten=1001[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Let the Vood have its own extension if this runs on SIP[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][self-vood][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=friend[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=self-vood[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=voodpassword[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=dynamic[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=myextension[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]regexten=1011[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Let the Nokia on![/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][selfmobile][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=friend[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=selfmobile[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=mobilepassword[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=dynamic[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=myextension[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]regexten=1010[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][user1][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=friend[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=user1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=password1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=dynamic[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=user1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]regexten=2000[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][user2][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=friend[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=user2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=password2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=dynamic[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=user2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]regexten=2001[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; The PEERS (Megaphone)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][NUM1][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=peer[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=username.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]fromdomain=sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]insecure=very[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]qualify=yes[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]nat=yes[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=password[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=default[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][NUM2][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]type=peer[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]username=username.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]fromdomain=sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]insecure=very[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]qualify=yes[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]nat=yes[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]secret=password[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]host=sip.megaphone.se[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]context=default[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
extensions.conf
Code:
[FONT=Times New Roman][SIZE=3][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][general][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]static=yes[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]writeprotect=no[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]clearglobalvars=no[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]priorityjumping=yes[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3];#include "filename.conf"[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][globals][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]CONSOLE=Console/dsp ; Console interface for demo[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3];TRUNK=Zap/G2 ; Trunk interface[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Never required... (This is dual number!)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3];;;SIPtrunk=SIP/username.megaphone.se:password@sip.megaphone.se ; SIP trunk[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3];;;SIPtrunk=SIP/username.megaphone.se:password@sip.megaphone.se ; SIP trunk[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Used by everybody! (Incoming connections)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][default][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => allextensions[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,1,NoOp(${SIP_HEADER})[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,NoOp(${CALLERID})[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,Wait(1)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,Answer[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Play a message![/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,BackGround(welcome)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Wait for a beep for about 2 sec![/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,WaitExten(2)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Play another message (in this case: "redirecting your call")[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,BackGround(calling_dittsamtal)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; If no extension set above, dial those number for 30 sec[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,Dial(SIP/self&SIP/selfmobile&SIP/self-vood,30)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Then check status...[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; And send to voicemail for extension 1001 on no answer[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s-NOANSWER,1,VoiceMail(1001,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][self][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => default[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => outgoing[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][self-vood][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => default[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => allextensions[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => outgoing[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][selfmobile][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => default[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => outgoing[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Only allow internal calls for user 1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][user1][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => allextensions[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1000,1,Voicemailmain(1000)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Allow the same as "self" for user2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][user2][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => allextensions[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]include => outgoing[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1000,1,Voicemailmain(1000)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => _X.,1,Dial(SIP/${EXTEN}@NUM1,30,r) [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; All outgoing extensions[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][outgoing][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Allow yourself to dial between your external extensions[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => NUM1,1,Dial(SIP/${EXTEN}@NUM2,30,r)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => NUM2,1,Dial(SIP/${EXTEN}@NUM1,30,r)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Anything else goes out through NUM1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => _X.,1,Dial(SIP/${EXTEN}@NUM1,30,r) [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; But if any call starts with an extra zero, use NUM2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; This makes both numbers available for outbound traffic[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => _00X.,1,Dial(SIP/${EXTEN:1}@NUM2,30,r)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => s-NOANSWER,n,VoiceMail(${ARG1},u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Internal usage[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][allextensions][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Extension 1000 - Voicemail![/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1000,1,Voicemailmain(1000)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Self extension and the default! Try for 20 sec[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1001,1,Dial(SIP/self&SIP/self-vood&SIP/selfmobile,20)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Missed calls goes to voicemail[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1001,2,VoiceMail(1001,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Others[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1010,1,Dial(SIP/selfmobile,20)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1010,2,VoiceMail(1001,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1011,1,Dial(SIP/self-vood,20)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 1011,2,VoiceMail(1001,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; User 1[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 2000,1,Dial(SIP/user1,20)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 2000,2,VoiceMail(2000,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; User 2[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 2001,1,Dial(SIP/user2,20)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => 2001,2,VoiceMail(2001,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]; Invalid extensions goes to voicemail[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]exten => i,1,VoiceMail(1001,u)[/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT]
Specialanpassningar
Jag har ju två nummer... men när det ringer in vet jag inte vilket av numren jag söks på!
I de fall då tester har utförts med Asterisk så visas inkommande telefonnummer i stil med
Code:
To: "0435xxxxxx"
Detta leder givetvis till problem eftersom SIP_HEADER(TO) inte kan användas på det sätt som var tänkt (denna information kan med sökningsfunktioner återfinnas på voip-info, se länk ovan). Så vitt jag förstått det, så är det ”s@xxx” som ställer till det, då numret egentligen skulle visats där istället (i stil med ”0435xxxxx@”), vilket gör att man inte kan identifiera destinationen med sip-headern. Att destinationen omnämns på samma rad spelar heller ingen roll.
Därför skrev jag om några rader i konfigurationsfilerna. Dels så lade jag in följande exten-rad i extensions.conf, efter callerid-raden:
Code:
exten => s,n,Set(CALLERID(num)=${CALLERID(num)} to 0435xxxxxx)
Detta gör att jag kan se till vilket nummer någon ringer, åtminstone I SIP-klienten (X-lite). Hur det blir i en vanlig nummerpresentatör kan jag faktiskt inte svara på (det är mycket troligt att resultatet dels är för långt och jag misstänker att alla nummerpresentatörer inte klarar av formateringen på numret). Resultatet blir nämligen, exempelvis:
Code:
[I]0812345677 to 0435123456@127.0.0.1[/I]

I sip.conf har jag tidigare angett att mitt andra nummer skall gå direkt till en specifik extension:
Code:
[I]register => username.megaphone.se:password@sip.megaphone.se/1001[/I]
Detta ändrar jag nu på, till:
Code:
[I]register => username.megaphone.se:password@sip.megaphone.se/1020[/I]
Sedan lägger jag upp en ny extension under [allextensions]:
Code:
[I]exten => 1020,1,Set(CALLERID(num)=${CALLERID(num)} to 0435xxxxxx)[/I]
[I]exten => 1020,n,Dial(SIP/self&SIP/self-vood&SIP/selfmobile,20)[/I]
Nu kommer displayen, när det ringer på det andra numret visa upp till exempel:
Code:
[I]0812345677 to 0435654321@127.0.0.1[/I]
