Hello, I've managed to build in the "last number repeat" outlined at http://www.voip-info.org/wiki-Asterisk+last+number+repeat to call back the last person _I_ called from a particular phone, and now I'd like to try to do something similar for the common *69 -- call back the last number that called me. I assume I'll do part of this in my standard extension macro -- capturing the last callerid number that called a particular extension, along w/some sort of dbput command. Then in my [apps], a *69 extension that grabs that info & dials it. Anyone have an example of such a configuration, or hints (i.e. what variable I'll catch in my standard extension macro)? Thanks! Jeremy Jones
How about just before you dial an extension you do a: DBput(LAST/${EXTEN}=${CALLERID_NUMBER}) and then *69 does a: DBget(dialNum=LAST/${CALLERID_NUMBER}) (from your extension) and you can dial it? I've never tried it, but that might be a simple starting point... On Jun 22, 2004, at 12:48 PM, Jeremy Jones wrote:> Hello, > > I've managed to build in the "last number repeat" outlined at > http://www.voip-info.org/wiki-Asterisk+last+number+repeat to call back > the last person _I_ called from a particular phone, and now I'd like to > try to do something similar for the common *69 -- call back the last > number that called me. I assume I'll do part of this in my standard > extension macro -- capturing the last callerid number that called a > particular extension, along w/some sort of dbput command. Then in my > [apps], a *69 extension that grabs that info & dials it. Anyone have > an > example of such a configuration, or hints (i.e. what variable I'll > catch > in my standard extension macro)? > > Thanks! > Jeremy Jones > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >-Michael
Got it!> How about just before you dial an extension you do a: > DBput(LAST/${EXTEN}=${CALLERID_NUMBER}) > > and then *69 does a: > DBget(dialNum=LAST/${CALLERID_NUMBER}) > > (from your extension) and you can dial it?Here's what I've done-- In my extension macro: exten=s,1,DBput(LastCIDNum/${DNID}=${CALLERIDNUM}) ; grab CALLERIDNUM & store it for the dialed number as LastCIDNum exten=etc... And in my [apps]: ; Return last call exten => *69,1,DBget(temp=LastCIDNum/${CALLERIDNUM}) ; read db value LastCIDNum for this CALLERIDNUM (i.e. the extension making the call) exten => *69,2,GotoIf($[${temp:0:3} = 208]?3:4) ; if it's area code 208 (my local area), go to priority 3, otherwise priority 4 exten => *69,3,Macro(dialout,${temp:3}) ; call my dialout macro, stripping the 208 exten => *69,4,Macro(dialout,${temp}) ; call my dialout macro, using full string exten => *69,103,Congestion ; no key? congestion exten => *69,104,Congestion ; no key? congestion Works like a friggin charm! Jeremy Jones
This:> ; Return last call > exten => *69,1,DBget(temp=LastCIDNum/${CALLERIDNUM}) ; read db value > LastCIDNum for this CALLERIDNUM (i.e. the extension making the call) > exten => *69,2,GotoIf($[${temp:0:3} = 208]?3:4) > ; if it's area > code 208 (my local area), go to priority 3, otherwise priority 4 > exten => *69,3,Macro(dialout,${temp:3}) > ; call my > dialout macro, stripping the 208 > exten => *69,4,Macro(dialout,${temp}) ; call my > dialout macro, using full string > exten => *69,103,Congestion ; no > key? congestion > exten => *69,104,Congestion ; no > key? congestionShould be this: exten => *69,1,DBget(temp=LastCIDNum/${CALLERIDNUM}) exten => *69,2,GotoIf($[${temp:0:3} = 208]?3:4) exten => *69,3,Macro(dialout,${temp:3}) exten => *69,4,Macro(dialout,${temp}) exten => *69,102,Congestion jeremy
Jeremy Jones wrote:>>exten=s,1,DBput(LastCIDNum/${DNID}=${CALLERIDNUM}) ; grab >>CALLERIDNUM & store it for the dialed number as LastCIDNum exten=etc... > > exten => *69,1,DBget(temp=LastCIDNum/${CALLERIDNUM}) > exten => *69,2,GotoIf($[${temp:0:3} = 208]?3:4) > exten => *69,3,Macro(dialout,${temp:3}) > exten => *69,4,Macro(dialout,${temp}) > exten => *69,102,CongestionAre your internal-to-internal calls handled seperately from external-to-internal calls? I see you are accounting for local versus ld calls, but what about when the person in the next cube over calls you? ----- Andrew Thompson http://aktzero.com/
Andrew Thompson wrote:> I see you are accounting for local versus ld calls, but what about when the > person in the next cube over calls you?Also, what will happen if no Caller ID was supplied, or it was marked Private or Out-Of-Area?
Andrew Thompson wrote:> Are your internal-to-internal calls handled seperately from > external-to-internal calls? > > I see you are accounting for local versus ld calls, but what > about when the > person in the next cube over calls you?Well, I have a dual-purpose asterisk setup -- hosted business pbx services and residential services. My dialout macro for residential services does this: [macro-resdialout] exten=s,1,DBput(RepeatDial/${CALLERIDNUM}=${ARG1}) exten=s,2,Dial(SIP/208${ARG1},120,rtT) exten=s,3,Dial(${TRUNK}/9${ARG1},120,rtT) exten=s,4,Busy It first does some work for repeat dialing (not the *69 callback stuff), moves on & tries to get a local sip client, then goes on to dial out the trunk if there's no local sip client. So far, I've not yet worked out the business version... jeremy
Reasonably Related Threads
- Call Forwarding and DND conf
- Fw: setting outgoing caller ID by the queue an extension is logged into
- If Then Else Statements - Outbound Dialling on ISDN using CAPI -Individual Dial out Plans using msns
- Old DBGet/DBPut vs. new Set(var=${DB(...
- DBget and DBput in extensions.conf