| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Wed Feb 23, 2011 11:19 am    Post subject: how to view caller number string from T_ADDRESS tag | 
				     | 
			 
			
				
  | 
			 
			
				Hello, I am trying to retrieve the value of T_ADDRESS number string in following manner:
 
 	  | Code: | 	 		  u8 j2,l2,i2;
 
   u8 *buf2; 
 
   
 
   buf2=malloc (200);
 
   u8 *r2=buf2;
 
   
 
   j2 = get_tag (s, T_ADDRESS);
 
   
 
   if (j2 != 0)
 
   {
 
      l2 = s[j2 + 1];
 
      dbsp ("len=");
 
      dbih (l2);
 
      dbsp ("\n");
 
      for (i2 = 0; i2 < l2; i2++)
 
      {
 
        r2 = sprintch (r2, s[j2 + 2 + i2]);
 
        dbsp ("To Hex=");
 
        dbih (sprintch (r2, s[j2 + 2 + i2]));
 
        dbsp ("\n");
 
        dbsp ("Character=");
 
        dbih (sprintc (r2, s[j2 + 2 + i2]));
 
        dbsp ("\n");
 
        dbsp ("Integer=");
 
        dbih (sprinti(r2, s[j2 + 2 + i2]));
 
        dbsp ("\n");        
 
      }
 
      r2 = sprintc (r2, '#');
 
 
      
 
   } | 	  
 
 
But I am receiving the following trace:
 
 	  | Quote: | 	 		  
 
len=0007
 
To Hex=0623
 
Character=0622
 
Integer=0624
 
To Hex=0625
 
Character=0624
 
Integer=0626
 
To Hex=0627
 
Character=0626
 
Integer=0628
 
To Hex=0629
 
Character=0628
 
Integer=062a
 
To Hex=062b
 
Character=062a
 
Integer=062b
 
To Hex=062d
 
Character=062c
 
Integer=062d
 
To Hex=062f
 
Character=062e
 
Integer=0630 | 	  
 
 
The above I understand/think are the address/location of the numbers. But I want to get hold of number (say: 0787887...) itself and possibly change the number to a different one in the memory location.
 
 
Can anyone kindly tell me how I can achieve that? How to see the actual number provided by the caller? Many thanks. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Wed Feb 23, 2011 1:13 pm    Post subject: Re: how to view caller number string from T_ADDRESS tag | 
				     | 
			 
			
				
  | 
			 
			
				 	  | tkm wrote: | 	 		  Hello, I am trying to retrieve the value of T_ADDRESS number string in following manner:
 
 	  | Code: | 	 		  u8 j2,l2,i2;
 
   u8 *buf2; 
 
   
 
   buf2=malloc (200);
 
   u8 *r2=buf2;
 
   
 
   j2 = get_tag (s, T_ADDRESS);
 
   
 
   if (j2 != 0)
 
   {
 
      l2 = s[j2 + 1];
 
      dbsp ("len=");
 
      dbih (l2);
 
      dbsp ("\n");
 
      for (i2 = 0; i2 < l2; i2++)
 
      {
 
        r2 = sprintch (r2, s[j2 + 2 + i2]);
 
        dbsp ("To Hex=");
 
        dbih (sprintch (r2, s[j2 + 2 + i2]));
 
        dbsp ("\n");
 
        dbsp ("Character=");
 
        dbih (sprintc (r2, s[j2 + 2 + i2]));
 
        dbsp ("\n");
 
        dbsp ("Integer=");
 
        dbih (sprinti(r2, s[j2 + 2 + i2]));
 
        dbsp ("\n");        
 
      }
 
      r2 = sprintc (r2, '#');
 
 
      
 
   } | 	  
 
 
But I am receiving the following trace:
 
 	  | Quote: | 	 		  
 
len=0007
 
To Hex=0623
 
Character=0622
 
Integer=0624
 
To Hex=0625
 
Character=0624
 
Integer=0626
 
To Hex=0627
 
Character=0626
 
Integer=0628
 
To Hex=0629
 
Character=0628
 
Integer=062a
 
To Hex=062b
 
Character=062a
 
Integer=062b
 
To Hex=062d
 
Character=062c
 
Integer=062d
 
To Hex=062f
 
Character=062e
 
Integer=0630 | 	  
 
 
The above I understand/think are the address/location of the numbers. But I want to get hold of number (say: 0787887...) itself and possibly change the number to a different one in the memory location.
 
 
Can anyone kindly tell me how I can achieve that? How to see the actual number provided by the caller? Many thanks. | 	  
 
 
Taking into account that T_ADDRESS is the memory address of the dialed number user has typed in, I tried to change that value like:
 
 	  | Code: | 	 		  
 
u8 *buf3= buf_B (); 
 
u8 *b = buf3;
 
 
    b = sprintc (b, '+');
 
    b = sprintch (b, '0');
 
    b = sprintch (b, '7');
 
    b = sprintch (b, '8');
 
    b = sprintch (b, '7');
 
    b = sprintch (b, '8');
 
    b = sprintch (b, '8');
 
    b = sprintch (b, '7');
 
    b = sprintch (b, '4');
 
    b = sprintch (b, '2');
 
    b = sprintch (b, '3');
 
    b = sprintch (b, '9');
 
    b = sprintc (b, '\0');
 
get_resp_call[get_resp_call_len++] = str2hex (buf3);// which was previously setting T_ADDRESS
 
 | 	  
 
Although in debug trace it shows a different address location:
 
 	  | Quote: | 	 		  | TO ME:    02 0a 07 08 81 00 44 87 87 45 72 48 90 00 | 	   07 instead of usual 06 but it doesn't work/application failes/call diverts fails.
 
 
Please let me know what I am doing wrong here. Many thanks. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Mon Feb 28, 2011 1:26 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				pz? Please some response/feedback/direction...?How to get hold of the T_Address value/number and how can I change the number of T_ADDRESS?
 
Many thanks. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		pz
 
 
  Joined: 12 Mar 2004 Posts: 1161
 
  | 
		
			
				 Posted: Tue Mar 01, 2011 8:20 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				dbih (sprintch (r2, s[j2 + 2 + i2])); is wrong, sprint*() calls add the string/whatever to provided buffer (r2 in your case) and return new pointer that points after the added string. I.e. you are printing the pointer, not the character.
 
 
Just do dbch(s[j2 + 2 + i2]), that's it.
 
 
Further don't forget the msisdn is coded as swapped nibbles. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Wed Mar 02, 2011 9:43 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | pz wrote: | 	 		  dbih (sprintch (r2, s[j2 + 2 + i2])); is wrong, sprint*() calls add the string/whatever to provided buffer (r2 in your case) and return new pointer that points after the added string. I.e. you are printing the pointer, not the character.
 
 
Just do dbch(s[j2 + 2 + i2]), that's it.
 
 
Further don't forget the msisdn is coded as swapped nibbles. | 	  
 
Thanks a lot, pz. Will try that. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Thu Mar 03, 2011 7:20 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | tkm wrote: | 	 		   	  | pz wrote: | 	 		  dbih (sprintch (r2, s[j2 + 2 + i2])); is wrong, sprint*() calls add the string/whatever to provided buffer (r2 in your case) and return new pointer that points after the added string. I.e. you are printing the pointer, not the character.
 
 
Just do dbch(s[j2 + 2 + i2]), that's it.
 
 
Further don't forget the msisdn is coded as swapped nibbles. | 	  
 
Thanks a lot, pz. Will try that. | 	  
 
PZ, I got to see the numbers as per ur advise. Many many thanks. I didn't get what you meant by  	  | Quote: | 	 		  | don't forget the msisdn is coded as swapped nibbles.  | 	  .Would u kindly explain that a bit further? | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Fri Mar 04, 2011 12:09 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Hi pz, is T_ADDRESS always a fixed location? Everytime I trace it gives me 06. I tried to replace it like following:
 
 
 	  | Quote: | 	 		  u8* r = buf_B();
 
 
    r[0] = r;//address of buffer
 
    r[1] = 0X07;//length
 
    r[2] = 0X81;//NPI
 
    r[3] = 0X70;//Number starts here
 
    r[4] = 0X78;
 
    r[5] = 0X88;
 
    r[6] = 0X47;
 
    r[7] = 0X32;
 
    r[8] = 0Xf9;//number ends
 
 
//get_resp_call[get_resp_call_len++] = T_ADDRESS;
 
get_resp_call[get_resp_call_len++] = r; | 	  
 
 
But it doesn't seem to be accepting it and not doing call divert.
 
 
Any thoughts plsssssssss? Many thanks.[/quote] | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		pz
 
 
  Joined: 12 Mar 2004 Posts: 1161
 
  | 
		
			
				 Posted: Mon Mar 07, 2011 5:50 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | tkm wrote: | 	 		  Hi pz, is T_ADDRESS always a fixed location? Everytime I trace it ives me 06. I tried to replace it like following:
 
 | 	  
 
 
You mean in MO_CALL_CONTROL event ENVELOPE or where?
 
Take a look at 11.14 spec, free from www.etsi.org
 
 
Look at autoalarm or pager source - it's handled there.
 
 
 	  | Quote: | 	 		  
 
 	  | Quote: | 	 		  u8* r = buf_B();
 
 
    r[0] = r;//address of buffer
 
    r[1] = 0X07;//length
 
    r[2] = 0X81;//NPI
 
    r[3] = 0X70;//Number starts here
 
    r[4] = 0X78;
 
    r[5] = 0X88;
 
    r[6] = 0X47;
 
    r[7] = 0X32;
 
    r[8] = 0Xf9;//number ends
 
 
//get_resp_call[get_resp_call_len++] = T_ADDRESS;
 
get_resp_call[get_resp_call_len++] = r; | 	  
 
 
But it doesn't seem to be accepting it and not doing call divert.
 
 
Any thoughts plsssssssss? Many thanks. | 	  
 
 
Huh, this doesn't make much sense: r[0]=r and get_resp_call[get_resp_call_len++] = r;
 
 
You must copy content of the buffer - set it properly.
 
 
What are you trying to do? Modify outgoing number? See callback source, it's there. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Tue Mar 08, 2011 4:56 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | pz wrote: | 	 		   	  | tkm wrote: | 	 		  Hi pz, is T_ADDRESS always a fixed location? Everytime I trace it ives me 06. I tried to replace it like following:
 
 | 	  
 
 
You mean in MO_CALL_CONTROL event ENVELOPE or where?
 
Take a look at 11.14 spec, free from www.etsi.org
 
 
Look at autoalarm or pager source - it's handled there.
 
 
 	  | Quote: | 	 		  
 
 	  | Quote: | 	 		  u8* r = buf_B();
 
 
    r[0] = r;//address of buffer
 
    r[1] = 0X07;//length
 
    r[2] = 0X81;//NPI
 
    r[3] = 0X70;//Number starts here
 
    r[4] = 0X78;
 
    r[5] = 0X88;
 
    r[6] = 0X47;
 
    r[7] = 0X32;
 
    r[8] = 0Xf9;//number ends
 
 
//get_resp_call[get_resp_call_len++] = T_ADDRESS;
 
get_resp_call[get_resp_call_len++] = r; | 	  
 
 
But it doesn't seem to be accepting it and not doing call divert.
 
 
Any thoughts plsssssssss? Many thanks. | 	  
 
 
Huh, this doesn't make much sense: r[0]=r and get_resp_call[get_resp_call_len++] = r;
 
 
You must copy content of the buffer - set it properly.
 
 
What are you trying to do? Modify outgoing number? See callback source, it's there. | 	   Thanks a lot pz, for ur reply. Well, I am trying with MO_CALL_CONTROL event envelope now to change outgoing number, but my target is to change SMSC number for sms in the MO_SMS_CONTROL event. I am taking into account that the address packets (where numbers are kept) are same for call-control and sms. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		pz
 
 
  Joined: 12 Mar 2004 Posts: 1161
 
  | 
		
			
				 Posted: Fri Mar 11, 2011 7:17 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				| Yes, it should be similar to MO_CALL_CONTROL. Have you found the 11.14 spec? | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		tkm
 
 
  Joined: 18 Jan 2011 Posts: 72
 
  | 
		
			
				 Posted: Wed Mar 16, 2011 9:40 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | pz wrote: | 	 		  | Yes, it should be similar to MO_CALL_CONTROL. Have you found the 11.14 spec? | 	  
 
I have sorted this prob. Many many thanks for all the information/feedback you gave me. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		 |