Jump to content

Figuring out Email adress of Caller (Internal)


Nick
 Share


Go to solution Solved by Tom Wellige,

Recommended Posts

I'm trying to figure out a way of knowing the E-Mail adress of the Person Calling (Internal).

 

Function EMAIL(Number)

    PBXScript.OutputTrace "--------->EMAIL()" & Number
    dim oPBXConfig
    set oPBXConfig = PBXScript.CreateObject("IpPBxSrv.PBXConfig")

    oPBXConfig.Initialize PBXUser

    dim oUser
    set oUser = oPBXConfig.GetUserByAddress(Number)
    dim oUsers
    dim a

    For Each oUsers in oUser
        a = oUsers.EMailAdress
    Next

    EMAIL = a


    PBXScript.OutputTrace "E-Mail adress: " & EMAIL
    PBXScript.OutputTrace "---------------->E-Mail"
    PBXScript.OutputTrace "Calles Number: " & Number
    PBXScript.OutputTrace "---------------->Called Number"

    PBXScript.OutputTrace "<-------------EMAIL()
      
End Function

 

Number = CalledNumber()

 

i've tried following this: https://www.enreach.de/en/products/support/knowledge-base/article-details.html?tx_swyxkbase_pi1[kbid]=kb2910 

but 'oUser' doesn't support 'EMailAdress' anymore.

 

Is there any way i've missed to get the Email adress of the caller?

Link to comment
Share on other sites


To my knowledge there haven't been any changes on that interface. I have more or less just moved the entire Server Script API documentation into a new format and for that checked with the developers for any changes.

 

I will check again and will come back to you.

 

Btw: this is the current documentation of the GetUserByAddress function:

 

 

Link to comment
Share on other sites


  • Solution

I just figured that you have a typo in your property name. It is "EMailAddress", not "EMailAdress".

 

I have also streamlined your code a little bit. As there is already a global PBXConfig object available, there is no need to instantiate your own one:

 

Function EMAIL(sNumber)

    PBXScript.OutputTrace "--------->EMAIL(" & sNumber & ")"

    dim oUsers
    set oUsers = g_PBXConfig.GetUserByAddress(sNumber)
    dim oUser, sReturn

    For Each oUser in oUsers
        sReturn = oUser.EMailAddress
    Next

    EMAIL = sReturn

    PBXScript.OutputTrace "sReturn = " & sReturn
    PBXScript.OutputTrace "<-------------EMAIL"
      
End Function

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.