Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. SQL query for incoming calls

SQL query for incoming calls

Scheduled Pinned Locked Moved Support
7 Posts 2 Posters 162 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    C
    CTJackal
    wrote on last edited by
    #1

    Hi, I seem to have managed to get the Phonebook working, but any incoming calls are simply displaying the extension or ring group rather than the incoming CID.

    For example:

    DID: 01432765098
    Incoming CID: 01234567890
    Inbound rules : 01432765098 -> Ring Group 700
    Ring Group 700: Ext 500 & Ext 501

    The FOP2 screen shows an incoming call, but it appears to come from Ext 700, so nothing is returned from the SQL query.
    When I checked the SQL query, it reads:

    SELECT concat(firstname,' ',lastname,'<br/>',company) as name,picture FROM visual_phonebook WHERE phone1 LIKE '%500'OR phone2 LIKE '%500' LIMIT 1

    For some reason FOP2 seems to be picking up the called ring group as the CID. Any iseas how to correct this to show the actual CID?

    Carlos.

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      Hello Carlos,

      I do not think is FOP not picking the callerid, but Asterisk setting it, at least when it comes to AMI events. I do not know how are you managing ring groups (I do not use ring groups myself), but in your ring group macro/context perhaps you can force the callerid or set it before dialing.

      You can start fop2 in debug mode to catch the manager events ( ./fop2_server -X 3 ) and look for the Callerid on those events.

      Best regards,

      1 Reply Last reply
      0
      • C
        C
        CTJackal
        wrote on last edited by
        #3

        Thnaks for you quick response Nicolas. I've set up one of the incoming DDIs to go straight to a single extension (500) and I've done as you suggest re: debugging mode, and the line I suspect I should be looking at is:

        127.0.0.1 <- Event: AGIExec
        127.0.0.1 <- Privilege: call,all
        127.0.0.1 <- SubEvent: End
        127.0.0.1 <- Channel: SIP/87.xxx.xxx.242-09e92118
        127.0.0.1 <- CommandId: 1478964973
        127.0.0.1 <- Command: VERBOSE "Caller ID name is 'Main Number - Xxxx Xxxxxxxx Xxxxxxx' number is '017xxxxxx00'" 1
        127.0.0.1 <- ResultCode: 200
        127.0.0.1 <- Result: Success
        127.0.0.1 <- Server: 0

        I've blanked out the personal data with xxxx in the above.

        I assume that Asterisk is passing the info through. I have set up Asterisk to use a different SQL database, hence it recognises the name associated with the caller ID.

        What should I be looking for if not the above section?

        Cheers,
        Carlos.

        1 Reply Last reply
        0
        • C
          C
          CTJackal
          wrote on last edited by
          #4

          Hi Nicolas,

          Just a thought, but could it be that the problem lies here:

          127.0.0.1 <- Event: NewCallerid
          127.0.0.1 <- Privilege: call,all
          127.0.0.1 <- Channel: SIP/87.xxx.xxx.242-09ea55c0
          127.0.0.1 <- CallerIDNum: 01700
          127.0.0.1 <- CallerIDName: Main Number - 017
          00
          127.0.0.1 <- Uniqueid: 1266074985.21
          127.0.0.1 <- CID-CallingPres: 0 (Presentation Allowed, Not Screened)
          127.0.0.1 <- Server: 0

          This is the output from Asterisk 1.6, and I think that the 1.4 version would output:

          127.0.0.1 <- CallerID: 017******00

          Rather than CallerIDNum:

          Could this be the issue?

          Carlos.

          1 Reply Last reply
          0
          • C
            C
            CTJackal
            wrote on last edited by
            #5

            Hi Nicolas,

            Just installed Asterisk 1.4 in order to test this. The equivalent output is:

            127.0.0.1 <- Event: Newchannel
            127.0.0.1 <- Privilege: call,all
            127.0.0.1 <- Channel: SIP/87.127.240.98-08595bf8
            127.0.0.1 <- State: Down
            127.0.0.1 <- CallerIDNum: 0769
            127.0.0.1 <- CallerIDName: 07
            69
            127.0.0.1 <- Uniqueid: 1266495006.279
            127.0.0.1 <- Server: 0

            127.0.0.1 <- Event: Newstate
            127.0.0.1 <- Privilege: call,all
            127.0.0.1 <- Channel: SIP/87.127.240.98-08595bf8
            127.0.0.1 <- State: Ring
            127.0.0.1 <- CallerID: 0769
            127.0.0.1 <- CallerIDName: 07
            69
            127.0.0.1 <- Uniqueid: 1266495006.279
            127.0.0.1 <- Server: 0

            The main difference between this and Asterisk 1.6 appears to be the "CallerIDName:" being presented as the caller ID in v1.4, but presented as the CID Name Prefix + caller ID in v1.6.

            Could this be why it's working in 1.4 and not in 1.6?

            Carlos.

            1 Reply Last reply
            0
            • N
              N
              nicolas
              wrote on last edited by
              #6

              Hi Carlos,

              FOP2 knows about the difference in the Callerid names in 1.4 and 1.6. Your problem is not that, but something else in the dialplan. There are other events in AMI that affect callerid, independent of the header names. A full trace with debug level 1 ( -X 1) should be needed for tracking the problem down. Best regards,

              --
              Nicolás

              1 Reply Last reply
              0
              • N
                N
                nicolas
                wrote on last edited by
                #7

                Carlos, if you can start fop2_server in debug level 1 mode , then make the call that exhibits that behaviour and send me the capture together with your button config I might be able to track the problem down. You can also try to catch me in the site's live help system to arrange ssh access to your machines. Best regards,

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better đź’—

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                Powered by NodeBB Contributors
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups