On Thu, Feb 24, 2011 at 7:31 AM, Axelle <[email protected]> wrote:

> Hi Danny,
>

Try this code, it uses the SIPCHANINFO function to get the peername of the
device that's attempting to create the roaming extension, instead of the
callerid.  Basically, you need to store some kind of contact info for the
roaming phone for it to be any use at all. If you don't have a peername for
the phone, you could try SIPCHANINFO(peerip) instead.

[roaming-ext]
;Create a new roaming extension
exten => 3001,1(readop),Verbose(Create roaming extension)
exten => 3001,n,Read(digito,beep,3)
exten => 3001,n,Playback(you-entered)
exten => 3001,n,SayDigits(${digito})
exten => 3001,n,Verbose(Setting roaming extension 4${digito} to call
${SIPCHANINFO(peername)})
exten => 3001,n,Set(DB(roam/${digito})=${SIPCHANINFO(peername)})
exten => 3001,n,Playback(vm-goodbye)
exten => 3001,n,Hangup()

;Dial a roaming extension
exten => _4XXX,1,Verbose(Calling roaming extension ${EXTEN})
exten => _4XXX,n,Set(ROAMEXT=${DB(roam/${EXTEN:1})})
exten => _4XXX,n,Dial(SIP/${ROAMEXT},30)


-- 
Thanks,
--Warren Selby, dCAP
http://www.selbytech.com
--
_____________________________________________________________________
-- 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

Reply via email to