OSPLookup()

Since N/A Applications Found this useful? Upvote it. ×

Lookup destination by OSP.

Last reviewed 2026-03-07

OSPLookup(exten,[provider,[options]])
Dialplan Builder -- build your OSPLookup() command
The exten of the call.
The name of the provider that is used to route the call.
Full arguments reference
  • exten - The exten of the call.

  • provider - The name of the provider that is used to route the call.

  • options

    • h - generate H323 call id for the outbound call

    • s - generate SIP call id for the outbound call. Have not been implemented

    • i - generate IAX call id for the outbound call. Have not been implemented

Description

Looks up destination via OSP.

Input variables:

  • OSPINACTUALSRC - The actual source device IP address in indirect mode.

  • OSPINPEERIP - The last hop IP address.

  • OSPINTECH - The inbound channel technology for the call.

  • OSPINHANDLE - The inbound call OSP transaction handle.

  • OSPINTIMELIMIT - The inbound call duration limit in seconds.

  • OSPINNETWORKID - The inbound source network ID.

  • OSPINNPRN - The inbound routing number.

  • OSPINNPCIC - The inbound carrier identification code.

  • OSPINNPDI - The inbound number portability database dip indicator.

  • OSPINSPID - The inbound service provider identity.

  • OSPINOCN - The inbound operator company number.

  • OSPINSPN - The inbound service provider name.

  • OSPINALTSPN - The inbound alternate service provider name.

  • OSPINMCC - The inbound mobile country code.

  • OSPINMNC - The inbound mobile network code.

  • OSPINTOHOST - The inbound To header host part.

  • OSPINRPIDUSER - The inbound Remote-Party-ID header user part.

  • OSPINPAIUSER - The inbound P-Asserted-Identify header user part.

  • OSPINDIVUSER - The inbound Diversion header user part.

  • OSPINDIVHOST - The inbound Diversion header host part.

  • OSPINPCIUSER - The inbound P-Charge-Info header user part.

  • OSPINCUSTOMINFON - The inbound custom information, where 'n' is the index beginning with '1' upto '8'.
    Output variables:

  • OSPOUTHANDLE - The outbound call OSP transaction handle.

  • OSPOUTTECH - The outbound channel technology for the call.

  • OSPDESTINATION - The outbound destination IP address.

  • OSPOUTCALLING - The outbound calling number.

  • OSPOUTCALLED - The outbound called number.

  • OSPOUTNETWORKID - The outbound destination network ID.

  • OSPOUTNPRN - The outbound routing number.

  • OSPOUTNPCIC - The outbound carrier identification code.

  • OSPOUTNPDI - The outbound number portability database dip indicator.

  • OSPOUTSPID - The outbound service provider identity.

  • OSPOUTOCN - The outbound operator company number.

  • OSPOUTSPN - The outbound service provider name.

  • OSPOUTALTSPN - The outbound alternate service provider name.

  • OSPOUTMCC - The outbound mobile country code.

  • OSPOUTMNC - The outbound mobile network code.

  • OSPOUTTOKEN - The outbound OSP token.

  • OSPDESTREMAILS - The number of remained destinations.

  • OSPOUTTIMELIMIT - The outbound call duration limit in seconds.

  • OSPOUTCALLIDTYPES - The outbound Call-ID types.

  • OSPOUTCALLID - The outbound Call-ID. Only for H.323.

  • OSPDIALSTR - The outbound Dial command string.
    This application sets the following channel variable upon completion:

  • OSPLOOKUPSTATUS - The status of OSPLookup attempt as a text string, one of

    • SUCCESS

    • FAILED

    • ERROR

Arguments
  • exten - The exten of the call.

  • provider - The name of the provider that is used to route the call.

  • options

    • h - generate H323 call id for the outbound call

    • s - generate SIP call id for the outbound call. Have not been implemented

    • i - generate IAX call id for the outbound call. Have not been implemented

User Notes

Know a tip or gotcha for this topic? Share it below and help others.

Contribute a note

Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.

Moderated before publishing. Email never shown.
Applications
ConfBridge() MusicOnHold() StartMusicOnHold() StopMixMonitor() ADSIProg() AELSub() AGI() AMD() AddQueueMember() AgentLogin() AgentRequest() AlarmReceiver() Answer() AttendedTransfer() AudioSocket() Authenticate() Background() BackgroundDetect() BlindTransfer() Bridge() BridgeAdd() BridgeWait() Broadcast() Busy() CELGenUserEvent() CallCompletionCancel() CallCompletionRequest() ChanIsAvail() ChanSpy() ChangeMonitor() ChannelRedirect() ClearHash() ConfKick() Congestion() ContinueWhile() ControlPlayback() DAHDIAcceptR2Call() DAHDIRAS() DAHDIScan() DAHDISendCallreroutingFacility() DAHDISendKeypadFacility() DBdeltree() DISA() DateTime() DeadAGI() Dial() Dictate() Directory() DumpChan() EAGI() Echo() Else() ElseIf() EndIf() EndWhile() Exec() ExecIf() ExecIfTime() ExitIf() ExitWhile() ExtenSpy() ExternalIVR() Festival() Flash() FollowMe() ForkCDR() GetCPEID() Gosub() GosubIf() Goto() GotoIf() GotoIfTime() Hangup() HangupCauseClear() IAX2Provision() ICES() IVRDemo() If() ImportVar() Incomplete() JACK() JabberJoin() JabberLeave() JabberSend() JabberSendGroup() JabberStatus() Log() MP3Player() MSet() Macro() MacroExclusive() MacroExit() MacroIf() MailboxExists() MeetMe() MeetMeAdmin() MeetMeChannelAdmin() MeetMeCount() MessageSend() Milliwatt() MinivmAccMess() MinivmDelete() MinivmGreet() MinivmMWI() MinivmNotify() MinivmRecord() MixMonitor() Monitor() Morsecode() NBScat() NoCDR() NoOp() ODBCFinish() ODBC_Commit() ODBC_Rollback() OSPAuth() OSPFinish() OSPLookup() OSPNext() Originate() PJSIPHangup() PJSIPNotify() Page() Park() ParkAndAnnounce() ParkedCall() PauseMonitor() PauseQueueMember() Pickup() PickupChan() PlayTones() Playback() PrivacyManager() Proceeding() Progress() Queue() QueueLog() QueueUpdate() RaiseException() Read() ReadExten() ReceiveFAX() ReceiveMF() ReceiveSF() ReceiveText() Record() Reload() RemoveQueueMember() ResetCDR() RetryDial() Return() Ringing() SIPAddHeader() SIPDtmfMode() SIPRemoveHeader() SIPSendCustomINFO() SLAStation() SLATrunk() SMS() SayAlpha() SayAlphaCase() SayCountedAdj() SayCountedNoun() SayDigits() SayMoney() SayNumber() SayOrdinal() SayPhonetic() SayUnixTime() SendDTMF() SendFAX() SendImage() SendMF() SendSF() SendText() SendURL() Set() SetAMAFlags() Signal() SkelGuessNumber() SoftHangup() SpeechActivateGrammar() SpeechBackground() SpeechCreate() SpeechDeactivateGrammar() SpeechDestroy() SpeechLoadGrammar() SpeechProcessingSound() SpeechStart() SpeechUnloadGrammar() StackPop() Stasis() StatsD() StopMonitor() StopMusicOnHold() StopPlayTones() StoreDTMF() StreamEcho() System() TestClient() TestServer() ToneScan() Transfer() TryExec() TrySystem() UnpauseMonitor() UnpauseQueueMember() UserEvent() VMAuthenticate() VMSayName() Verbose() VoiceMail() VoiceMailMain() VoiceMailPlayMsg() Wait() WaitDigit() WaitExten() WaitForCondition() WaitForNoise() WaitForRing() WaitForSignal() WaitForSilence() WaitForTone() WaitUntil() While() Zapateller()
Applications
ConfBridge() MusicOnHold() StartMusicOnHold() StopMixMonitor() ADSIProg() AELSub() AGI() AMD() AddQueueMember() AgentLogin() AgentRequest() AlarmReceiver() Answer() AttendedTransfer() AudioSocket() Authenticate() Background() BackgroundDetect() BlindTransfer() Bridge() BridgeAdd() BridgeWait() Broadcast() Busy() CELGenUserEvent() CallCompletionCancel() CallCompletionRequest() ChanIsAvail() ChanSpy() ChangeMonitor() ChannelRedirect() ClearHash() ConfKick() Congestion() ContinueWhile() ControlPlayback() DAHDIAcceptR2Call() DAHDIRAS() DAHDIScan() DAHDISendCallreroutingFacility() DAHDISendKeypadFacility() DBdeltree() DISA() DateTime() DeadAGI() Dial() Dictate() Directory() DumpChan() EAGI() Echo() Else() ElseIf() EndIf() EndWhile() Exec() ExecIf() ExecIfTime() ExitIf() ExitWhile() ExtenSpy() ExternalIVR() Festival() Flash() FollowMe() ForkCDR() GetCPEID() Gosub() GosubIf() Goto() GotoIf() GotoIfTime() Hangup() HangupCauseClear() IAX2Provision() ICES() IVRDemo() If() ImportVar() Incomplete() JACK() JabberJoin() JabberLeave() JabberSend() JabberSendGroup() JabberStatus() Log() MP3Player() MSet() Macro() MacroExclusive() MacroExit() MacroIf() MailboxExists() MeetMe() MeetMeAdmin() MeetMeChannelAdmin() MeetMeCount() MessageSend() Milliwatt() MinivmAccMess() MinivmDelete() MinivmGreet() MinivmMWI() MinivmNotify() MinivmRecord() MixMonitor() Monitor() Morsecode() NBScat() NoCDR() NoOp() ODBCFinish() ODBC_Commit() ODBC_Rollback() OSPAuth() OSPFinish() OSPLookup() OSPNext() Originate() PJSIPHangup() PJSIPNotify() Page() Park() ParkAndAnnounce() ParkedCall() PauseMonitor() PauseQueueMember() Pickup() PickupChan() PlayTones() Playback() PrivacyManager() Proceeding() Progress() Queue() QueueLog() QueueUpdate() RaiseException() Read() ReadExten() ReceiveFAX() ReceiveMF() ReceiveSF() ReceiveText() Record() Reload() RemoveQueueMember() ResetCDR() RetryDial() Return() Ringing() SIPAddHeader() SIPDtmfMode() SIPRemoveHeader() SIPSendCustomINFO() SLAStation() SLATrunk() SMS() SayAlpha() SayAlphaCase() SayCountedAdj() SayCountedNoun() SayDigits() SayMoney() SayNumber() SayOrdinal() SayPhonetic() SayUnixTime() SendDTMF() SendFAX() SendImage() SendMF() SendSF() SendText() SendURL() Set() SetAMAFlags() Signal() SkelGuessNumber() SoftHangup() SpeechActivateGrammar() SpeechBackground() SpeechCreate() SpeechDeactivateGrammar() SpeechDestroy() SpeechLoadGrammar() SpeechProcessingSound() SpeechStart() SpeechUnloadGrammar() StackPop() Stasis() StatsD() StopMonitor() StopMusicOnHold() StopPlayTones() StoreDTMF() StreamEcho() System() TestClient() TestServer() ToneScan() Transfer() TryExec() TrySystem() UnpauseMonitor() UnpauseQueueMember() UserEvent() VMAuthenticate() VMSayName() Verbose() VoiceMail() VoiceMailMain() VoiceMailPlayMsg() Wait() WaitDigit() WaitExten() WaitForCondition() WaitForNoise() WaitForRing() WaitForSignal() WaitForSilence() WaitForTone() WaitUntil() While() Zapateller()