0

I'm fairly new to c# and programming. I made a little program for my company to automatically provide new telefons and patterns.

It worked fine until the phone extension/pattern got changed to start with \+43. Before the change it was just the extension (1013), now its \+435094941013.

It's a Cisco Unified Call Manager API/ Cisco AXL, but I didn't really find anything regarding this topic :(

I tried: string line = @"\+43...1013"; and string line = "\\+43...1013";

but I always get a null exception / nothing was found ...
when I manually change it back to the old format without the \+43 it works.

@edit:
The Request looks like this:

string inputline = "\\+435094941013"; // Works with just 1013
string description = "";           

var Lines1 = await axlClient.ExecuteAsync(async client =>
{
    var request = new ListLineReq
    {
        returnedTags = new LLine { description = string.Empty },
        searchCriteria = new ListLineReqSearchCriteria { pattern = inputline}
    };
    var response = await client.listLineAsync(request);

    [email protected](i => new { Description = i.description }).ToList();

    foreach (var row in [email protected]())
    {
        description = row.description;
    }
    return description;
});
8
  • So where do you get the null reference execption? Please provide more context. Commented Jun 22, 2023 at 10:21
  • The prefix is probably not stored as part of the number. Just use the number without the prefix in the old style, using Substring() if necessary. Commented Jun 22, 2023 at 10:28
  • @KlausGütter hey, i edited my question, i hope it's a bit cleared now! Commented Jun 22, 2023 at 10:56
  • @Peter i tryed just +43... and even just 43... but i still just get a null reference expection Commented Jun 22, 2023 at 10:57
  • I mean without the whole prefix of \+43 Commented Jun 22, 2023 at 11:02

1 Answer 1

0

The underlying database for CUCM is Informix IDS, where AXL <listXXX> requests end up using SQL LIKE for matches. The supported wildcards are simply "_" (for single character) and "%" for any character(s). Your code input example seems to be using "..." as an 'any characters' wildcard - if so, that may be the issue.

Just at the HTTP/XML layer, <lineLine> seems to work for me (CUCM v14) using "%":

...
<searchCriteria>
    <pattern>\\+43%1013</pattern>
</searchCriteria>
...
-------------------------------------------
...
<ns:listLineResponse xmlns:ns="http://www.cisco.com/AXL/API/14.0">
  <return>
    <line uuid="{3D105C47-F16B-1FD3-2527-22A74C79028E}">
      <pattern>\+435094941013</pattern>
...

It's possible that some layer between your code and the raw XML sent to CUCM is doing something unexpected with reserved characters/escape characters/etc. - if you can view the actual XML being sent, that may provide some clues...

Sign up to request clarification or add additional context in comments.

1 Comment

working with wildcards resolved my problem! if i search for %+435094941013 (so % instead of ) it finally works!! thank you so much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.